public InMemoryBeerTapRepository()
 {
     _beerTap = new BeerTap();
     _beerTap.AddKeg(new Keg(1, "Sam Adams Boston Lager", 960, 0.09m, 4.00m));
     _beerTap.AddKeg(new Keg(3, "Dogfishhead 90", 128, 0.10m, 4.00m));
     _beerTap.AddKeg(new Keg(9, "Red Stripe", 640, 0.12m, 4.00m));
     _beerTap.AddKeg(new Keg(37, "Bass", 48, 0.10m, 4.00m));
 }
        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);
        }
        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);
        }
Exemple #4
0
 public void SetupTestStructures()
 {
     _tap = new BeerTap();
     _tap.Kegs.Add(new Keg(FirstKeg, string.Empty, 0, 0, 0));
     _tap.Kegs.Add(new Keg(SecondKeg, string.Empty, 0, 0, 0));
 }