public void then_it_throws_if_the_list_does_not_contain_a_match() { Assert.Throws <EqualException>(() => SUT.ShouldLookLike(() => new TestObject { Numbers = Some.ListContaining(4) }) ); }
public void then_it_does_not_throw_if_the_list_contains_a_match() { Assert.DoesNotThrow(() => SUT.ShouldLookLike(() => new TestObject { Numbers = Some.ListContaining(1) }) ); }
public void then_it_does_not_throw_if_the_list_contains_a_match() { Assert.DoesNotThrow(() => SUT.ShouldLookLike(() => new TestObject { Children = Some.ListContaining(() => new TestObject { IntValue = 1 }) }) ); }
public void then_it_throws_if_the_list_does_not_contain_a_match() { Assert.Throws <EqualException>(() => SUT.ShouldLookLike(() => new TestObject { Children = Some.ListContaining(() => new TestObject { IntValue = 3 }) }) ); }
public void then_you_can_check_for_an_item_in_a_list() { var warehouse = new Warehouse { Engines = new[] { new Engine { YearBuilt = 2013 }, new Engine { YearBuilt = 2016 } } }; warehouse.ShouldLookLike(() => new Warehouse { Engines = Some.ListContaining(() => new Engine { //Yep, you can use partial matching recursively! YearBuilt = Some.ValueOf <int>(i => i % 2 == 0) }) }); }