Ejemplo n.º 1
0
 public QueryNumbers(CfQueryNumbers source)
 {
     MaxResults  = source.MaxResults;
     FirstResult = source.FirstResult;
     Region      = RegionMapper.ToRegion(source.Region);
     LabelName   = source.LabelName;
 }
        public void Test__QueryNumbersAllResults()
        {
            var queryNumbers = new CfQueryNumbers
            {
                Region = new CfRegion()
            };
            var numberQueryResult = Client.QueryNumbers(queryNumbers);

            Assert.IsNotNull(numberQueryResult);
        }
Ejemplo n.º 3
0
        public CfNumberQueryResult QueryNumbers(CfQueryNumbers queryNumbers)
        {
            var resourceList = BaseRequest <ResourceList>(HttpMethod.Get, new QueryNumbers(queryNumbers),
                                                          new CallfireRestRoute <Number>());

            var number = resourceList.Resource == null ? null
                : resourceList.Resource.Select(r => NumberMapper.FromNumber((Number)r)).ToArray();

            return(new CfNumberQueryResult(resourceList.TotalResults, number));
        }
Ejemplo n.º 4
0
        public void FixtureSetup()
        {
            var region = new CfRegion(null, null, null, null, null, null, null, null, null, null);

            Client                  = new SoapNumberClient(MockClient.User(), MockClient.Password());
            RegionQuery             = new CfRegionQuery(100, 0, region);
            SearchAvailableKeywords = new CfSearchAvailableKeywords(string.Empty);
            SearchAvailableNumbers  = new CfSearchAvailableNumbers(null, true, 100);
            QueryKeywords           = new CfQuery();
            QueryNumbers            = new CfQueryNumbers(100, 0, region, null);
        }
        public void Test_QueryNumbersComplete()
        {
            var queryNumbers = new CfQueryNumbers
            {
                MaxResults  = 10,
                FirstResult = 50,
                Region      = new CfRegion
                {
                    Prefix     = "1310774",
                    City       = "MALIBU",
                    State      = "CA",
                    Zipcode    = "90264",
                    Country    = "US",
                    Lata       = "730",
                    RateCenter = "MALIBU",
                    Latitude   = (float)34.0331,
                    Longitude  = (float)-118.633,
                    TimeZone   = "America/Los_Angeles"
                }
            };
            var numberQueryResult = Client.QueryNumbers(queryNumbers);

            Assert.IsNotNull(numberQueryResult);
        }
        public CfNumberQueryResult QueryNumbers(CfQueryNumbers queryNumbers)
        {
            var numberQueryResult = NumberService.QueryNumbers(new QueryNumbers(queryNumbers));

            return(NumberQueryResultMapper.FromNumberQueryResult(numberQueryResult));
        }