public async System.Threading.Tasks.Task TestGetRandomStreamMustHaveOneStream() { _fakeHttpMessageHandler.Setup(f => f.Send(It.IsAny <HttpRequestMessage>())).Returns(new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent (File.ReadAllText("streams.json")) }); var api = new TwitchApi("1234", _twitchClient); var result = await api.GetRandomStream(); _outputter.WriteLine($"Stream title: {result.title}"); _outputter.WriteLine($"Stream username: {result.user_name}"); Assert.IsType <StreamDTO>(result); }
public async Task <StreamDTO> RandomStream() { var twitchApi = new TwitchApi(_apikeys.twitch); return(await twitchApi.GetRandomStream()); }