Esempio n. 1
0
        public void Location_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _driver_driver_employer = new DSS3_LogisticsPoolingForUrbanDistribution.BO.Driver
            {
                Id                   = 2136,
                UserName             = "******",
                PasswordHash         = "Driver_PasswordHash",
                SecurityStamp        = "Driver_SecurityStamp",
                EmailConfirmed       = true,
                LockoutEnabled       = true,
                PhoneNumberConfirmed = true,
                TwoFactorEnabled     = true,
                AccessFailedCount    = 4720,
                Name                 = "Driver_Name",
                Email                = "Driver_Email",
                PhoneNumber          = "Driver_PhoneNumber",
                LockoutEndDate       = now,
            };
            var _driver_driver_employer2 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.Driver
            {
                Id                   = 8013,
                UserName             = "******",
                PasswordHash         = "Driver_PasswordHash",
                SecurityStamp        = "Driver_SecurityStamp",
                EmailConfirmed       = true,
                LockoutEnabled       = true,
                PhoneNumberConfirmed = true,
                TwoFactorEnabled     = true,
                AccessFailedCount    = 4154,
                Name                 = "Driver_Name",
                Email                = "Driver_Email",
                PhoneNumber          = "Driver_PhoneNumber",
                LockoutEndDate       = now,
            };
            var _utilsbo_coordinates_location = new DSS3_LogisticsPoolingForUrbanDistribution.BO.Coordinates
            {
                CoordinateX = 222.222d,
                CoordinateY = 222.222d,
            };

            new PersistenceSpecification <DSS3_LogisticsPoolingForUrbanDistribution.BO.Location>(Session)
            .CheckProperty(p => p.Name, "Location_Name")
            .CheckProperty(p => p.Street, "Location_Street")
            .CheckProperty(p => p.City, "Location_City")
            .CheckProperty(p => p.Country, "Location_Country")
            .CheckProperty(p => p.Number, "Location_Number")
            .CheckProperty(p => p.PostCode, "Location_PostCode")
            .CheckProperty(p => p.Label, "Location_Label")
            .CheckBag(p => p.Driver, (new List <DSS3_LogisticsPoolingForUrbanDistribution.BO.Driver>
            {
                _driver_driver_employer,
                _driver_driver_employer2
            }))
            .CheckReference(p => p.Coordinates, _utilsbo_coordinates_location)
            .VerifyTheMappings();
        }
