public void Init() { webClient = Substitute.For <IWebClient>(); webClientProvider = Substitute.For <IWebClientProvider>(); webClient.DownloadString(Arg.Any <string>()).Returns(File.ReadAllText("sample.json")); webClientProvider.WebClient().Returns(webClient); futureSyncController = new FutureSyncController(webClientProvider); }
private IEnumerable <dynamic> GetRawData() { if (rawData == null) { var client = webClientProvider.WebClient(); var data = client.DownloadString(api); var json = $"{{ speakers : {data}}}"; rawData = (JObject.Parse(json) as dynamic).speakers as IEnumerable <dynamic>; } return(rawData); }