Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }