Пример #1
0
        public void CreateNotes_GetNotesFromTriad_Succeed_Test()
        {
            var loc = new LocationDto();
            var sub = new SubscriberDto();
            try
            {
                // new sub and loc data
                loc = DataHelper.NewLocationData();
                sub = DataHelper.NewSubscriberData();
                sub.Accounts.First().Location = loc;
                DataHelper.RestoreLocation1(loc, false);
                DataHelper.RestoreSubscriber1(sub, false);

                // set current subscriber
                CurrentSubscriber.SetInstance(sub);

                // create new note
                var newNote = new NoteDto
                {
                    NoteCode = "DEFAULT",
                    NoteText = "This new note is created from SIMPL integration test",
                    NoteType = NoteTypeDto.SubNote

                };
                var sh = new SubscriberHelper();
                sh.CreateSubNote(sub.ID, newNote);

                var criteria = new SearchServiceHistoryDto
                {
                    SubscriberId = sub.ID,
                    LocationId = loc.ID,
                    StartDate = DateTime.Now.AddDays(-1),
                    EndDate = DateTime.Now.AddDays(+1)
                };
                // call LoadLocation action method
                var result = NotesControllerForTests.LoadRosettianNotes(criteria);

                // validate response result is not null
                Assert.IsNotNull(result, "Notes object is null");
                Assert.IsTrue(result.Any(), "There are no notes in Triad system for the given search criteria");
                Assert.IsTrue(result.Any(x => x.Notes.Contains("This new note is created from SIMPL integration test")), "The newly created note doesn't exist");
            }
            catch (Exception ex)
            {
                Assert.IsTrue(ex is AssertFailedException, ex.ToString());
                throw;
            }
            finally
            {
                DataHelper.DeleteSubscriber(sub.ID);
                DataHelper.DeleteLocation(loc.ID);
            }
        }
Пример #2
0
        /// <summary>
        /// Generate the location
        /// </summary>
        /// <returns></returns>
        public LocationDto GenerateLocationForLocalObject()
        {
            LocationDto lDto = new LocationDto();
            lDto.ID = GenerateALocationIDForLocalObject();
            lDto.CityName = GenerateACityNameForLocalObject();
            lDto.AddressLine1 = GenerateAnAddress1ForLocalObject();
            lDto.AddressLine2 = String.Empty;
            lDto.ZipCode = "46816";
            lDto.ZipPlusFourCode = string.Empty;
            lDto.StateName = "IN";
            lDto.HeadendCode = "01";
            lDto.HasSubscriber = true;
            lDto.FacilityList = new List<FacilityDto>();
            lDto.CustomFields = new List<CustomFieldDto>();

            using (var client = new RosettianClient())
            {
                var user = CurrentUser.AsUserDto();
                client.CreateLocation(lDto, user);
            }

            return lDto;
        }
Пример #3
0
        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;
        }
Пример #4
0
        public static SubscriberDto RgTestSub2With1ActiveRg()
        {
            const string subId = "999000795551";
            const string locId = "REN";
            const string rgSerial = "PACE99999991";
            var equipCriteria = new EquipmentCriteriaDto
            {
                LocationId = locId,
                SerialNumber = rgSerial,
                Model = "ARRIS RG",
                Status = "ACTIVE",
                UnitAddress = "001E46"
            };

            var loc = new LocationDto { ID = locId, AddressLine1 = "19999 19TH AVE", CityName = "RENTON", StateName = "WA", ZipCode = "98999" };
            RestoreLocation1(loc, false);
            Return2Headend(locId);
            var rgEquip = RestoreEquip(equipCriteria);

            var rgDataPort = rgEquip.FirstOrDefault(x => x.SerialNumber.Substring(x.SerialNumber.Length - 3, 3) == "D01");
            Assert.IsNotNull(rgDataPort);
            rgDataPort.CustomFields = new List<CustomFieldDto>
            {
                new CustomFieldDto()
                {
                    Label = "ENET_MAC_ADDR",
                    Value = "A0:B1:C2:D3:E4:F5"
                }
            };
            RestoreEquip(rgDataPort);

            var sub = new SubscriberDto
            {
                ID = subId,
                Name = "Cathy Copper",
                Accounts = new List<AccountDto>
                {
                    new AccountDto
                    {
                        Location = loc,
                        Equipment = rgEquip,
                    }
                },
                CustomFields = new List<CustomFieldDto>
                {
                    new CustomFieldDto
                    {
                        Label = "WAN_IP_ADDR",
                        Value = "10.129.96.213"
                    }
                }
            };
            return RestoreSubscriber(sub);
        }
Пример #5
0
 public AccountDto()
 {
     Location = new LocationDto();
      Services = new ServiceCollectionDto();
      ServiceProfiles = new List<ServiceProfileDto>();
 }
Пример #6
0
        /// <summary>
        /// ValidateLocation method - takes LocationDto objects
        /// </summary>
        /// <param name="expected"></param>
        /// <param name="actual"></param>
        public static void ValidateLocation(LocationDto expected, LocationDto actual)
        {
            if (expected == null)
            {
                return;
            }
            Console.WriteLine();
            Console.WriteLine("=== Validation: Location ===\r\n");

            Validate(expected.ID, actual.ID, TestAttribute.LocationID);
            Validate(expected.HeadendCode, actual.HeadendCode, TestAttribute.HeadendCode);
            if (expected.AddressLine1 != null)
            {
                Validate(expected.AddressLine1, actual.AddressLine1, TestAttribute.AddressLine1);
            }
            if (expected.AddressLine2 != null)
            {
                Validate(expected.AddressLine2, actual.AddressLine2, TestAttribute.AddressLine2);
            }
            if (expected.CityName != null)
            {
                Validate(expected.CityName, actual.CityName, TestAttribute.City);
            }
            if (expected.StateName != null)
            {
                Validate(expected.StateName, actual.StateName, TestAttribute.State);
            }
            if (expected.ZipCode != null)
            {
                Validate(expected.ZipCode, actual.ZipCode, TestAttribute.Zip);
            }
            if (expected.ZipPlusFourCode != null)
            {
                Validate(expected.ZipPlusFourCode, actual.ZipPlusFourCode, TestAttribute.ZipPlus4Code);
            }
            if (expected.FacilityList != null && expected.FacilityList.Count != 0)
            {
                ValidateFacility(expected.FacilityList, actual.FacilityList);
            }
            if (expected.CustomFields != null)
            {
                ValidateCustomFields(expected.CustomFields, actual.CustomFields);
            }
            if (expected.HasSubscriber != null)
            {
                Validate(expected.HasSubscriber, actual.HasSubscriber, TestAttribute.HasSubscriber.ToString());
            }
            Console.WriteLine();
        }