Ejemplo n.º 1
0
        public async Task Service_Returns_DefaultValue()
        {
            var httpClient = new MockHttpClient(Responses);
            var dogs       = new DogceoPictures(httpClient, "broken_dog_url");
            var stream     = await dogs.GetDogPictureAsync();

            var response = new StreamReader(stream).ReadToEnd();

            Assert.AreEqual("a picture of a default dog", response);
        }
Ejemplo n.º 2
0
        public async Task Service_Returns_Dog()
        {
            var httpClient = new MockHttpClient(Responses);
            var dogs       = new DogceoPictures(httpClient, "test_dog_url");
            var stream     = await dogs.GetDogPictureAsync();

            var actual = new StreamReader(stream).ReadToEnd();

            Assert.AreEqual("a picture of a dog", actual);
        }