Example #1
0
        public async Task Should_Throw_InvalidGameShortNameException_3()
        {
            InvalidGameShortNameException e = await Assert.ThrowsAsync <InvalidGameShortNameException>(() =>
                                                                                                       BotClient.SendGameAsync(
                                                                                                           chatId: _fixture.SupergroupChat.Id,
                                                                                                           gameShortName: "non_existing_game"
                                                                                                           )
                                                                                                       );

            Assert.Equal("game_short_name", e.Parameter);
        }
Example #2
0
        public async Task Should_Throw_InvalidGameShortNameException_When_GameShortName_Invalid_2()
        {
            InvalidGameShortNameException exception = await Assert.ThrowsAsync <InvalidGameShortNameException>(
                async() => await BotClient.SendGameAsync(
                    chatId: Fixture.SupergroupChat.Id,
                    gameShortName: string.Empty
                    )
                );

            Assert.Equal(400, exception.ErrorCode);
            Assert.Contains("game_short_name", exception.Message);
        }
Example #3
0
        public async Task Should_Throw_InvalidGameShortNameException_When_GameShortName_Invalid_3()
        {
            InvalidGameShortNameException exception = await Assert.ThrowsAsync <InvalidGameShortNameException>(
                async() => await BotClient.SendGameAsync(
                    chatId: Fixture.SupergroupChat.Id,
                    gameShortName: "non_existing_game"
                    )
                );

            Assert.Equal(400, exception.ErrorCode);
            Assert.Contains("wrong game short name specified", exception.Message);
        }
Example #4
0
        public async Task Should_Throw_InvalidGameShortNameException_When_GameShortName_Invalid()
        {
            InvalidGameShortNameException exception = await Assert.ThrowsAsync <InvalidGameShortNameException>(
                async() => await BotClient.SendGameAsync(
                    chatId: Fixture.SupergroupChat.Id,
                    gameShortName: "my game"
                    )
                );

            Assert.Equal(400, exception.ErrorCode);
            Assert.Contains("GAME_SHORTNAME_INVALID", exception.Message);
        }
        public async Task Should_Throw_InvalidGameShortNameException_2()
        {
            await _fixture.SendTestCaseNotificationAsync(FactTitles.ShouldThrowInvalidGameShortNameException2);

            InvalidGameShortNameException e = await Assert.ThrowsAsync <InvalidGameShortNameException>(() =>
                                                                                                       BotClient.SendGameAsync(
                                                                                                           chatId: _fixture.SupergroupChat.Id,
                                                                                                           gameShortName: string.Empty
                                                                                                           )
                                                                                                       );

            Assert.Equal("game_short_name", e.Parameter);
        }