Beispiel #1
0
        public void AcceptReturnCorrectResponse(
            IBasketVisitor expected
            , IBasketVisitor visitorStub
            , Discount sut
            )
        {
            A.CallTo(() => visitorStub.Visit(sut)).Returns(expected);

            var actual = sut.Accept(visitorStub);

            Assert.Same(expected, actual);
        }
Beispiel #2
0
        public void AcceptReturnsCorrectResponse()
        {
            var r = new MockRepository(MockBehavior.Default)
            {
                DefaultValue = DefaultValue.Mock
            };
            var expected = r.Create <IBasketVisitor>().Object;
            var sut      = new Discount();

            var visitorStub = r.Create <IBasketVisitor>();

            visitorStub.Setup(v => v.Visit(sut)).Returns(expected);
            var actual = sut.Accept(visitorStub.Object);

            Assert.Same(expected, actual);
        }