//------------------------------------------------------------------------------------------------------------------------------ public usuariosView() { InitializeComponent(); _vuc = new VistaUsuariosController(this); _muc = new ModificarUsuarioController(_mu); _duc = new DeleteUserController(this); }
public async Task DeleteReturnsContentResult() { // Arrange UserDto userDto = new UserDto { Id = 1, Name = "Prueba", BirthDate = new DateTime(1945, 2, 5) }; _deleteUserService.Stub(s => s.DeleteUser(1)).Return(Task.CompletedTask); var controller = new DeleteUserController( _deleteUserService, _getUserService); // Act IHttpActionResult actionResult = await controller.Delete(1); var contentResult = actionResult as OkNegotiatedContentResult <int>; // Assert Assert.IsNotNull(contentResult); Assert.AreEqual(1, contentResult.Content); }