Exemplo n.º 1
0
        public void CanUpdateGetChannelInfo()
        {
            using (var sut = new MixerRestClient(LoggerFactory, Client))
            {
                sut.InitAsync(ChannelName, Token).Wait(Simulator.TIMEOUT);

                sut.UpdateChannelInfoAsync("New stream title", GameTypeId).Wait();

                var req = Handler.FindRequest($"channels/{ChannelId}", new HttpMethod("PATCH"));
                req.Should().NotBeNull();
                req.Content.Should().NotBeNullOrWhiteSpace();

                var doc = JToken.Parse(req.Content);
                doc["name"].Should().NotBeNull();
                doc["name"].Value <string>().Should().Be("New stream title");
                doc["typeId"].Should().NotBeNull();
                doc["typeId"].Value <uint>().Should().Be(GameTypeId);
            }
        }