コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CompositeEquipment"/> class.
 /// </summary>
 public CompositeEquipment()
 {
     ResidentialEquipment = new EquipmentDto();
     VideoDevices = new List<EquipmentDto>();
     OtherRGEquipments = new List<EquipmentDto>();
 }
コード例 #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="locationId"></param>
        /// <returns></returns>
        public EquipmentCollectionDto GenerateEquipmentCollectionDto(string locationId)
        {
            var criteria = this.GenerateEquipmentCriteria(locationId);
            EquipmentCollectionDto equipColl = new EquipmentCollectionDto();
            equipColl.Add(new EquipmentDto());

            equipColl[0].HeadendCode = "01";
            equipColl[0].LocationId = locationId;
            equipColl[0].Status = criteria.Status;
            equipColl[0].SerialNumber = criteria.SerialNumber;
            EquipmentDto eDto = new EquipmentDto();
            eDto.HeadendCode = "01";
            eDto.LocationId = locationId;
            eDto.SerialNumber = criteria.SerialNumber;
            eDto.Status = criteria.Status;
            eDto.Type.Model = criteria.Model;

            using (var client = new RosettianClient())
            {
                var user = CurrentUser.AsUserDto();
                client.CreateEquipment(eDto, user);
            }
            return equipColl;
        }
コード例 #3
0
ファイル: Data.cs プロジェクト: borealwinter/simpl
        public static SubscriberDto UVerseSub2With1ActiveRgAnd1ActiveStb()
        {
            const string id = "S1002";
            var subId = string.Format("STBJULEISUB{0}", id);
            var locId = string.Format("STBJULEILOC{0}", id);
            var stbSerial = string.Format("STBJULEI{0}", id);
            var rgSerial = string.Format("PACEJULEI{0}", id);
            var equipCriteria = new EquipmentCriteriaDto
            {
                LocationId = locId,
                SerialNumber = rgSerial,
                Model = "ARRIS RG",
                Status = "ACTIVE",
                UnitAddress = "001E46"
            };

            // Restore location
            var loc = DefaultAddress(locId);
            RestoreLocation(loc);

            // Return unwanted equip to headend
            Return2Headend(loc.ID);

            // Restore RG
            var compositeEquipment = RestoreEquip(equipCriteria);
            var equipmentDto = new EquipmentDto
            {
                SerialNumber = stbSerial,
                Type = new EquipmentTypeDto
                {
                    Model = "VIP2250",
                },
                UnitAddress = "66A29F493EF843D69F8CB211D4181105",
                Status = "ACTIVE",
                LocationId = locId
            };
            compositeEquipment.Add(equipmentDto);

            // Restore STB
            RestoreEquip(equipmentDto);

            var sub = new SubscriberDto
            {
                ID = subId,
                Name = subId,
                Accounts = new List<AccountDto>
                {
                    new AccountDto
                    {
                        Location = loc,
                        Equipment = compositeEquipment
                    }
                },
                CustomFields = new List<CustomFieldDto>
                {
                    new CustomFieldDto{Label ="MAXSTB", Value = "5"},
                }
            };
            return RestoreSubscriber(sub);
        }
コード例 #4
0
ファイル: Data.cs プロジェクト: borealwinter/simpl
        public static SubscriberDto UVerseSub1WithActiveStb()
        {
            const string id = "S1001";
            var subId = string.Format("STBJULEISUB{0}", id);
            var locId = string.Format("STBJULEILOC{0}", id);
            var stbSerial = string.Format("STBJULEI{0}", id);

            var loc = DefaultAddress(locId);
            RestoreLocation(loc);
            Return2Headend(loc.ID);

            var equipmentDto = new EquipmentDto
            {
                SerialNumber = stbSerial,
                Type = new EquipmentTypeDto
                {
                    Model = "VIP2250",
                },
                UnitAddress = "53B2727219AE46EBA414DC425FDC9E47",
                Status = "ACTIVE",
                LocationId = locId
            };
            RestoreEquip(equipmentDto);

            var sub = new SubscriberDto
            {
                ID = subId,
                Name = subId,
                Accounts = new List<AccountDto>
                {
                    new AccountDto
                    {
                        Location = loc,
                        Equipment = new EquipmentCollectionDto{equipmentDto}
                    }
                },
                CustomFields = new List<CustomFieldDto>
                {
                    new CustomFieldDto{Label ="MAXSTB", Value = "5"},
                }
            };
            return RestoreSubscriber(sub);
        }
