Exemple #1
0
        public void AddWillReturnCorrectRedirectAction()
        {
            // Fixture setup
            var fixture = new ControllerFixture();
            var sut     = fixture.CreateAnonymous <BasketController>();
            // Exercise system
            RedirectToRouteResult result = fixture.Get((int id) => sut.Add(id));

            // Verify outcome
            Assert.Equal <string>("Index", (string)result.RouteValues["action"]);
            // Teardown
        }
        public void SetCurrencyWillReturnCorrectResult()
        {
            // Fixture setup
            var fixture = new ControllerFixture();
            var sut     = fixture.CreateAnonymous <HomeController>();
            // Exercise system
            RedirectToRouteResult result = fixture.Get((string currency) => sut.SetCurrency(currency));

            // Verify outcome
            Assert.Equal <string>("Index", (string)result.RouteValues["action"]);
            // Teardown
        }
 public void SetCurrencyWillReturnCorrectResult()
 {
     // Fixture setup
     var fixture = new ControllerFixture();
     var sut = fixture.CreateAnonymous<HomeController>();
     // Exercise system
     RedirectToRouteResult result = fixture.Get((string currency) => sut.SetCurrency(currency));
     // Verify outcome
     Assert.Equal<string>("Index", (string)result.RouteValues["action"]);
     // Teardown
 }
 public void AddWillReturnCorrectRedirectAction()
 {
     // Fixture setup
     var fixture = new ControllerFixture();
     var sut = fixture.CreateAnonymous<BasketController>();
     // Exercise system
     RedirectToRouteResult result = fixture.Get((int id) => sut.Add(id));
     // Verify outcome
     Assert.Equal<string>("Index", (string)result.RouteValues["action"]);
     // Teardown
 }