예제 #1
0
        public void FindCountry_InvalidCharacters_ThrowsException(string value)
        {
            var target = new WorldBankData();

            var       task      = target.FindCountry(value);
            Exception exception = Assert.Throws <AggregateException>(() => task.Wait());

            Assert.IsType <ArgumentException>(exception.InnerException);
        }
예제 #2
0
        public void FindCountry_InValidCountry_ReturnsNull()
        {
            var target = new WorldBankData();

            var task = target.FindCountry("XX");

            task.Wait();

            Assert.Null(task.Result);
        }
예제 #3
0
        public void FindCountry_ValidCountry_ReturnsCountry()
        {
            var target = new WorldBankData();

            var task = target.FindCountry("GB");

            task.Wait();

            Assert.IsType <Country>(task.Result);
        }
예제 #4
0
        public void FindCountry_GreatBritain_ReturnsRequiredValues(string value)
        {
            var target = new WorldBankData();

            var task = target.FindCountry(value);

            task.Wait();

            Assert.Equal("United Kingdom", task.Result.Name);
            Assert.Equal("Europe & Central Asia", task.Result.Region);
            Assert.Equal("London", task.Result.CapitalCity);
            Assert.Equal(-0.126236M, task.Result.Longitude);
            Assert.Equal(51.5002M, task.Result.Latitude);
        }