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

                ILineBot bot = TestConfiguration.CreateBot(httpClient);

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