Example #1
0
        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;
        }
Example #2
0
 public void SetUp()
 {
     this.AuthService
     .HasPermissionFor(AuthorisedAction.CreateStockLocator, Arg.Any <IEnumerable <string> >())
     .Returns(true);
     this.StoresPalletRepository.FilterBy(Arg.Any <Expression <Func <StoresPallet, bool> > >())
     .Returns(Enumerable.Empty <StoresPallet>().AsQueryable());
     this.result = this.Sut.CreateStockLocator(this.toCreate, null, this.privileges);
 }
Example #3
0
        public void SetUp()
        {
            this.stockLocator1 = new StockLocator {
                LocationId = 1, BatchRef = "A"
            };
            this.stockLocator2 = new StockLocator {
                LocationId = 2, BatchRef = "A"
            };

            this.StockLocatorFacadeService.GetBatches(Arg.Any <string>())
            .Returns(new
                     SuccessResult <IEnumerable <StockLocator> >(new List <StockLocator>
            {
                this.stockLocator1, this.stockLocator2
            }));

            this.Response = this.Browser.Get(
                "/inventory/stock-locators/batches",
                with =>
            {
                with.Header("Accept", "application/json");
                with.Query("searchTerm", "A");
            }).Result;
        }