public void ShouldSetBaseAddressToApiWhenHttpFactoryIsUsed() { var configuration = new LineConfiguration() { ChannelAccessToken = "ChannelAccessToken", ChannelSecret = "ChannelSecret", }; ILineBot bot = new LineBot(configuration); var field = bot.GetType().GetRuntimeFields().Where(f => f.Name == "_client").First(); var client = (HttpClient)field.GetValue(bot); Assert.AreEqual(new Uri("https://api.line.me/v2/bot/"), client.BaseAddress); }
public void Constructor_HttpFactoryIsUsed_BaseAddressUsesApi() { LineConfiguration configuration = new LineConfiguration() { ChannelAccessToken = "ChannelAccessToken", ChannelSecret = "ChannelSecret", }; ILineBot bot = new LineBot(configuration); FieldInfo field = bot.GetType().GetRuntimeFields().Where(f => f.Name == "_client").First(); HttpClient client = (HttpClient)field.GetValue(bot); Assert.AreEqual(new Uri("https://api.line.me/v2/bot/"), client.BaseAddress); }