public void ExceptionPropertyCollectionEquivalenceTesting() { // Arrange var expected = new SomeNode() { Id = 1, Name = "Moo" }; var test = new[] { new SomeNode() { Id = 1, Name = "Moo" } }; // Pre-assert // Act Assert.That( () => { Expect(() => throw new ExceptionWithNode(expected)) .To.Throw <ExceptionWithNode>() .With.CollectionProperty(e => e.Nodes) .Equivalent.To(test); }, Throws.Nothing); }
protected bool Equals(SomeNode other) { return(Id == other.Id && String.Equals(Name, other.Name)); }