public async void Test3() { var ticket2 = new REST_Api.ApiModels.Tickets { Id = 2, Title = "Test", Details = "Ticket2", UserId = 1, DatetimeOpened = DateTime.Now, Priority = "low", Completed = "Closed" }; var result1 = await _controller.PostAsync(ticket2); Assert.IsType <OkObjectResult>(result1); }
public async void Test5() { var ticket2 = new REST_Api.ApiModels.Tickets { Id = 1, Title = "Test", Details = "Ticket", UserId = 1, DatetimeOpened = DateTime.Now, Priority = "low", Completed = "Closed" }; var result1 = await _controller.PutToCloseTicketAsync(ticket2.Id); var goodRequestResult = Assert.IsType <OkObjectResult>(result1); //Assert.Same(Mapper.MapTickets(ticket2).ToString(), goodRequestResult.Value.ToString()); var result2 = await _controller.PutToCloseTicketAsync(5); Assert.IsType <NotFoundObjectResult>(result2); }