예제 #1
0
        public void Setup()
        {
            var innerJsonifier = new Jsonifier();

            _jsonifier = Substitute.For <IJsonifier>();
            _jsonifier
            .ParseJson <List <FetchedQuote> >(Arg.Any <string>())
            .Returns(args => innerJsonifier.ParseJson <List <FetchedQuote> >((string)args[0]));

            _sut = new FetchHandler(_jsonifier);
        }
예제 #2
0
        public async Task <T> FetchAsync <T>(string url)
        {
            var response = await GetAsync(url);

            return(_jsonifier.ParseJson <T>(response));
        }