public void CreateLocation_Guid_StringEndingWithId()
        {
            var guid = new Guid("C648EE26-71CA-4968-9540-AD3470DA0422");

            ConfigureRequestMessage(guid);

            var location = _itemLocationHelper.CreateLocation(guid);

            Assert.That(location, Does.EndWith(guid.ToString()));
        }
Exemplo n.º 2
0
        // POST api/v1/items
        public async Task <IHttpActionResult> PostAsync([FromBody] Item item)
        {
            ValidatePostedItem(item);
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var newItem = await _itemsService.AddItemAsync(item);

            var location = _itemLocationHelper.CreateLocation(newItem.Id);

            return(Created(location, newItem));
        }