示例#1
0
 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);
 }
示例#2
0
        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);
        }