public void Post_Called_BuildsUri() { // Given var request = new TicketRequest { Item = new Ticket { Subject = "blah blah" } }; var ticketResource = new TicketResource(_client.Object); // When ticketResource.Post(request); // Then _client.Setup(b => b.BuildUri(It.IsAny <string>(), "")); }
public void Post_CalledWithTicket_ReturnsTicketReponse() { // Given var response = new TicketResponse { Item = new Ticket { Subject = "blah blah" } }; var request = new TicketRequest { Item = new Ticket { Subject = "blah blah" } }; _client.Setup(b => b.Post <TicketResponse>(It.IsAny <Uri>(), request, "application/json")).Returns(response); var ticketResource = new TicketResource(_client.Object); // When var result = ticketResource.Post(request); // Then Assert.That(result, Is.EqualTo(response)); }
public void Post_CalledWithTicket_ReturnsTicketReponse() { // Given var response = new TicketResponse { Item = new Ticket { Subject = "blah blah" } }; var request = new TicketRequest { Item = new Ticket { Subject = "blah blah" } }; _client.Setup(b => b.Post<TicketResponse>(It.IsAny<Uri>(), request, "application/json")).Returns(response); var ticketResource = new TicketResource(_client.Object); // When var result = ticketResource.Post(request); // Then Assert.That(result, Is.EqualTo(response)); }
public void Post_Called_BuildsUri() { // Given var request = new TicketRequest { Item = new Ticket { Subject = "blah blah" } }; var ticketResource = new TicketResource(_client.Object); // When ticketResource.Post(request); // Then _client.Setup(b => b.BuildUri(It.IsAny<string>(), "")); }