public void Heading_argumentoutofrange(short badvalue)
 {
     Assert.Throws <ArgumentOutOfRangeException>(() =>
     {
         StreetViewRequest sm = new StreetViewRequest()
         {
             Heading = badvalue
         };
     });
 }
 public void Invalid_size_propert_set()
 {
     Assert.Throws <ArgumentOutOfRangeException>(() =>
     {
         StreetViewRequest sm = new StreetViewRequest()
         {
             Size = new MapSize(-1, -1)
         };
     });
 }
 public void Invalid_size_max()
 {
     Assert.Throws <ArgumentOutOfRangeException>(() =>
     {
         StreetViewRequest sm = new StreetViewRequest()
         {
             Size = new MapSize(4097, 4097)
         };
     });
 }
Exemplo n.º 4
0
        public void BasicUri()
        {
            //arrange
            var expected = Helpers.ParseQueryString("/maps/api/streetview?location=30.1,-60.2&size=512x512");

            StreetViewRequest sm = new StreetViewRequest()
            {
                Location = new LatLng(30.1, -60.2)
                , Size   = new MapSize(512, 512)
            };

            //act
            Uri actualUri = sm.ToUri();
            var actual    = Helpers.ParseQueryString(actualUri.PathAndQuery);

            //assert
            actual.ShouldAllBeEquivalentTo(expected);
        }
Exemplo n.º 5
0
        public Task <Stream> GetStreamAsync(StreetViewRequest request)
        {
            var uri = new Uri(baseUri, request.ToUri());

            return(http.GetStreamAsync(uri));
        }
Exemplo n.º 6
0
        public Stream GetStream(StreetViewRequest request)
        {
            var uri = new Uri(baseUri, request.ToUri());

            return(http.GetStream(uri));
        }
Exemplo n.º 7
0
        public async Task <byte[]> GetImageAsync(StreetViewRequest request)
        {
            var stream = await GetStreamAsync(request);

            return(StreamToArray(stream));
        }
Exemplo n.º 8
0
        public byte[] GetImage(StreetViewRequest request)
        {
            var stream = GetStream(request);

            return(StreamToArray(stream));
        }