public void TestEditFabricTypes() { string expectedName = "Different name"; var service = new FabricTypeService(carpentryWebsiteContext); FabricType itemToAdd = new FabricType { FabricTypeId = 14, Name = "Different name" }; service.AddFabricType(itemToAdd); carpentryWebsiteContext.Entry(service.GetFabricTypeDetails(14)).State = EntityState.Detached; service.UpdateFabricType(new FabricType { FabricTypeId = 14, Name = "Different name" }); FabricType result = service.GetFabricTypeDetails(14); Assert.Equal(expectedName, result.Name); }
public int Edit([FromBody] FabricType fabricType) { return(fabricTypeService.UpdateFabricType(fabricType)); }