示例#1
0
 public async Task ThrowsExceptionWhenGroupIsEmpty()
 {
     ILineBot bot = TestConfiguration.CreateBot();
     await ExceptionAssert.ThrowsArgumentEmptyExceptionAsync("groupId", async() =>
     {
         await bot.LeaveGroup(string.Empty);
     });
 }
示例#2
0
 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);
     });
 }
示例#4
0
            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);
            }
示例#5
0
            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);
            }
示例#6
0
            public async Task ThrowsExceptionWhenResponseIsError()
            {
                TestHttpClient httpClient = TestHttpClient.ThatReturnsAnError();

                ILineBot bot = TestConfiguration.CreateBot(httpClient);

                await ExceptionAssert.ThrowsUnknownError(async() =>
                {
                    await bot.LeaveGroup("test");
                });
            }