public async void Update_ShowsCorrectView()
        {
            Repository.Setup(r => r.GetByIdAsync(1)).ReturnsAsync(SportGenerator.Create());
            var result = await Controller.Edit(1);

            Assert.IsType <ViewResult>(result);
            var viewResult = result as ViewResult;

            Assert.Null(viewResult.ViewName);
        }
예제 #2
0
        public void EditNoId()
        {
            // arrange
            int?id = null;

            // act
            ViewResult result = (ViewResult)controller.Edit(id);

            // assert
            Assert.AreEqual("Error", result.ViewName);
        }