public async Task TestLiveYoutubeReferences() { var testChannel = "#reprap"; var testUser = "******"; _gthx.HandleReceivedMessage(testChannel, testUser, $"OMG! Check this out! https://www.youtube.com/watch?v=I7nVrT00ST4"); await Task.Delay(5000); var replies = _client.GetReplies(); Assert.AreEqual(1, replies.Messages.Count); Assert.AreEqual(testChannel, replies.Channel); Assert.AreEqual($"{testUser} linked to YouTube video \"Pro Riders Laughing\" => 1 IRC mentions", replies.Messages[0]); // Test non-Western characters testUser = "******"; _gthx.HandleReceivedMessage(testChannel, testUser, $"Calm down and listen to this: https://www.youtube.com/watch?v=xtAHgrNs7r4"); await Task.Delay(5000); replies = _client.GetReplies(); Assert.AreEqual(1, replies.Messages.Count); Assert.AreEqual(testChannel, replies.Channel); Assert.AreEqual($"{testUser} linked to YouTube video \"Studio Ghibli - Music Collection (Piano and Violin Duo) 株式会社スタジオジブリ- Relaxing music song\" => 1 IRC mentions", replies.Messages[0]); }
public void TestGenericResponse() { // Test channel message var testChannel = "#reprap"; var testUser = "******"; _gthx.HandleReceivedMessage(testChannel, testUser, "Which printer is best?"); var replies = _client.GetReplies(); Assert.AreEqual(0, replies.Messages.Count); // Test DM testChannel = "_gthx"; testUser = "******"; _gthx.HandleReceivedMessage(testChannel, testUser, "Hey, can you help me?"); replies = _client.GetReplies(); Assert.AreEqual(0, replies.Messages.Count); }