Esempio n. 1
0
        public void AcceptReturnsCorrectResponse()
        {
            var r = new MockRepository(MockBehavior.Default)
            {
                DefaultValue = DefaultValue.Mock
            };
            var expected = r.Create <IBasketVisitor>().Object;
            var sut      = new BasketItem("Dummy product", 1, 1);

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

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

            Assert.Same(expected, actual);
        }