public void ByTest1() { var actual = IEqualityComparerEx.By <String, String>(x => x, new StringLengthComparer()); var equals = actual.Equals("test", "1234"); equals.Should() .BeTrue(); }
public void ByTest() { // ReSharper disable once RedundantArgumentDefaultValue var actual = IEqualityComparerEx.By <String, Int32>(x => x.Length, null); var equals = actual.Equals("test", "1234"); equals.Should() .BeTrue(); }
public void BySelectorNullTest() { Func <String, String> keySelector = null; // ReSharper disable once AssignNullToNotNullAttribute // ReSharper disable once ReturnValueOfPureMethodIsNotUsed Action test = () => IEqualityComparerEx.By(keySelector, new StringLengthComparer()); test.ShouldThrow <ArgumentNullException>(); }