public void Find_should_return_null_for_non_registered_type() { var customEqualityComparers = new CustomEqualityComparers(); var comparer = customEqualityComparers.Find(typeof(Foo)); Assert.IsNull(comparer); }
public void IsRegisteredFor_should_return_true_for_registered_type() { var customEqualityComparers = new CustomEqualityComparers(); customEqualityComparers.Register <Foo>((x, y) => x.Value == y.Value); EqualityComparison comparer = customEqualityComparers.Find(typeof(Foo)); Assert.IsNotNull(comparer); }
public void Equals_ok(int foo1, int foo2, bool expectedEqual) { var customEqualityComparers = new CustomEqualityComparers(); customEqualityComparers.Register <Foo>((x, y) => x.Value == y.Value); EqualityComparison comparer = customEqualityComparers.Find(typeof(Foo)); bool actualEqual = comparer(new Foo(foo1), new Foo(foo2)); Assert.AreEqual(expectedEqual, actualEqual); }
public void Register_and_unregister_ok() { var customEqualityComparers = new CustomEqualityComparers(); customEqualityComparers.Register <Foo>((x, y) => x.Value == y.Value); customEqualityComparers.Unregister <Foo>(); var comparer = customEqualityComparers.Find(typeof(Foo)); Assert.IsNull(comparer); }
public void Find_with_null_type_should_throw_exception() { var customEqualityComparers = new CustomEqualityComparers(); customEqualityComparers.Find(null); }
public void Generic_Registers_with_null_comparer_should_throw_exception() { var customEqualityComparers = new CustomEqualityComparers(); customEqualityComparers.Register <Foo>(null); }
public void Registers_with_null_comparer_should_throw_exception() { var customEqualityComparers = new CustomEqualityComparers(); customEqualityComparers.Register(typeof(Foo), null); }
public void Registers_with_null_type_should_throw_exception() { var customEqualityComparers = new CustomEqualityComparers(); customEqualityComparers.Register(null, (x, y) => true); }
public void Setup() { var customEqualityComparers = new CustomEqualityComparers(); customEqualityComparers.Unregister <Foo>(); }
public void Unregister_with_null_type_should_throw_exception() { var customEqualityComparers = new CustomEqualityComparers(); customEqualityComparers.Unregister(null); }
public void IsRegisteredFor_should_return_true_for_registered_type() { var customEqualityComparers = new CustomEqualityComparers(); customEqualityComparers.Register<Foo>((x, y) => x.Value == y.Value); EqualityComparison comparer = customEqualityComparers.Find(typeof(Foo)); Assert.IsNotNull(comparer); }
public void Generic_Registers_with_null_comparer_should_throw_exception() { var customEqualityComparers = new CustomEqualityComparers(); customEqualityComparers.Register<Foo>(null); }
public void Register_and_unregister_ok() { var customEqualityComparers = new CustomEqualityComparers(); customEqualityComparers.Register<Foo>((x, y) => x.Value == y.Value); customEqualityComparers.Unregister<Foo>(); var comparer = customEqualityComparers.Find(typeof(Foo)); Assert.IsNull(comparer); }
public void Equals_ok(int foo1, int foo2, bool expectedEqual) { var customEqualityComparers = new CustomEqualityComparers(); customEqualityComparers.Register<Foo>((x, y) => x.Value == y.Value); EqualityComparison comparer = customEqualityComparers.Find(typeof(Foo)); bool actualEqual = comparer(new Foo(foo1), new Foo(foo2)); Assert.AreEqual(expectedEqual, actualEqual); }
public void Setup() { var customEqualityComparers = new CustomEqualityComparers(); customEqualityComparers.Unregister<Foo>(); }