public string RegisterMVPD(mwc.MvpdRegistrationInfo registrationInfo, string accessToken, string regionName = "United States") { Check.IsNotNull(registrationInfo, "MVPD Registration Info"); Check.IsNotNull(accessToken, "Access Token"); var errors = ValidationHelper.Validate <mwc.MvpdRegistrationInfo>(registrationInfo); if (errors.Count() > 0) { throw new mwc.ValidationErrorException(errors); } else { this.requestParams = this.GetRequestParams( req => { req.AccessToken = accessToken; req.Params = new Parameters { IncumbentType = registrationInfo.IncumbentType, MVPDLocation = registrationInfo.RecieveLocation, TransmitLocation = registrationInfo.TransmitLocation, Contact = registrationInfo.Contact, MVPDRegistrant = registrationInfo.RegistrantInfo, TvSpectrum = new TvSpectrum { CallSign = registrationInfo.CallSign, Channel = registrationInfo.Channel, }, // Some more name, description and contact Info, need to capture }; }); return(this.whitespacesClient.AddIncumbent(this.requestParams).Message); } }
public void RegisterMVPD_ValidMVPDRegistrationInfoWithAllMandatoryParameters_RegistersMVPDSuccessfully() { MWC.MvpdRegistrationInfo mvpdRegistrationInfo = new MWC.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" } }, }; string actualResponse = this.whitespacesManager.RegisterMVPD(mvpdRegistrationInfo, accessToken); Assert.AreEqual("Device Registered successfully.", actualResponse); }