public async void Should_Error_Patch_One() { GarmentUnitExpenditureNoteFacade facade = new GarmentUnitExpenditureNoteFacade(GetServiceProvider(), _dbContext(GetCurrentMethod())); var dataUtil = this.dataUtil(facade, GetCurrentMethod()); var model = await dataUtil.GetTestData(); JsonPatchDocument <GarmentUnitExpenditureNote> jsonPatch = new JsonPatchDocument <GarmentUnitExpenditureNote>(); jsonPatch.Replace(m => m.Id, 0); var Response = await Assert.ThrowsAnyAsync <Exception>(async() => await facade.PatchOne(model.Id, jsonPatch)); Assert.NotNull(Response.Message); }
public async void Should_Success_Patch_One() { GarmentUnitExpenditureNoteFacade facade = new GarmentUnitExpenditureNoteFacade(GetServiceProvider(), _dbContext(GetCurrentMethod())); var dataUtil = this.dataUtil(facade, GetCurrentMethod()); var model = await dataUtil.GetTestData(); JsonPatchDocument <GarmentUnitExpenditureNote> jsonPatch = new JsonPatchDocument <GarmentUnitExpenditureNote>(); jsonPatch.Replace(m => m.IsPreparing, true); var Response = await facade.PatchOne(model.Id, jsonPatch); Assert.NotEqual(0, Response); }