示例#1
0
        public void Company_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _company_contacts_company = new DSS1_RetailerDriverStockOptimisation.BO.Contact
            {
                Id                   = 8261,
                UserName             = "******",
                PasswordHash         = "Contact_PasswordHash",
                SecurityStamp        = "Contact_SecurityStamp",
                EmailConfirmed       = true,
                LockoutEnabled       = true,
                PhoneNumberConfirmed = true,
                TwoFactorEnabled     = true,
                AccessFailedCount    = 6676,
                Name                 = "Contact_Name",
                Email                = "Contact_Email",
                PhoneNumber          = "Contact_PhoneNumber",
                LockoutEndDate       = now,
            };
            var _company_contacts_company2 = new DSS1_RetailerDriverStockOptimisation.BO.Contact
            {
                Id                   = 7461,
                UserName             = "******",
                PasswordHash         = "Contact_PasswordHash",
                SecurityStamp        = "Contact_SecurityStamp",
                EmailConfirmed       = true,
                LockoutEnabled       = true,
                PhoneNumberConfirmed = true,
                TwoFactorEnabled     = true,
                AccessFailedCount    = 297,
                Name                 = "Contact_Name",
                Email                = "Contact_Email",
                PhoneNumber          = "Contact_PhoneNumber",
                LockoutEndDate       = now,
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.Company>(Session)
            .CheckProperty(p => p.Code, "Company_Code")
            .CheckProperty(p => p.Name, "Company_Name")
            .CheckBag(p => p.Contacts, (new List <DSS1_RetailerDriverStockOptimisation.BO.Contact>
            {
                _company_contacts_company,
                _company_contacts_company2
            }))
            .VerifyTheMappings();
        }
示例#2
0
        public void AppNotification_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _appnotification_appnotificationactions_appnotification = new DSS1_RetailerDriverStockOptimisation.BO.AppNotificationAction
            {
                Link = "AppNotificationAction_Link",
                Type = "AppNotificationAction_Type",
            };
            var _appnotification_appnotificationactions_appnotification2 = new DSS1_RetailerDriverStockOptimisation.BO.AppNotificationAction
            {
                Link = "AppNotificationAction_Link",
                Type = "AppNotificationAction_Type",
            };
            var _appnotification_recipient_appnotifications = new DSS1_RetailerDriverStockOptimisation.BO.Contact
            {
                Id                   = 9771,
                UserName             = "******",
                PasswordHash         = "Contact_PasswordHash",
                SecurityStamp        = "Contact_SecurityStamp",
                EmailConfirmed       = true,
                LockoutEnabled       = true,
                PhoneNumberConfirmed = true,
                TwoFactorEnabled     = true,
                AccessFailedCount    = 5914,
                Name                 = "Contact_Name",
                Email                = "Contact_Email",
                PhoneNumber          = "Contact_PhoneNumber",
                LockoutEndDate       = now,
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.AppNotification>(Session)
            .CheckProperty(p => p.Type, "AppNotification_Type")
            .CheckProperty(p => p.Reason, "AppNotification_Reason")
            .CheckProperty(p => p.DateCreated, now)
            .CheckProperty(p => p.IsRead, true)
            .CheckProperty(p => p.Item, "AppNotification_Item")
            .CheckProperty(p => p.Delta, 1582)
            .CheckBag(p => p.AppNotificationActions, (new List <DSS1_RetailerDriverStockOptimisation.BO.AppNotificationAction>
            {
                _appnotification_appnotificationactions_appnotification,
                _appnotification_appnotificationactions_appnotification2
            }))
            .CheckReference(p => p.Recipient, _appnotification_recipient_appnotifications)
            .VerifyTheMappings();
        }
 public NewContactViewModel()
 {
     ApplicationUser = new DSS1_RetailerDriverStockOptimisation.BO.Contact();
 }