コード例 #1
0
        public void Pour_Action_Returns_View_With_A_BeerTap_As_Its_Model()
        {
            IBeerTapService service = MockRepository.GenerateStub<IBeerTapService>();
            var beerTapController = new BeerTapController(service);
            BeerTap beerTap = new BeerTap();
            service.Stub(instance => instance.RecordPour(0, 0, 0)).IgnoreArguments().Return(true);

            var result = beerTapController.RecordPintPour(0, 0);

            Assert.IsNotNull(result);
        }
コード例 #2
0
        public void Default_Action_Returns_View_With_A_BeerTap_As_Its_Model()
        {
            IBeerTapService service = MockRepository.GenerateStub<IBeerTapService>();
            var beerTapController = new BeerTapController(service);
            BeerTap beerTap = new BeerTap();
            service.Stub(instance => instance.GetBeerTap()).Return(beerTap);

            var result = beerTapController.Index() as ViewResult;

            Assert.IsNotNull(result);
            Assert.AreEqual(beerTap, result.Model);
        }