Esempio n. 2
0
        public void Shipment_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _actionsbo_shippingorders_shipment = new DSS3_LogisticsPoolingForUrbanDistribution.BO.ShippingOrder
            {
                DepartureDate   = now,
                ArrivalDate     = now,
                Shipper         = "ShippingOrder_Shipper",
                Carrier         = "ShippingOrder_Carrier",
                ItemDescription = "ShippingOrder_ItemDescription",
                Conditions      = "ShippingOrder_Conditions",
                AggregateVolume = 222222.22M,
                Priority        = 1726,
            };
            var _actionsbo_shippingorders_shipment2 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.ShippingOrder
            {
                DepartureDate   = now,
                ArrivalDate     = now,
                Shipper         = "ShippingOrder_Shipper",
                Carrier         = "ShippingOrder_Carrier",
                ItemDescription = "ShippingOrder_ItemDescription",
                Conditions      = "ShippingOrder_Conditions",
                AggregateVolume = 222222.22M,
                Priority        = 8201,
            };
            var _actionsbo_shipmentstatus_shipment = new DSS3_LogisticsPoolingForUrbanDistribution.BO.ShipmentStatus
            {
                TimeReported = now,
                Description  = "ShipmentStatus_Description",
                User         = "******",
            };
            var _actionsbo_shipmentstatus_shipment2 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.ShipmentStatus
            {
                TimeReported = now,
                Description  = "ShipmentStatus_Description",
                User         = "******",
            };
            var _actionsbo_departurepoint_shipment = new DSS3_LogisticsPoolingForUrbanDistribution.BO.Location
            {
                Name     = "Location_Name",
                Street   = "Location_Street",
                City     = "Location_City",
                Country  = "Location_Country",
                Number   = "Location_Number",
                PostCode = "Location_PostCode",
                Label    = "Location_Label",
            };
            var _actionsbo_finaldestination_shipment_1 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.Location
            {
                Name     = "Location_Name",
                Street   = "Location_Street",
                City     = "Location_City",
                Country  = "Location_Country",
                Number   = "Location_Number",
                PostCode = "Location_PostCode",
                Label    = "Location_Label",
            };
            var _actionsbo_driver_shipment = new DSS3_LogisticsPoolingForUrbanDistribution.BO.Driver
            {
                Id                   = 6688,
                UserName             = "******",
                PasswordHash         = "Driver_PasswordHash",
                SecurityStamp        = "Driver_SecurityStamp",
                EmailConfirmed       = true,
                LockoutEnabled       = true,
                PhoneNumberConfirmed = true,
                TwoFactorEnabled     = true,
                AccessFailedCount    = 6962,
                Name                 = "Driver_Name",
                Email                = "Driver_Email",
                PhoneNumber          = "Driver_PhoneNumber",
                LockoutEndDate       = now,
            };
            var _actionsbo_occupiedvolume_shipment_1 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.CustomVolume
            {
                Weight = 222222.22M,
            };
            var _actionsbo_acceptedconditions_shipment = new DSS3_LogisticsPoolingForUrbanDistribution.BO.Condition
            {
                Description = "Condition_Description",
            };
            var _actionsbo_acceptedconditions_shipment2 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.Condition
            {
                Description = "Condition_Description",
            };
            var _actionsbo_vehiculetype_shipment = new DSS3_LogisticsPoolingForUrbanDistribution.BO.Vehicule
            {
                OverHeadCost            = 222222.22M,
                CalculatedTimeCost      = 222222.22M,
                CalculatedDistanceCost  = 222222.22M,
                CalculatedOwnershipCost = 222222.22M,
                VehiculeType            = "Vehicule_VehiculeType",
                Volume           = "Vehicule_Volume",
                CO2perKm         = 222222.22M,
                AmortizationType = "Vehicule_AmortizationType",
                MaximumLoad      = 222222.22M,
            };
            var _actionsbo_path_shipment_2 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.Point
            {
                LocId       = 833,
                Time        = 751,
                Distance    = 2145,
                CurrentLoad = 222222.22M,
            };
            var _actionsbo_path_shipment_22 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.Point
            {
                LocId       = 7501,
                Time        = 1091,
                Distance    = 9420,
                CurrentLoad = 222222.22M,
            };

            new PersistenceSpecification <DSS3_LogisticsPoolingForUrbanDistribution.BO.Shipment>(Session)
            .CheckProperty(p => p.Owner, "Shipment_Owner")
            .CheckProperty(p => p.DepartureTime, now)
            .CheckProperty(p => p.Temperature, "Shipment_Temperature")
            .CheckProperty(p => p.LoadPercentage, 6077)
            .CheckProperty(p => p.TotalVolume, 222222.22M)
            .CheckProperty(p => p.AverageVolume, 222222.22M)
            .CheckProperty(p => p.MaxTravelTime, 7344)
            .CheckBag(p => p.ShippingOrders, (new List <DSS3_LogisticsPoolingForUrbanDistribution.BO.ShippingOrder>
            {
                _actionsbo_shippingorders_shipment,
                _actionsbo_shippingorders_shipment2
            }))
            .CheckBag(p => p.ShipmentStatus, (new List <DSS3_LogisticsPoolingForUrbanDistribution.BO.ShipmentStatus>
            {
                _actionsbo_shipmentstatus_shipment,
                _actionsbo_shipmentstatus_shipment2
            }))
            .CheckReference(p => p.DeparturePoint, _actionsbo_departurepoint_shipment)
            .CheckReference(p => p.FinalDestination, _actionsbo_finaldestination_shipment_1)
            .CheckReference(p => p.Driver, _actionsbo_driver_shipment)
            .CheckReference(p => p.OccupiedVolume, _actionsbo_occupiedvolume_shipment_1)
            .CheckBag(p => p.AcceptedConditions, (new List <DSS3_LogisticsPoolingForUrbanDistribution.BO.Condition>
            {
                _actionsbo_acceptedconditions_shipment,
                _actionsbo_acceptedconditions_shipment2
            }))
            .CheckReference(p => p.VehiculeType, _actionsbo_vehiculetype_shipment)
            .CheckBag(p => p.Path, (new List <DSS3_LogisticsPoolingForUrbanDistribution.BO.Point>
            {
                _actionsbo_path_shipment_2,
                _actionsbo_path_shipment_22
            }))
            .VerifyTheMappings();
        }