public void SetUp() { this.wandAction = "W"; this.printLabels = true; this.consignmentId = 134; this.wandString = "flajdlfjd1312"; this.userNumber = 35345; this.wandLogId = 123; this.wandLog = new WandLog { Id = this.wandLogId, ArticleNumber = "a" }; this.WandLogRepository.FindById(this.wandLogId).Returns(this.wandLog); this.wandPackResult = new WandPackResult { Message = "ok", Success = true, WandLogId = this.wandLogId }; this.WandPack.Wand(this.wandAction, this.userNumber, this.consignmentId, this.wandString) .Returns(this.wandPackResult); this.result = this.Sut.Wand( this.wandAction, this.wandString, this.consignmentId, this.userNumber, this.printLabels); }
public void SetUp() { this.wandAction = "W"; this.printLabels = true; this.consignmentId = 134; this.wandString = "flajdlfjd1312"; this.userNumber = 35345; this.wandLogId = 123; this.wandLog = new WandLog { Id = this.wandLogId, ArticleNumber = "a", ConsignmentId = this.consignmentId, ContainerNo = 1, TransType = "W" }; this.consignment = new Consignment { ConsignmentId = this.consignmentId, Address = new Address { Line1 = "this", Line2 = "address", PostCode = "d", CountryCode = "FR", Country = new Country { CountryCode = "FR", DisplayName = "France" } } }; this.WandLogRepository.FindById(this.wandLogId).Returns(this.wandLog); this.ConsignmentRepository.FindById(this.consignmentId).Returns(this.consignment); this.wandPackResult = new WandPackResult { Message = "ok", Success = true, WandLogId = this.wandLogId }; this.WandPack.Wand(this.wandAction, this.userNumber, this.consignmentId, this.wandString) .Returns(this.wandPackResult); this.PrinterMappingRepository.FindBy(Arg.Any <Expression <Func <PrinterMapping, bool> > >()).Returns( new PrinterMapping { UserNumber = this.userNumber, PrinterGroup = "DISPATCH-LABEL", PrinterName = "DispatchLabels1" }); this.result = this.Sut.Wand( this.wandAction, this.wandString, this.consignmentId, this.userNumber, this.printLabels); }
public void SetUp() { this.wandAction = "W"; this.printLabels = true; this.consignmentId = 134; this.wandString = "flajdlfjd1312"; this.userNumber = 35345; this.wandLogId = 123; this.wandLog = new WandLog { Id = this.wandLogId, ArticleNumber = "a", ConsignmentId = this.consignmentId, ContainerNo = 1, TransType = "W" }; this.consignment = new Consignment { ConsignmentId = this.consignmentId, Address = new Address { Line1 = "this", Line2 = "address", PostCode = "d", CountryCode = "GB", Country = new Country { CountryCode = "GB", DisplayName = "GB" } } }; this.WandLogRepository.FindById(this.wandLogId).Returns(this.wandLog); this.ConsignmentRepository.FindById(this.consignmentId).Returns(this.consignment); this.wandPackResult = new WandPackResult { Message = "ok", Success = true, WandLogId = this.wandLogId }; this.WandPack.Wand(this.wandAction, this.userNumber, this.consignmentId, this.wandString) .Returns(this.wandPackResult); this.result = this.Sut.Wand( this.wandAction, this.wandString, this.consignmentId, this.userNumber, this.printLabels); }
public void SetUp() { this.resource = new WandItemRequestResource { ConsignmentId = 1, WandString = "wa", WandAction = "W", UserNumber = 234, PrintLabels = "N" }; this.wandServiceResult = new WandResult { Message = "ok", Success = true }; this.WandService.Wand( this.resource.WandAction, this.resource.WandString, this.resource.ConsignmentId, this.resource.UserNumber, false) .Returns(this.wandServiceResult); this.result = this.Sut.WandItem(this.resource); }
public void SetUp() { this.resource = new WandItemRequestResource { ConsignmentId = 1, WandString = "ws" }; this.result = new WandResult { Message = "ok", Success = true }; this.WandFacadeService.WandItem( Arg.Is <WandItemRequestResource>( a => a.ConsignmentId == this.resource.ConsignmentId && a.WandString == this.resource.WandString)) .Returns(new SuccessResult <WandResult>(this.result)); this.Response = this.Browser.Post( $"/logistics/wand/items", with => { with.Header("Accept", "application/json"); with.JsonBody(this.resource); }).Result; }
public WandResult Wand( string wandAction, string wandString, int consignmentId, int userNumber, bool printLabels) { var wandPackResult = this.wandPack.Wand(wandAction, userNumber, consignmentId, wandString); var result = new WandResult { ConsignmentId = consignmentId, WandString = wandString, Success = wandPackResult.Success, Message = wandPackResult.Message }; if (wandPackResult.WandLogId.HasValue) { result.WandLog = this.wandLogRepository.FindById(wandPackResult.WandLogId.Value); this.MaybePrintLabel(printLabels, consignmentId, result.WandLog, userNumber); } return(result); }