public void Truck_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _regionalagent_currentlocation_truck = new DSS3_LogisticsPoolingForUrbanDistribution.BO.GeoCoordinates
            {
                Latitude  = 222.222f,
                Longitude = 222.222f,
            };
            var _regionalagent_regionalagent_trucks = new DSS3_LogisticsPoolingForUrbanDistribution.BO.RegionalAgent
            {
                AgencyCode        = "RegionalAgent_AgencyCode",
                AgencyDescription = "RegionalAgent_AgencyDescription",
                AgencyAddress     = "RegionalAgent_AgencyAddress",
                IsSelected        = true,
                Rating            = 2190,
            };
            var _truck_truckdriver_truck = new DSS3_LogisticsPoolingForUrbanDistribution.BO.TruckDriver
            {
                UserName             = "******",
                PasswordHash         = "TruckDriver_PasswordHash",
                SecurityStamp        = "TruckDriver_SecurityStamp",
                EmailConfirmed       = true,
                LockoutEnabled       = true,
                PhoneNumberConfirmed = true,
                TwoFactorEnabled     = true,
                AccessFailedCount    = 3282,
                Name           = "TruckDriver_Name",
                Email          = "TruckDriver_Email",
                PhoneNumber    = "TruckDriver_PhoneNumber",
                LockoutEndDate = now,
            };

            new PersistenceSpecification <DSS3_LogisticsPoolingForUrbanDistribution.BO.Truck>(Session)
            .CheckProperty(p => p.PlateNumber, "Truck_PlateNumber")
            .CheckProperty(p => p.Type, "Truck_Type")
            .CheckReference(p => p.CurrentLocation, _regionalagent_currentlocation_truck)
            .CheckReference(p => p.RegionalAgent, _regionalagent_regionalagent_trucks)
            .CheckReference(p => p.TruckDriver, _truck_truckdriver_truck)
            .VerifyTheMappings();
        }
コード例 #2
0
        public void Warehouse_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _order_geocoordinates_warehouse = new DSS3_LogisticsPoolingForUrbanDistribution.BO.GeoCoordinates
            {
                Latitude  = 222.222f,
                Longitude = 222.222f,
            };
            var _order_regionalagentsservice_warehousessupport = new DSS3_LogisticsPoolingForUrbanDistribution.BO.RegionalAgent
            {
                AgencyCode        = "RegionalAgent_AgencyCode",
                AgencyDescription = "RegionalAgent_AgencyDescription",
                AgencyAddress     = "RegionalAgent_AgencyAddress",
                IsSelected        = true,
                Rating            = 8544,
            };
            var _order_regionalagentsservice_warehousessupport2 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.RegionalAgent
            {
                AgencyCode        = "RegionalAgent_AgencyCode",
                AgencyDescription = "RegionalAgent_AgencyDescription",
                AgencyAddress     = "RegionalAgent_AgencyAddress",
                IsSelected        = true,
                Rating            = 3652,
            };

            new PersistenceSpecification <DSS3_LogisticsPoolingForUrbanDistribution.BO.Warehouse>(Session)
            .CheckProperty(p => p.Description, "Warehouse_Description")
            .CheckProperty(p => p.Title, "Warehouse_Title")
            .CheckProperty(p => p.Address, "Warehouse_Address")
            .CheckProperty(p => p.Telephone, "Warehouse_Telephone")
            .CheckReference(p => p.GeoCoordinates, _order_geocoordinates_warehouse)
            .CheckBag(p => p.RegionalAgentsService, (new List <DSS3_LogisticsPoolingForUrbanDistribution.BO.RegionalAgent>
            {
                _order_regionalagentsservice_warehousessupport,
                _order_regionalagentsservice_warehousessupport2
            }))
            .VerifyTheMappings();
        }
