예제 #1
0
 public void then_it_throws_if_the_list_does_not_contain_a_match()
 {
     Assert.Throws <EqualException>(() =>
                                    SUT.ShouldLookLike(() => new TestObject
     {
         Numbers = Some.ListContaining(4)
     })
                                    );
 }
예제 #2
0
 public void then_it_does_not_throw_if_the_list_contains_a_match()
 {
     Assert.DoesNotThrow(() =>
                         SUT.ShouldLookLike(() => new TestObject
     {
         Numbers = Some.ListContaining(1)
     })
                         );
 }
예제 #3
0
 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
         })
     })
                         );
 }
예제 #4
0
 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
         })
     })
                                    );
 }
예제 #5
0
            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)
                    })
                });
            }