public void LengthThenAsciiComparerNotSameLength() { LengthThenAsciiComparer comparer = new LengthThenAsciiComparer(); var val = comparer.Compare(new Item("myString"), new Item("myOtherString")); Assert.IsTrue(val < 0); }
public void LengthThenAsciiComparerSameString() { LengthThenAsciiComparer comparer = new LengthThenAsciiComparer(); var val = comparer.Compare(new Item("myString"), new Item("myString")); Assert.IsTrue(val == 0); }
public void LengthThenAsciiComparerSameLength() { LengthThenAsciiComparer comparer = new LengthThenAsciiComparer(); var val1 = comparer.Compare(new Item("the"), new Item("fox")); Assert.IsTrue(val1 > 0); var val2 = comparer.Compare(new Item("The"), new Item("fox")); Assert.IsTrue(val2 < 0); var val3 = comparer.Compare(new Item("the"), new Item("The")); Assert.IsTrue(val3 > 0); }
public void LengthThenAsciiComparerNullArgs() { LengthThenAsciiComparer comparer = new LengthThenAsciiComparer(); var val1 = comparer.Compare(null, null); Assert.IsTrue(val1 == 0); var val2 = comparer.Compare(new Item(null), null); Assert.IsTrue(val2 == 0); var val3 = comparer.Compare(new Item(null), new Item("str")); Assert.IsTrue(val3 < 0); var val4 = comparer.Compare(null, new Item(null)); Assert.IsTrue(val4 == 0); var val5 = comparer.Compare(new Item("str"), null); Assert.IsTrue(val5 > 0); }