コード例 #3
0
/// <summary>
///     Returns true if self and the provided entity have the same Id values
///     and the Ids are not of the default Id value
/// </summary>
        protected bool HasSameNonDefaultIdAs(GeoCoordinates compareTo)
        {
            return(!this.IsTransient() && !compareTo.IsTransient() && this.Id.Equals(compareTo.Id));
        }
        public void RegionalAgent_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _order_warehousessupport_regionalagentsservice = new DSS3_LogisticsPoolingForUrbanDistribution.BO.Warehouse
            {
                Description = "Warehouse_Description",
                Title       = "Warehouse_Title",
                Address     = "Warehouse_Address",
                Telephone   = "Warehouse_Telephone",
            };
            var _order_warehousessupport_regionalagentsservice2 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.Warehouse
            {
                Description = "Warehouse_Description",
                Title       = "Warehouse_Title",
                Address     = "Warehouse_Address",
                Telephone   = "Warehouse_Telephone",
            };
            var _regionalagent_rausers_regionalagent = new DSS3_LogisticsPoolingForUrbanDistribution.BO.RegionalAgentUser
            {
                UserName             = "******",
                PasswordHash         = "RegionalAgentUser_PasswordHash",
                SecurityStamp        = "RegionalAgentUser_SecurityStamp",
                EmailConfirmed       = true,
                LockoutEnabled       = true,
                PhoneNumberConfirmed = true,
                TwoFactorEnabled     = true,
                AccessFailedCount    = 3368,
                Name           = "RegionalAgentUser_Name",
                Email          = "RegionalAgentUser_Email",
                PhoneNumber    = "RegionalAgentUser_PhoneNumber",
                LockoutEndDate = now,
            };
            var _regionalagent_rausers_regionalagent2 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.RegionalAgentUser
            {
                UserName             = "******",
                PasswordHash         = "RegionalAgentUser_PasswordHash",
                SecurityStamp        = "RegionalAgentUser_SecurityStamp",
                EmailConfirmed       = true,
                LockoutEnabled       = true,
                PhoneNumberConfirmed = true,
                TwoFactorEnabled     = true,
                AccessFailedCount    = 4194,
                Name           = "RegionalAgentUser_Name",
                Email          = "RegionalAgentUser_Email",
                PhoneNumber    = "RegionalAgentUser_PhoneNumber",
                LockoutEndDate = now,
            };
            var _regionalagent_addresscoordinates_regionalagent = new DSS3_LogisticsPoolingForUrbanDistribution.BO.GeoCoordinates
            {
                Latitude  = 222.222f,
                Longitude = 222.222f,
            };
            var _regionalagent_areasupport_regionalagent = new DSS3_LogisticsPoolingForUrbanDistribution.BO.GeoArea
            {
                Area       = "GeoArea_Area",
                PostalCode = "GeoArea_PostalCode",
                County     = "GeoArea_County",
            };
            var _regionalagent_areasupport_regionalagent2 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.GeoArea
            {
                Area       = "GeoArea_Area",
                PostalCode = "GeoArea_PostalCode",
                County     = "GeoArea_County",
            };
            var _regionalagent_trucks_regionalagent = new DSS3_LogisticsPoolingForUrbanDistribution.BO.Truck
            {
                PlateNumber = "Truck_PlateNumber",
                Type        = "Truck_Type",
            };
            var _regionalagent_trucks_regionalagent2 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.Truck
            {
                PlateNumber = "Truck_PlateNumber",
                Type        = "Truck_Type",
            };
            var _scheduledroutes_scheduledroutetemplates_owner = new DSS3_LogisticsPoolingForUrbanDistribution.BO.ScheduledRouteTemplate
            {
                Origin                      = "ScheduledRouteTemplate_Origin",
                Destination                 = "ScheduledRouteTemplate_Destination",
                DaysOfWeek                  = "ScheduledRouteTemplate_DaysOfWeek",
                PricePerPallet              = 222222.22M,
                PricePerKilogram            = 222222.22M,
                PricePerCubicMeter          = 222222.22M,
                TotalAvailableCapacityKG    = 222222.22M,
                EffectiveFrom               = now,
                EffectiveTo                 = now,
                AvailableCapacityLaden      = 1530,
                CreatedOn                   = now,
                IsPrivate                   = true,
                TotalAvailableCapacityLaden = 9815,
                TotalAvailableCapacityM3    = 222222.22M,
                AvailableCapacityKG         = 222222.22M,
                AvailableCapacityM3         = 222222.22M,
                FixedPrice                  = 222222.22M,
                TruckPlate                  = "ScheduledRouteTemplate_TruckPlate",
                DeliveryDate                = now,
                ByRA = true,
            };
            var _scheduledroutes_scheduledroutetemplates_owner2 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.ScheduledRouteTemplate
            {
                Origin                      = "ScheduledRouteTemplate_Origin",
                Destination                 = "ScheduledRouteTemplate_Destination",
                DaysOfWeek                  = "ScheduledRouteTemplate_DaysOfWeek",
                PricePerPallet              = 222222.22M,
                PricePerKilogram            = 222222.22M,
                PricePerCubicMeter          = 222222.22M,
                TotalAvailableCapacityKG    = 222222.22M,
                EffectiveFrom               = now,
                EffectiveTo                 = now,
                AvailableCapacityLaden      = 7445,
                CreatedOn                   = now,
                IsPrivate                   = true,
                TotalAvailableCapacityLaden = 4976,
                TotalAvailableCapacityM3    = 222222.22M,
                AvailableCapacityKG         = 222222.22M,
                AvailableCapacityM3         = 222222.22M,
                FixedPrice                  = 222222.22M,
                TruckPlate                  = "ScheduledRouteTemplate_TruckPlate",
                DeliveryDate                = now,
                ByRA = true,
            };
            var _workcontract_workcontract_regionalagent = new DSS3_LogisticsPoolingForUrbanDistribution.BO.WorkContract
            {
                CreationDate = now,
                LastUpdate   = now,
            };
            var _workcontract_workcontract_regionalagent2 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.WorkContract
            {
                CreationDate = now,
                LastUpdate   = now,
            };

            new PersistenceSpecification <DSS3_LogisticsPoolingForUrbanDistribution.BO.RegionalAgent>(Session)
            .CheckProperty(p => p.AgencyCode, "RegionalAgent_AgencyCode")
            .CheckProperty(p => p.AgencyDescription, "RegionalAgent_AgencyDescription")
            .CheckProperty(p => p.AgencyAddress, "RegionalAgent_AgencyAddress")
            .CheckProperty(p => p.IsSelected, true)
            .CheckProperty(p => p.Rating, 2288)
            .CheckBag(p => p.WarehousesSupport, (new List <DSS3_LogisticsPoolingForUrbanDistribution.BO.Warehouse>
            {
                _order_warehousessupport_regionalagentsservice,
                _order_warehousessupport_regionalagentsservice2
            }))
            .CheckBag(p => p.RAUsers, (new List <DSS3_LogisticsPoolingForUrbanDistribution.BO.RegionalAgentUser>
            {
                _regionalagent_rausers_regionalagent,
                _regionalagent_rausers_regionalagent2
            }))
            .CheckReference(p => p.AddressCoordinates, _regionalagent_addresscoordinates_regionalagent)
            .CheckBag(p => p.AreaSupport, (new List <DSS3_LogisticsPoolingForUrbanDistribution.BO.GeoArea>
            {
                _regionalagent_areasupport_regionalagent,
                _regionalagent_areasupport_regionalagent2
            }))
            .CheckBag(p => p.Trucks, (new List <DSS3_LogisticsPoolingForUrbanDistribution.BO.Truck>
            {
                _regionalagent_trucks_regionalagent,
                _regionalagent_trucks_regionalagent2
            }))
            .CheckBag(p => p.ScheduledRouteTemplates, (new List <DSS3_LogisticsPoolingForUrbanDistribution.BO.ScheduledRouteTemplate>
            {
                _scheduledroutes_scheduledroutetemplates_owner,
                _scheduledroutes_scheduledroutetemplates_owner2
            }))
            .CheckBag(p => p.WorkContract, (new List <DSS3_LogisticsPoolingForUrbanDistribution.BO.WorkContract>
            {
                _workcontract_workcontract_regionalagent,
                _workcontract_workcontract_regionalagent2
            }))
            .VerifyTheMappings();
        }
