예제 #1
0
        public void register_against_an_inner_fragment_that_is_not_reversiable()
        {
            var parent = Substitute.For <IWhereFragmentHolder>();
            var not    = new NotWhereFragment(parent);

            var where = new WhereFragment("a = b");

            not.As <IWhereFragmentHolder>().Register(where);

            not.Inner.ShouldBe(where);

            parent.Received().Register(not);
        }
예제 #2
0
        public void register_against_an_inner_fragment_that_is_reversible()
        {
            var parent = Substitute.For <IWhereFragmentHolder>();
            var not    = new NotWhereFragment(parent);

            var reversible = Substitute.For <IReversibleWhereFragment>();
            var reversed   = new WhereFragment("a = b");

            reversible.Reverse().Returns(reversed);

            not.As <IWhereFragmentHolder>().Register(reversible);

            parent.Received().Register(reversed);
        }