Exemple #1
0
        public void DeleteConfirmedNoId()
        {
            // act
            ViewResult result = (ViewResult)controller.DeleteConfirmed(1);

            // assert
            Assert.AreEqual("Error", result.ViewName);
        }
        public async void DeleteConfirmed_DeletesApiResource()
        {
            var sport = SportGenerator.Create();

            var result = await Controller.DeleteConfirmed(sport.SportId);

            Assert.IsType <RedirectToActionResult>(result);

            var redirectedResult = result as RedirectToActionResult;

            Assert.Equal("Index", redirectedResult.ActionName);

            Repository.Verify();
        }