コード例 #5
0
/// <summary>
/// Copies the current object to a new instance
/// </summary>
/// <param name="deep">Copy members that refer to objects external to this class (not dependent)</param>
/// <param name="copiedObjects">Objects that should be reused</param>
/// <param name="asNew">Copy the current object as a new one, ready to be persisted, along all its members.</param>
/// <param name="reuseNestedObjects">If asNew is true, this flag if set, forces the reuse of all external objects.</param>
/// <param name="copy">Optional - An existing [GeoCoordinates] instance to use as the destination.</param>
/// <returns>A copy of the object</returns>
        public virtual GeoCoordinates Copy(bool deep = false, Hashtable copiedObjects = null, bool asNew = false, bool reuseNestedObjects = false, GeoCoordinates copy = null)
        {
            if (copiedObjects == null)
            {
                copiedObjects = new Hashtable();
            }
            if (copy == null && copiedObjects.Contains(this))
            {
                return((GeoCoordinates)copiedObjects[this]);
            }
            copy = copy ?? new GeoCoordinates();
            if (!asNew)
            {
                copy.TransientId = this.TransientId;
                copy.Id          = this.Id;
            }
            copy.Latitude  = this.Latitude;
            copy.Longitude = this.Longitude;
            if (!copiedObjects.Contains(this))
            {
                copiedObjects.Add(this, copy);
            }
            return(copy);
        }