예제 #1
0
파일: WhenUpdating.cs 프로젝트: linn/stores
        public void SetUp()
        {
            this.requestResource = new StockLocatorResource
            {
                PartNumber = "PART",
                Id         = 1,
                Remarks    = "Desc",
            };
            var stockLocator = new StockLocator
            {
                PartNumber = "PART", Id = 1, Remarks = "Desc",
            };

            this.StockLocatorFacadeService.Update(1, Arg.Any <StockLocatorResource>())
            .Returns(new SuccessResult <StockLocator>(stockLocator));

            this.Response = this.Browser.Put(
                "inventory/stock-locators/1",
                with =>
            {
                with.Header("Accept", "application/json");
                with.Header("Content-Type", "application/json");
                with.JsonBody(this.requestResource);
            }).Result;
        }
예제 #2
0
        private object DeleteStockLocator(int id)
        {
            var resource = new StockLocatorResource
            {
                Id = id, UserPrivileges = this.Context.CurrentUser.GetPrivileges()
            };

            return(this.Negotiate.WithModel(this.service.Delete(resource)));
        }