public async Task ThrowsExceptionWhenGroupIsEmpty() { ILineBot bot = TestConfiguration.CreateBot(); await ExceptionAssert.ThrowsArgumentEmptyExceptionAsync("groupId", async() => { await bot.LeaveGroup(string.Empty); }); }
public async Task ThrowsExceptionWhenGroupIdIsNull() { ILineBot bot = TestConfiguration.CreateBot(); await ExceptionAssert.ThrowsArgumentNullExceptionAsync("groupId", async() => { await bot.LeaveGroup((string)null); }); }
public async Task LeaveGroup_GroupIsNull_ThrowsException() { ILineBot bot = TestConfiguration.CreateBot(); await ExceptionAssert.ThrowsArgumentNullExceptionAsync("group", async() => { await bot.LeaveGroup((IGroup)null); }); }
public async Task ShouldCallsApiWithGroup() { TestHttpClient httpClient = TestHttpClient.Create(); ILineBot bot = TestConfiguration.CreateBot(httpClient); await bot.LeaveGroup(new TestGroup()); Assert.AreEqual("/group/testGroup/leave", httpClient.RequestPath); }
public async Task ShouldCallsApiWithGroupId() { TestHttpClient httpClient = TestHttpClient.Create(); ILineBot bot = TestConfiguration.CreateBot(httpClient); await bot.LeaveGroup("test"); Assert.AreEqual(HttpMethod.Post, httpClient.RequestMethod); Assert.AreEqual("/group/test/leave", httpClient.RequestPath); }
public async Task ThrowsExceptionWhenResponseIsError() { TestHttpClient httpClient = TestHttpClient.ThatReturnsAnError(); ILineBot bot = TestConfiguration.CreateBot(httpClient); await ExceptionAssert.ThrowsUnknownError(async() => { await bot.LeaveGroup("test"); }); }