コード例 #1
0
ファイル: Data.cs プロジェクト: borealwinter/simpl
        public static SubscriberDto GetSIMPLSubscriber01()
        {
            //Location
            var loc = new LocationDto
            {
                ID = "5829224.3544318",
                AddressLine1 = "8105 161ST AVE NE",
                CityName = "REDMOND",
                StateName = "WA",
                ZipCode = "98052",
                HeadendCode = "04",
                CustomFields = DefaultCustomFields_Loc()
            };

            //Equipment
            const string unitAddr = "RDMDWAXAOL4-18-3-3";
            var equip = new EquipmentCollectionDto
            {
                NewEquipment("MRCC00181AB9D01", EquipmentTypes().Single(x=>x.Manufacturer == "Motorola" && x.Model == "ONT1000M Data Port"), unitAddr, "ACTIVE"),
                NewEquipment("MRCC00181AB9M01", EquipmentTypes().Single(x=>x.Manufacturer == "Motorola" && x.Model == "ONT1000M MoCA Port"), unitAddr, "ACTIVE"),
                NewEquipment("MRCC00181AB9P01", EquipmentTypes().Single(x=>x.Manufacturer == "Motorola" && x.Model == "ONT1000M Phone Port"), unitAddr, "ACTIVE"),
                NewEquipment("MRCC00181AB9P02", EquipmentTypes().Single(x=>x.Manufacturer == "Motorola" && x.Model == "ONT1000M Phone Port"), unitAddr, "ACTIVE"),
                NewEquipment("MRCC00181AB9P03", EquipmentTypes().Single(x=>x.Manufacturer == "Motorola" && x.Model == "ONT1000M Phone Port"), unitAddr, "ACTIVE"),
                NewEquipment("MRCC00181AB9P04", EquipmentTypes().Single(x=>x.Manufacturer == "Motorola" && x.Model == "ONT1000M Phone Port"), unitAddr, "ACTIVE"),
                NewEquipment("M90937ZA8275", EquipmentTypes().Single(x=>x.Manufacturer == "Motorola" && x.Model == "QIP2500"), "0000050810829002", "ACTIVE")
            };
            equip.ToList().ForEach(x => x.LocationId = loc.ID);

            //Services
            var svcs = new ServiceCollectionDto
            {
                new ServiceDto { ClassName = "DATA - FTTH SPEED", Name = "F35M35M", Description = "35M DOWN 35M UP" },
                new ServiceDto{ ClassName = ServiceClassType.ProvisionedOntDataPort.GetStringValue(), Name = "MOCA", Description = "MOCA PORT" },
                new ServiceDto { ClassName = "RF - BASICS", Name = "FIOS", Description = "FIOS VIDEO SERVICE" },
                new ServiceDto { ClassName = "VIDEO - BUNDLE/MISC", Name = "FIDS1", Description = "DOWNSTREAM PATH" },
                new ServiceDto { ClassName = "VIDEO - BUNDLE/MISC", Name = "FIVOD", Description = "VIDEO ON DEMAND SERV" },
                new ServiceDto { ClassName = "VIDEO - TIERS", Name = "FIES1", Description = "FIOS TV ESSENTIALS" },
                new ServiceDto { ClassName = "VIDEO - TIERS", Name = "FIHDS", Description = "HIGH DEFINITION -TRK" },
                new ServiceDto { ClassName = "VIDEO - TIERS", Name = "FIPR1", Description = "FIOS TV PREMIER" },
                new ServiceDto { ClassName = "VIDEO - TIERS", Name = "FIPR5", Description = "FIOS TV PREM ENH BIZ" },
                new ServiceDto { ClassName = "VOICE", Name = "VOICE", Description = "FTTH VOICE SERVICE" },
            };

            //ServiceProfiles
            var vsps = new List<ServiceProfileDto>
            {
                NewVoiceServiceProfile("4258818771", 1, 413, "MRCC00181AB9P01", null),
                NewVoiceServiceProfile("4258699232", 1, 414, "MRCC00181AB9P02", null)
            };

            //Account
            var acct = new AccountDto
            {
                AcctContactEmail = null,
                AcctContactName = null,
                AcctContactPhone = null,
                Email = null,
                Location = loc,
                ID = null,
                Name = null,
                PIN = null,
                PinRequired = false,
                PPVCap = "1.00",
                PPVEnabled = true,
                PPVPrivilege = "2",
                PPVResetDay = "15",
                ServiceEnabled = true,
                ServiceProfiles = vsps,
                Services = svcs
            };

            var sub = new SubscriberDto
            {
                ID = "370002312079",
                Name = "KIKUYA JAPANESE RESTAURAN",
                SubContactEmail = "*****@*****.**",
                SubContactPhone = "4258818771",
                CustomFields = new List<CustomFieldDto>
                {
                    new CustomFieldDto{Label ="Service_ID", Value=""},
                    new CustomFieldDto{Label = "PCAN", Value="F274112844"},
                    new CustomFieldDto{Label = "IP_TYPE", Value="DYNAMIC"},
                    new CustomFieldDto{Label = "Sub_WTN", Value=""},
                },
                Accounts = new List<AccountDto> { acct }
            };
            return sub;
        }