コード例 #5
0
ファイル: Data.cs プロジェクト: borealwinter/simpl
 public static EquipmentDto UVerseStb1InHeadend()
 {
     const string serialNumber = "STBJULEIS2001";
     var data = new EquipmentDto
     {
         SerialNumber = serialNumber,
         Type = new EquipmentTypeDto
         {
             Model = "VIP2250",
         },
         UnitAddress = "FBD2069B4E93478F90CC69512951C95D",
         Status = "IGNORE",
         LocationId = "HEADEND 04 INVENTORY"
     };
     RestoreEquip(data);
     return data;
 }
コード例 #6
0
        public void Search_Device_By_UnitAddress()
        {
            using (ShimsContext.Create())
            {
                //Arrange
                var myContext = new SIMPLTestContext();
                var fakeUserDto = myContext.GetFakeUserDtoObject();
                ShimCurrentUser.AsUserDto = () => fakeUserDto;

                //search criteria
                var equipmentSearchViewModel = new EquipmentSearchViewModel
                {
                    UnitAddress = "0000043667628067",
                };

                //expected search results
                var expectedSearchResults = new[]
                {
                    new
                    {
                        ID = null as object,
                        Manufacturer = null as object,
                        Model = null as object,
                        UnitAddress = equipmentSearchViewModel.UnitAddress,
                        Status = null as object,
                        LocationID = null as object,
                        AssociatedSubID = null as object,
                    }
                };

                var expectedResult = new
                {
                    status = "valid",
                    searchResults = expectedSearchResults

                }.ToJSON();

                var fakeEquipmentDto = new EquipmentDto()
                {
                    UnitAddress = equipmentSearchViewModel.UnitAddress
                };

                var fakeEquipmentDtoList = new List<EquipmentDto>()
                {
                    fakeEquipmentDto
                };

                ShimRosettianClient.AllInstances.SearchEquipmentSearchFieldsDtoUserDto = delegate
                {
                    return fakeEquipmentDtoList;
                };

                var actionResult = SearchControllerForTests.SearchDevice(equipmentSearchViewModel) as JsonResult;
                Assert.IsNotNull(actionResult, "SearchDevice returned null");
                var actualJsonResult = actionResult.Data.ToJSON();
                Assert.AreEqual(expectedResult, actualJsonResult);
            }
        }
コード例 #7
0
ファイル: Validation.cs プロジェクト: borealwinter/simpl
 /// <summary>
 /// ValidateEquipment method - takes EquipmentDto objects
 /// </summary>
 /// <param name="expected"></param>
 /// <param name="actual"></param>
 public static void ValidateEquipment(EquipmentDto expected, EquipmentDto actual)
 {
     Console.WriteLine();
     Validate(expected.SerialNumber, actual.SerialNumber, TestAttribute.DeviceID);
     if (expected.Type != null)
     {
         ValidateEquipmentModel(expected.Type, actual.Type);
     }
     if (expected.Status != null)
     {
         Validate(expected.Status, actual.Status, TestAttribute.Status);
     }
     if (expected.UnitAddress != null)
     {
         Validate(expected.UnitAddress, actual.UnitAddress, TestAttribute.UnitAddress);
     }
     if (expected.LocationId != null)
     {
         Validate(expected.LocationId, actual.LocationId, TestAttribute.LocationID);
     }
     if (expected.AssociatedSubscriberId != null)
     {
         Validate(expected.AssociatedSubscriberId, actual.AssociatedSubscriberId, TestAttribute.SubscriberID);
     }
     if (expected.CustomFields != null)
     {
         ValidateCustomFields(expected.CustomFields, actual.CustomFields);
     }
     if (expected.VCI != null)
     {
         Validate(expected.VCI, actual.VCI, TestAttribute.VCI);
     }
     if (expected.VPI != null)
     {
         Validate(expected.VPI, actual.VPI, TestAttribute.VPI);
     }
     if (expected.BlockedServiceList != null)
     {
         ValidateService(expected.BlockedServiceList, actual.BlockedServiceList, TestAttribute.BlockedServiceList);
     }
     if (expected.HeadendCode != null)
     {
         Validate(expected.HeadendCode, actual.HeadendCode, TestAttribute.HeadendCode);
     }
     Console.WriteLine();
 }