Esempio n. 1
0
        public void EditNoIdLoadsError()
        {
            // arrange
            int?id = null;

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

            // assert
            Assert.AreEqual("Error", result.ViewName);
        }
Esempio n. 2
0
        public async Task EditShouldReturnNotFoundIfBikeDoesNotExist()
        {
            //Arrange
            var userManager = UserManagerMock.New;

            var controller = new BikesController(null, userManager.Object);

            //userManager.Setup()

            //Act
            var result = await controller.Edit(1);

            //Assert
            result
            .Should()
            .BeOfType <NotFoundResult>();
        }