public EquipmentDto() { Type = new EquipmentTypeDto(); BlockedServiceList = new ServiceCollectionDto(); CustomFields = new List<CustomFieldDto>(); }
public void EditBlockedServices_SubServicesAreBlockedOnDevice_ValidateUserAbleToLoadEditBlockedServicesCorrectly() { using (ShimsContext.Create()) { // Given a user ShimCurrentUser.AsUserDto = () => new UserDto(); // And a valid subscriber id const string subId = "sub12345"; // And the subscriber has a provisioned location const string locId = "loc12345"; // And the subscriber has a list of services var services = new ServiceCollectionDto { new ServiceDto {ClassName = "DATA - FTTH SPEED", Name = "F10M02M", Description = "10M DOWN 2M UP"}, new ServiceDto {ClassName = "DATA - ONT PORT", Name = "ENET", Description = "RJ-45 ETHERNET PORT"}, new ServiceDto {ClassName = "VOICE", Name = "VOICE", Description = "FTTH VOICE SERVICE"}, new ServiceDto {ClassName = "RF - BASICS", Name = "FIOS", Description = "FIOS VIDEO SERVICE"}, new ServiceDto {ClassName = "RF - PREMIUMS", Name = "FIHBO", Description = "HBO"} }; // And the subscriber has an equipment which has all above services blocked var equip = new EquipmentDto { SerialNumber = "equip12345", LocationId = locId, AssociatedSubscriberId = subId, BlockedServiceList = services }; // And the subscriber has a valid account with above location, services, and equipment var subscriberDto = new SubscriberDto { ID = subId, Accounts = new List<AccountDto> { new AccountDto { Location = new LocationDto {ID = locId}, Services = services, Equipment = new EquipmentCollectionDto {equip} } } }; ShimRosettianClient.AllInstances.LoadSubscriberStringUserDto = (myTestClient, mySubId, myUserDto) => subscriberDto; ShimServices.ProvisioningServicesGet = () => services; // And the blocked service list AsCategorizedServiceDictionary var expectedBlockedServices = equip.BlockedServiceList.AsCategorizedServiceDictionary(); // And the blockedServicesAsJson var blockedServicesAsJson = ServicesControllerHelper.ConvertServicesToJSON(equip.BlockedServiceList); // When loading that EditBlockedServices for the subscriber id and device id var servicesController = DependencyResolver.Current.GetService<ServicesController>(); var result = servicesController.EditBlockedServices(blockedServicesAsJson, subId, equip.SerialNumber, "") as PartialViewResult; // Then the user receives a response Assert.IsNotNull(result, "ServiceController EditBlockedServices method returned null"); // And the response is successful Assert.AreEqual("EditBlockedServices_Partial", result.ViewName, "ViewName does not match"); var actualServicesModel = result.Model as ServicesModel; Assert.IsNotNull(actualServicesModel, "actualServicesModel"); // And the subscriber matches the requested subscriber Assert.AreEqual(subId, actualServicesModel.SubscriberID, "SubscriberID does not match"); // And the device matches the requested device Assert.AreEqual(equip.SerialNumber, actualServicesModel.DeviceID, "DeviceID does not match"); // And the blocked services list matches the requested blocked services list var jss = new JavaScriptSerializer(); Assert.AreEqual(jss.Serialize(expectedBlockedServices), jss.Serialize(actualServicesModel.BlockedServicesList), "BlockedServiceList does not match"); // And the ServicesAsJSON result matches the blockedServicesAsJson Assert.AreEqual(blockedServicesAsJson, actualServicesModel.ServicesAsJSON, "ServiceAsJSON does not match"); // And the subscriber services list is empty since all subscriber services are blocked on the device Assert.AreEqual(0, actualServicesModel.SubscriberServicesList.Count, "SubscriberServiceList is not empty"); } }
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; }
public AccountDto() { Location = new LocationDto(); Services = new ServiceCollectionDto(); ServiceProfiles = new List<ServiceProfileDto>(); }
/// <summary> /// DefaultServices_MOCA - default services for MOCA /// </summary> /// <returns></returns> protected static ServiceCollectionDto DefaultServices_MOCA() { var data = new ServiceCollectionDto { new ServiceDto{ ClassName = "DATA - FTTH SPEED", Name = "F10M02M", Description = "10M DOWN 2M UP" }, new ServiceDto{ ClassName = "DATA - ONT PORT", Name = "MOCA", Description = "MOCA PORT" }, new ServiceDto{ ClassName = "VOICE", Name = "VOICE", Description = "FTTH VOICE SERVICE" }, new ServiceDto{ ClassName = "RF - BASICS", Name = "FIOS", Description = "FIOS VIDEO SERVICE" }, new ServiceDto{ ClassName = "VIDEO - PREMIUMS", Name = "FIHBO", Description = "HBO" } }; return data; }
/// <summary> /// DefaultServices_Cvoip - default services for CVoIP /// </summary> /// <returns></returns> protected static ServiceCollectionDto DefaultServices_Cvoip() { var data = new ServiceCollectionDto { new ServiceDto{ ClassName = "VOICE", Name = "CVOIP", Description = "CONSUMER VOIP" } }; return data; }