示例#1
0
        public void GetStationCounts_EmptyState()
        {
            NrelClient  client   = new NrelClient();
            GeoLocation location = new GeoLocation()
            {
                City  = "Detroit",
                State = ""
            };

            StationCounts counts = client.GetStationCountsByGeoLocation(location);

            Assert.That(counts, Is.Not.Null);
        }
示例#2
0
        public void GetStationCounts()
        {
            NrelClient  client   = new NrelClient();
            GeoLocation location = new GeoLocation()
            {
                City  = "Detroit",
                State = "Michigan"
            };
            StationCounts counts = client.GetStationCountsByGeoLocation(location);

            Assert.That(counts.Ports, Is.Not.Empty);
            Assert.That(counts.Stations, Is.Not.Empty);
        }
示例#3
0
        public void GetStationCounts_NonExistingCityAndState()
        {
            NrelClient  client   = new NrelClient();
            GeoLocation location = new GeoLocation()
            {
                City  = "abc",
                State = "def"
            };

            try
            {
                StationCounts counts = client.GetStationCountsByGeoLocation(location);
                Assert.That(false);
            }
            catch (Exception e)
            {
                Assert.That(e.Message, Is.EqualTo("Cannot perform runtime binding on a null reference"));
            }
        }