예제 #1
0
        public void CreateFull()
        {
            var before = new CustomerShipments(this.Session).Extent().ToArray();

            var expected = new CustomerShipmentBuilder(this.Session).WithDefaults(this.internalOrganisation).Build();

            this.Session.Derive();

            var expectedShipToPartyPartyName         = expected.ShipToParty?.DisplayName();
            var expectedShipToAddressDisplayName     = expected.ShipToAddress?.DisplayName();
            var expectedShipToContactPersonPartyName = expected.ShipToContactPerson?.DisplayName();
            var expectedShipFromAddressDisplayName   = expected.ShipFromAddress?.DisplayName();
            var expectedShipFromFacilityName         = expected.ShipFromFacility.Name;
            var expectedShipmentMethodName           = expected.ShipmentMethod.Name;
            var expectedCarrierName          = expected.Carrier.Name;
            var expectedEstimatedShipDate    = expected.EstimatedShipDate.Value.Date;
            var expectedEstimatedArrivalDate = expected.EstimatedArrivalDate.Value.Date;
            var expectedHandlingInstruction  = expected.HandlingInstruction;
            var expectedComment = expected.Comment;

            var customerShipmentCreate = this.shipmentListPage
                                         .CreateCustomerShipment()
                                         .Build(expected);

            customerShipmentCreate.AssertFull(expected);

            this.Session.Rollback();
            customerShipmentCreate.SAVE.Click();

            this.Driver.WaitForAngular();
            this.Session.Rollback();

            var after = new CustomerShipments(this.Session).Extent().ToArray();

            Assert.Equal(after.Length, before.Length + 1);

            var actual = after.Except(before).First();

            Assert.Equal(expectedShipToPartyPartyName, actual.ShipToParty?.DisplayName());
            Assert.Equal(expectedShipToAddressDisplayName, actual.ShipToAddress?.DisplayName());
            Assert.Equal(expectedShipToContactPersonPartyName, actual.ShipToContactPerson?.DisplayName());
            Assert.Equal(expectedShipFromAddressDisplayName, actual.ShipFromAddress?.DisplayName());
            Assert.Equal(expectedShipFromFacilityName, actual.ShipFromFacility.Name);
            Assert.Equal(expectedShipmentMethodName, actual.ShipmentMethod.Name);
            Assert.Equal(expectedCarrierName, actual.Carrier.Name);
            Assert.Equal(expectedEstimatedShipDate, actual.EstimatedShipDate);
            Assert.Equal(expectedEstimatedArrivalDate, actual.EstimatedArrivalDate);
            Assert.Equal(expectedHandlingInstruction, actual.HandlingInstruction);
            Assert.Equal(expectedComment, actual.Comment);
        }
예제 #2
0
        public void CreateMinimal()
        {
            var before = new CustomerShipments(this.Session).Extent().ToArray();

            var expected = new CustomerShipmentBuilder(this.Session).WithDefaults(this.internalOrganisation).Build();

            this.Session.Derive();

            var expectedShipToPartyPartyName       = expected.ShipToParty?.DisplayName();
            var expectedShipToAddressDisplayName   = expected.ShipToAddress?.DisplayName();
            var expectedShipFromAddressDisplayName = expected.ShipFromAddress?.DisplayName();
            var expectedShipFromFacilityName       = expected.ShipFromFacility.Name;

            var customerShipmentCreate = this.shipmentListPage
                                         .CreateCustomerShipment()
                                         .Build(expected, true);

            customerShipmentCreate.AssertFull(expected);

            this.Session.Rollback();
            customerShipmentCreate.SAVE.Click();

            this.Driver.WaitForAngular();
            this.Session.Rollback();

            var after = new CustomerShipments(this.Session).Extent().ToArray();

            Assert.Equal(after.Length, before.Length + 1);

            var actual = after.Except(before).First();

            Assert.Equal(expectedShipToPartyPartyName, actual.ShipToParty?.DisplayName());
            Assert.Equal(expectedShipToAddressDisplayName, actual.ShipToAddress?.DisplayName());
            Assert.Equal(expectedShipFromAddressDisplayName, actual.ShipFromAddress?.DisplayName());
            Assert.Equal(expectedShipFromFacilityName, actual.ShipFromFacility.Name);
        }