public void CloseTicket() { Tickets ticketToUpdate = TicketsHelper.GetTicketByPrimaryKey(2); bool actual = TicketsHelper.CloseTicket(ticketToUpdate); bool expected = true; Assert.AreEqual(expected, actual); }
public void updateTicketLibrary() { Tickets ticketToUpdate = TicketsHelper.GetTicketByPrimaryKey(2); ticketToUpdate.Descripcion = "Problemas de Super red"; bool actual = TicketsHelper.updateTicket(ticketToUpdate); bool expected = true; Assert.AreEqual(expected, actual); }
public HttpResponseMessage GetTicketsById(int id) { if (!TicketsHelper.Exists(id)) { throw new HttpResponseException(HttpStatusCode.NotFound); } Tickets ticket = TicketsHelper.GetTicketByPrimaryKey(id); return(Request.CreateResponse(HttpStatusCode.OK, ticket));; }
public void updateTicketUsingService() { Tickets ticketToUpdate = TicketsHelper.GetTicketByPrimaryKey(2); ticketToUpdate.Descripcion = "Problemas de Super red2"; var client = new SimpleRest("http://localhost:14099/api/"); client.Invoke("/Tickets/UpdateTicket", HttpMethod.PUT, ticketToUpdate); bool actual = client.Response.StatusCode == System.Net.HttpStatusCode.Created; bool expected = true; Assert.AreEqual(expected, actual); }