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); }
public async Task <T> FetchAsync <T>(string url) { var response = await GetAsync(url); return(_jsonifier.ParseJson <T>(response)); }