public DLiveStreamProvider( DLiveGraphQLGateway dliveApi, DLiveStreamMapper streamMapper, DLiveChannelMapper channelMapper ) { this.dliveApi = dliveApi; this.streamMapper = streamMapper; this.channelMapper = channelMapper; }
public void Should_Map_A_DLive_Channel_To_A_PlatformChannel() { var mapper = new DLiveChannelMapper(dliveUrl); var dliveUser = new DLiveUserDto { displayName = "testuser", avatar = "http://avatar.url" }; var userSearchResults = MaybeResult <DLiveUserDto, StreamProviderError> .Success(dliveUser); var platformChannl = mapper.Map(userSearchResults).GetOrElse(new PlatformChannelDto()); Assert.AreEqual(platformChannl.ChannelName, "testuser"); Assert.AreEqual(platformChannl.AvatarUrl, "http://avatar.url"); Assert.AreEqual(platformChannl.StreamPlatformName, StreamPlatform.DLive); Assert.AreEqual(platformChannl.ChannelUrl, "http://dlive.com/testuser"); }