public void SetUp() { var parcel = new Parcel { ParcelNumber = 46287, DateCreated = new DateTime(2019, 09, 29), DateReceived = new DateTime(2019, 10, 13), Weight = 0, CheckedById = 33067, ConsignmentNo = "numma 1" }; this.resource = new ParcelResource { ParcelNumber = 46287, DateCreated = "2019-09-30T00:00:00.0000000", DateReceived = "2019-10-14T00:00:00.0000000", Weight = 0.12m, CheckedById = 33066, ConsignmentNo = "numma 2", CartonCount = 12, PalletCount = 2, CarrierId = 121, SupplierId = 77, SupplierInvoiceNo = "invoice no 33 & 1/3", ImportBookNo = 2222 }; this.result = this.Sut.Add(this.resource); this.ParcelRepository.FindById(46287).Returns(parcel); this.result = this.Sut.Update(this.resource.ParcelNumber, this.resource); }
public void SetUp() { this.resource = new ParcelResource { DateCreated = "2019-09-29T00:00:00.0000000", DateReceived = "2019-10-13T00:00:00.0000000", Weight = 0, CheckedById = 33067, ConsignmentNo = "numma 1" }; this.DatabaseService.GetNextVal("PARCEL_SEQ").Returns(12798); this.result = this.Sut.Add(this.resource); }
public void SetUp() { var parcel = new Parcel { ParcelNumber = 4, SupplierId = 2, DateCreated = new DateTime(), CarrierId = 4, SupplierInvoiceNo = "Bond, James Bond", ConsignmentNo = "007", CartonCount = 0, PalletCount = 0, Weight = 00.70m, DateReceived = new DateTime(), CheckedById = 123456, Comments = "RSN 212, RSN 118" }; var parcelResource = new ParcelResource { ParcelNumber = 4, SupplierId = 2, DateCreated = new DateTime().ToString("o"), CarrierId = 4, SupplierInvoiceNo = "Bond, James Bond", ConsignmentNo = "007", CartonCount = 0, PalletCount = 0, Weight = 00.70m, DateReceived = new DateTime().ToString("o"), CheckedById = 123456, Comments = "RSN 212, RSN 118" }; this.ParcelsFacadeService.Update(Arg.Any <int>(), Arg.Any <ParcelResource>()) .Returns(new SuccessResult <Parcel>(parcel)); this.Response = this.Browser.Put( "/logistics/parcels/4", with => { with.Header("Accept", "application/json"); with.JsonBody(parcelResource); }).Result; }