public void RegisterMVPD_RegistrationInfoWithoutTransmitterLocation_ValidationErrorException() { MvpdRegistrationInfo mvpdRegistrationInfo = new MvpdRegistrationInfo { Name = "Mvpd Registration", CallSign = "WBFF", Channel = 46, RecieveLocation = new Location { Latitude = 38.66484069824219, Longitude = -77.43494415283203 }, Contact = new Whitespace.Entities.Versitcard.VCard { Address = new Microsoft.Whitespace.Entities.Versitcard.Address { POBox = "560054", Street = "New Street", Locality = "New Friends Colony", Region = "1", Code = "Wa99808", Country = "India" }, Telephone = new Microsoft.Whitespace.Entities.Versitcard.Telephone[] { new Microsoft.Whitespace.Entities.Versitcard.Telephone { TelephoneNumber = "123-456-7890" } }, Email = new Microsoft.Whitespace.Entities.Versitcard.Email[] { new Microsoft.Whitespace.Entities.Versitcard.Email { EmailAddress = "*****@*****.**" } } }, RegistrantInfo = new Whitespace.Entities.Versitcard.VCard { Org = new Microsoft.Whitespace.Entities.Versitcard.Organization { OrganizationName = "Aditi Technologies" }, Address = new Microsoft.Whitespace.Entities.Versitcard.Address { POBox = "560054", Street = "New Street", Locality = "New Friends Colony", Region = "1", Code = "Wa99808", Country = "India" } } }; this.whitespacesManager.RegisterMVPD(mvpdRegistrationInfo, accessToken); }
public void RegisterMVPD_RegistrationInfoWithoutContact_ValidationErrorException() { MvpdRegistrationInfo mvpdRegistrationInfo = new MvpdRegistrationInfo { Name = "Mvpd Registration", CallSign = "WBFF", Channel = 46, RecieveLocation = new Location { Latitude = 38.66484069824219, Longitude = -77.43494415283203 }, TransmitLocation = new Location { Latitude = 39.3362177768783, Longitude = -76.6494136354878 }, RegistrantInfo = new Whitespace.Entities.Versitcard.VCard { Org = new Microsoft.Whitespace.Entities.Versitcard.Organization { OrganizationName = "Aditi Technologies" }, Address = new Microsoft.Whitespace.Entities.Versitcard.Address { POBox = "560054", Street = "New Street", Locality = "New Friends Colony", Region = "1", Code = "Wa99808", Country = "India" } } }; this.whitespacesManager.RegisterMVPD(mvpdRegistrationInfo, accessToken); }
public ActionResult Register(MVPDRegisterViewModel viewModel) { JsonResponse response = new JsonResponse(); var userPrincipal = (UserPrincipal)User; UserDetails userDetails = userPrincipal.UserManager.GetUserDetailsByAccessToken(userPrincipal.AccessToken); if (ModelState.IsValid) { MvpdRegistrationInfo info = new MvpdRegistrationInfo { CallSign = viewModel.CallSign, Channel = Convert.ToInt32(viewModel.Channel), Name = viewModel.FriendlyName, RecieveLocation = new Whitespace.Entities.Location { Latitude = Convert.ToDouble(viewModel.MVPDLocationLatittude), Longitude = Convert.ToDouble(viewModel.MVPDLocationLongitude), }, TransmitLocation = new Whitespace.Entities.Location { Latitude = Convert.ToDouble(viewModel.TransmitterLatittude), Longitude = Convert.ToDouble(viewModel.TransmitterLongitude), }, RegistrantInfo = new Whitespace.Entities.Versitcard.VCard { Org = new Whitespace.Entities.Versitcard.Organization { OrganizationName = viewModel.CableCompanyName }, Address = new Whitespace.Entities.Versitcard.Address { Street = viewModel.Address1, Region = viewModel.City, Country = viewModel.Country } }, Contact = new Whitespace.Entities.Versitcard.VCard { Title = new Whitespace.Entities.Versitcard.Title { Text = viewModel.FriendlyName }, Address = new Whitespace.Entities.Versitcard.Address { Street = viewModel.Address1, Region = viewModel.City, Country = viewModel.Country }, Telephone = new Whitespace.Entities.Versitcard.Telephone[] { new Whitespace.Entities.Versitcard.Telephone { TelephoneNumber = viewModel.Phone } }, Email = new Whitespace.Entities.Versitcard.Email[] { new Whitespace.Entities.Versitcard.Email { EmailAddress = viewModel.Email } } } }; response.Message = this.whitespacesManager.RegisterMVPD(info, userPrincipal.AccessToken); response.IsSuccess = true; var region = CommonUtility.GetRegionByName(this.defaultRegion); this.RegistrationAuditor.RegionCode = region != null?Convert.ToInt32(region.RegionInformation.Id) : 0; this.RegistrationAuditor.TransactionId = this.RegistrationLogger.TransactionId; this.RegistrationAuditor.UserId = userDetails.UserInfo.RowKey; if (string.Equals(response.Message, Microsoft.WhiteSpaces.Common.Constants.SuccessfullDeviceRegistration, StringComparison.OrdinalIgnoreCase)) { this.RegistrationAuditor.Audit(AuditId.DeviceRegistration, AuditStatus.Success, default(int), "MVPD Incumbent registration submit by " + userDetails.UserInfo.UserName + "is successful"); this.RegistrationLogger.Log(TraceEventType.Information, LoggingMessageId.PortalMvpdRegistration, "MVPD Incumbent registration submit by " + userDetails.UserInfo.UserName + "is successful"); } else { this.RegistrationAuditor.Audit(AuditId.DeviceRegistration, AuditStatus.Failure, default(int), "MVPD Incumbent registration submit by " + userDetails.UserInfo.UserName + "is failed"); this.RegistrationLogger.Log(TraceEventType.Error, LoggingMessageId.PortalMvpdRegistration, "MVPD Incumbent registration submit by " + userDetails.UserInfo.UserName + "is failed due to error " + response.Message); } } return(this.Json(response)); }
public void RegisterMVPD_NullAsAccessToken_ArgumentNullException() { MvpdRegistrationInfo mvpdRegistrationInfo = new MvpdRegistrationInfo(); this.whitespacesManager.RegisterMVPD(mvpdRegistrationInfo, null); }
public void RegisterMVPD_ValidRegistrationInfoWithAllMandatoryParameters_AddsMvpdSuccessfully() { MvpdRegistrationInfo mvpdRegistrationInfo = new MvpdRegistrationInfo { Name = "Mvpd Registration", CallSign = "WBFF", Channel = 46, RecieveLocation = new Location { Latitude = 38.66484069824219, Longitude = -77.43494415283203 }, TransmitLocation = new Location { Latitude = 39.3362177768783, Longitude = -76.6494136354878 }, Contact = new Whitespace.Entities.Versitcard.VCard { Address = new Microsoft.Whitespace.Entities.Versitcard.Address { POBox = "560054", Street = "New Street", Locality = "New Friends Colony", Region = "1", Code = "Wa99808", Country = "India" }, Telephone = new Microsoft.Whitespace.Entities.Versitcard.Telephone[] { new Microsoft.Whitespace.Entities.Versitcard.Telephone { TelephoneNumber = "123-456-7890" } }, Email = new Microsoft.Whitespace.Entities.Versitcard.Email[] { new Microsoft.Whitespace.Entities.Versitcard.Email { EmailAddress = "*****@*****.**" } } }, RegistrantInfo = new Whitespace.Entities.Versitcard.VCard { Org = new Microsoft.Whitespace.Entities.Versitcard.Organization { OrganizationName = "Aditi Technologies" }, Address = new Microsoft.Whitespace.Entities.Versitcard.Address { POBox = "560054", Street = "New Street", Locality = "New Friends Colony", Region = "1", Code = "Wa99808", Country = "India" } } }; Result result = this.RegisteredDeviceResult(); this.whitespacesDataClient.AddIncumbentIRequestParameters = (request) => result; string actualMessage = this.whitespacesManager.RegisterMVPD(mvpdRegistrationInfo, accessToken); Assert.AreEqual("Device Registered successfully.", actualMessage); }