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

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

            // assert
            Assert.AreEqual("Error", result.ViewName);
        }
Ejemplo 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>();
        }