public async Task LeaveRoom_RoomIsEmpty_ThrowsException()
 {
     ILineBot bot = TestConfiguration.CreateBot();
     await ExceptionAssert.ThrowsArgumentEmptyExceptionAsync("roomId", async() =>
     {
         await bot.LeaveRoom(string.Empty);
     });
 }
 public async Task LeaveRoom_RoomIdIsNull_ThrowsException()
 {
     ILineBot bot = TestConfiguration.CreateBot();
     await ExceptionAssert.ThrowsArgumentNullExceptionAsync("roomId", async() =>
     {
         await bot.LeaveRoom((string)null);
     });
 }
 public async Task ThrowsExceptionWhenRoomsNull()
 {
     ILineBot bot = TestConfiguration.CreateBot();
     await ExceptionAssert.ThrowsArgumentNullExceptionAsync("room", async() =>
     {
         await bot.LeaveRoom((IRoom)null);
     });
 }
        public async Task LeaveRoom_WithRoom_CallsApi()
        {
            TestHttpClient httpClient = TestHttpClient.Create();

            ILineBot bot = TestConfiguration.CreateBot(httpClient);
            await bot.LeaveRoom(new TestRoom());

            Assert.AreEqual("/room/testRoom/leave", httpClient.RequestPath);
        }
        public async Task LeaveRoom_WithRoomId_CallsApi()
        {
            TestHttpClient httpClient = TestHttpClient.Create();

            ILineBot bot = TestConfiguration.CreateBot(httpClient);
            await bot.LeaveRoom("test");

            Assert.AreEqual(HttpMethod.Post, httpClient.RequestMethod);
            Assert.AreEqual("/room/test/leave", httpClient.RequestPath);
        }
        public async Task LeaveRoom_ErrorResponse_ThrowsException()
        {
            TestHttpClient httpClient = TestHttpClient.ThatReturnsAnError();

            ILineBot bot = TestConfiguration.CreateBot(httpClient);

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