public void InequalityTest() { Criterion criterion1 = new Criterion("this is a random text"); Criterion criterion2 = new Criterion("this also"); Assert.IsTrue(criterion1 != criterion2); Assert.IsFalse(criterion1.Equals((object)criterion2)); Assert.IsFalse(criterion1.Equals(criterion2)); }
public void SutDoesNotEqualAnyObject(object other) { var sut = new Criterion <PlatformID>( PlatformID.Unix, new DelegatingEqualityComparer <PlatformID>()); var actual = sut.Equals(other); Assert.False(actual, "SUT should not equal object of other type."); }
public void SutDoesNotEqualAnyObject(object other) { var sut = new Criterion <ConsoleColor>( ConsoleColor.Cyan, new DelegatingEqualityComparer <ConsoleColor>()); var actual = sut.Equals(other); Assert.False(actual, "SUT should not equal object of other type."); }
public void SutEqualsIdenticalValue() { var target = Guid.NewGuid(); var comparer = new DelegatingEqualityComparer<Guid>(); var sut = new Criterion<Guid>(target, comparer); var other = new Criterion<Guid>(target, comparer); var actual = sut.Equals(other); Assert.True(actual, "Expected structural equality to hold."); }
public void SutEqualsIdenticalValue() { var target = Guid.NewGuid(); var comparer = new DelegatingEqualityComparer <Guid>(); var sut = new Criterion <Guid>(target, comparer); var other = new Criterion <Guid>(target, comparer); var actual = sut.Equals(other); Assert.True(actual, "Expected structural equality to hold."); }
public void SutDoesNotEqualOtherWhenTargetDiffers( int sutTarget, int otherTarget) { var comparer = new DelegatingEqualityComparer <int>(); var sut = new Criterion <int>(sutTarget, comparer); var other = new Criterion <int>(otherTarget, comparer); var actual = sut.Equals(other); Assert.False( actual, "SUT shouldn't equal other with different target"); }
public void SutDoesNotEqualOtherWhenComparerDiffers(string target) { var sut = new Criterion <string>( target, new DelegatingEqualityComparer <string>()); var other = new Criterion <string>( target, new DelegatingEqualityComparer <string>()); var actual = sut.Equals(other); Assert.False( actual, "SUT shouldn't equal other with different comparer."); }
public void EqualsReturnsComparerResult( string target, string candidate, bool expected) { var comparer = new DelegatingEqualityComparer<string> { OnEquals = (x, y) => { Assert.Equal(target, x); Assert.Equal(candidate, y); return expected; } }; var sut = new Criterion<string>(target, comparer); var actual = sut.Equals(candidate); Assert.Equal(expected, actual); }
public void EqualsReturnsComparerResult( string target, string candidate, bool expected) { var comparer = new DelegatingEqualityComparer <string> { OnEquals = (x, y) => { Assert.Equal(target, x); Assert.Equal(candidate, y); return(expected); } }; var sut = new Criterion <string>(target, comparer); var actual = sut.Equals(candidate); Assert.Equal(expected, actual); }
public void SutDoesNotEqualAnyObject(object other) { var sut = new Criterion<PlatformID>( PlatformID.Unix, new DelegatingEqualityComparer<PlatformID>()); var actual = sut.Equals(other); Assert.False(actual, "SUT should not equal object of other type."); }
public void SutDoesNotEqualOtherWhenComparerDiffers(string target) { var sut = new Criterion<string>( target, new DelegatingEqualityComparer<string>()); var other = new Criterion<string>( target, new DelegatingEqualityComparer<string>()); var actual = sut.Equals(other); Assert.False( actual, "SUT shouldn't equal other with different comparer."); }
public void SutDoesNotEqualOtherWhenTargetDiffers( int sutTarget, int otherTarget) { var comparer = new DelegatingEqualityComparer<int>(); var sut = new Criterion<int>(sutTarget, comparer); var other = new Criterion<int>(otherTarget, comparer); var actual = sut.Equals(other); Assert.False( actual, "SUT shouldn't equal other with different target"); }