public async Task CallingPutReturnsOk()
        {
            // Arrange
            var uri     = new Uri("http://localhost:36146/v1/Samples/1");
            var content = new PutItem();

            // Act
            var result = await RestCall.CallPutAsync <GetItem, PutItem>(uri, content);

            // Assert
            result.Status.Should().Be(HttpStatusCode.OK);
        }
    private void PickUpItem(NetworkMessage msg)
    {
        PutItem put = GameObject.Find(msg.ReadMessage <StringMessage>().value).GetComponent <PutItem>();

        put.DestroyItem();
    }
 public IHttpActionResult Put([FromBody] PutItem putItem, int id)
 {
     return(Ok(new GetItem {
         Id = id, Name = "Name1"
     }));
 }
예제 #4
0
        public async Task <IActionResult> Put([FromRoute] Guid basketId, [FromRoute] Guid id, [FromBody] PutItem requestItem)
        {
            var request = new UpdateItemRequest {
                BasketId = basketId, Id = id, Item = requestItem
            };
            var item = await _mediator.Send(request);

            if (item == null)
            {
                return(BadRequest());
            }

            return(NoContent());
        }