mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
29 lines
1.3 KiB
C#
29 lines
1.3 KiB
C#
|
using Xunit;
|
||
|
|
||
|
namespace Wabbajack.Paths.Test
|
||
|
{
|
||
|
public class ArrayExtensionsTests
|
||
|
{
|
||
|
[Fact]
|
||
|
public void AreEqualTests()
|
||
|
{
|
||
|
Assert.True(ArrayExtensions.AreEqual(new[] { 1, 2, 3 }, 0, new[] { 1, 2 }, 0, 2));
|
||
|
Assert.False(ArrayExtensions.AreEqual(new[] { 1, 2, 3 }, 0, new[] { 1, 2 }, 0, 3));
|
||
|
Assert.False(ArrayExtensions.AreEqual(new[] { 1, 2 }, 1, new[] { 1, 2, 3 }, 0, 2));
|
||
|
}
|
||
|
|
||
|
[Fact]
|
||
|
public void CompareTo()
|
||
|
{
|
||
|
Assert.Equal(0, ArrayExtensions.Compare(new[] { 1, 1 }, new[] { 1, 1 }));
|
||
|
Assert.Equal(1, ArrayExtensions.Compare(new[] { 1, 1, 1 }, new[] { 1, 1 }));
|
||
|
Assert.Equal(-1, ArrayExtensions.Compare(new[] { 1, 1 }, new[] { 1, 1, 1 }));
|
||
|
Assert.Equal(1, ArrayExtensions.Compare(new[] { 1, 2 }, new[] { 1, 1, 1 }));
|
||
|
|
||
|
Assert.Equal(0, ArrayExtensions.CompareString(new[] { "1", "1" }, new[] { "1", "1" }));
|
||
|
Assert.Equal(1, ArrayExtensions.CompareString(new[] { "1", "1", "1" }, new[] { "1", "1" }));
|
||
|
Assert.Equal(-1, ArrayExtensions.CompareString(new[] { "1", "1" }, new[] { "1", "1", "1" }));
|
||
|
Assert.Equal(1, ArrayExtensions.CompareString(new[] { "1", "2" }, new[] { "1", "1", "1" }));
|
||
|
}
|
||
|
}
|
||
|
}
|