Exemplo n.º 1
0
        public void False_if_any_part_is_false(bool value1, bool value2, bool value3)
        {
            var state1 = A.Fake <IState>();

            A.CallTo(() => state1.Matches(A <Puzzle> .Ignored)).Returns(value1);
            var state2 = A.Fake <IState>();

            A.CallTo(() => state2.Matches(A <Puzzle> .Ignored)).Returns(value2);
            var state3 = A.Fake <IState>();

            A.CallTo(() => state3.Matches(A <Puzzle> .Ignored)).Returns(value3);

            var andState = new AndState(ImmutableArray.Create(state1, state2, state3));

            Assert.False(andState.Matches(null));
        }
Exemplo n.º 2
0
        public void True_if_all_parts_are_true()
        {
            var state1 = A.Fake <IState>();

            A.CallTo(() => state1.Matches(A <Puzzle> .Ignored)).Returns(true);
            var state2 = A.Fake <IState>();

            A.CallTo(() => state2.Matches(A <Puzzle> .Ignored)).Returns(true);
            var state3 = A.Fake <IState>();

            A.CallTo(() => state3.Matches(A <Puzzle> .Ignored)).Returns(true);

            var andState = new AndState(ImmutableArray.Create(state1, state2, state3));

            Assert.True(andState.Matches(null));
        }