public void TestLoadSearchOporto() { using (WeatherWebApi api = new WeatherWebApi()) { LocationInfo[] locals = api.Search("oporto"); Assert.AreEqual(6, locals.Length); Assert.AreEqual("Cuba", locals[5].Country); } }
public void ShouldLoadSearchOporto() { using (WeatherWebApi api = new WeatherWebApi()) { IEnumerable <LocationInfo> locals = api.Search("oporto"); Assert.AreEqual(6, locals.Count()); Assert.AreEqual("Cuba", locals.ElementAt(5).Country); } }
public void TestLoadSearchOportoOnRequestMock() { Mocker mocker = new Mocker(typeof(IHttpRequest)); mocker.When("GetBody") .With(oportoSearchUrl) .Return(oportoSearchBody); mocker .When("Dispose").Then(() => { }).With(); IHttpRequest req = (IHttpRequest)mocker.Create(); using (IWeatherWebApi api = new WeatherWebApi(req)) { IEnumerable <LocationInfo> locals = api.Search("oporto"); Assert.AreEqual(6, locals.Count()); Assert.AreEqual("Cuba", locals.ElementAt(5).Country); } }