コード例 #2
0
ファイル: Validation.cs プロジェクト: borealwinter/simpl
        /// <summary>
        /// ValidateAccount method - takes AccountDto objects and loadAll
        /// </summary>
        /// <param name="expected"></param>
        /// <param name="actual"></param>
        /// <param name="loadAll"></param>
        public static void ValidateAccount(AccountDto expected, AccountDto actual, bool loadAll)
        {
            if (expected == null)
            {
                return;
            }
            if (expected.AcctContactEmail != null)
            {
                Validate(expected.AcctContactEmail, actual.AcctContactEmail, TestAttribute.AcctContactEmail);
            }
            if (expected.AcctContactName != null)
            {
                Validate(expected.AcctContactName, actual.AcctContactName, TestAttribute.AcctContactName);
            }
            if (expected.AcctContactPhone != null)
            {
                Validate(expected.AcctContactPhone, actual.AcctContactPhone, TestAttribute.AcctContactPhone);
            }
            if (expected.Email != null)
            {
                Validate(expected.Email, actual.Email, TestAttribute.Email);
            }
            if (expected.ID != null)
            {
                Validate(expected.ID, actual.ID, TestAttribute.ID);
            }
            if (expected.Name != null)
            {
                Validate(expected.Name, actual.Name, TestAttribute.Name);
            }
            if (expected.Location != null)
            {
                ValidateLocation(expected.Location, actual.Location);
            }
            if (expected.PIN != null)
            {
                Validate(expected.PIN, actual.PIN, TestAttribute.Pin);
                Validate(expected.PinRequired, actual.PinRequired, TestAttribute.PinRequired.ToString());
            }
            if (expected.PPVCap != null)
            {
                Validate(expected.PPVCap, actual.PPVCap, TestAttribute.PPVCap);
            }
            if (expected.PPVEnabled != null)
            {
                Validate(expected.PPVEnabled, actual.PPVEnabled, TestAttribute.PPVEnabled.ToString());
            }
            if (expected.PPVPrivilege != null)
            {
                switch (expected.PPVPrivilege)
                {
                    case "Y":
                        expected.PPVPrivilege = "1";
                        break;
                    case "C":
                        expected.PPVPrivilege = "2";
                        break;
                    case "N":
                        expected.PPVPrivilege = "0";
                        break;
                }
                Validate(expected.PPVPrivilege, actual.PPVPrivilege, TestAttribute.PPVPrivilege);
            }
            if (expected.PPVResetDay != null)
            {
                Validate(expected.PPVResetDay, actual.PPVResetDay, TestAttribute.PPVResetDay);
            }
            if (expected.ServiceEnabled != null)
            {
                Validate(expected.ServiceEnabled, actual.ServiceEnabled, TestAttribute.ServiceEnabled.ToString());
            }

            //LoadAll returns Services info
            if (loadAll)
            {
                if (expected.Services != null)
                {
                    ValidateService(expected.Services, actual.Services, TestAttribute.Services);
                }
            }
            Console.WriteLine();
        }