public void DeleteUnit() { EAV.Store.Clients.IUnitStoreClient client = factory.Create <EAV.Store.Clients.IUnitStoreClient>(); EAVStoreClient.Unit dbUnitIn = CreateUnit("SYM", Guid.NewGuid().ToString()); client.DeleteUnit(dbUnitIn.Unit_ID); EAVStoreClient.Unit dbUnitOut = this.DbContext.Units.SingleOrDefault(it => it.Unit_ID == dbUnitIn.Unit_ID); Assert.IsNull(dbUnitOut, "Failed to delete Unit ID {0} from the database.", dbUnitIn.Unit_ID); }
public IHttpActionResult DeleteUnit(int id) { try { unitClient.DeleteUnit(id); return(Ok()); } catch (Exception ex) { return(InternalServerError(ex)); } }