Skip to content

Commit 46352e9

Browse files
committed
Fix tests
1 parent efec5d9 commit 46352e9

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

library/src/main/java/com/pengrad/telegrambot/AttachName.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@ public static String next() {
1616
return "attach" + counter.incrementAndGet();
1717
}
1818

19+
public static void reset() {
20+
counter.set(0);
21+
}
22+
1923
}

library/src/test/java/com/pengrad/telegrambot/AttachNameTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public class AttachNameTest {
1212

1313
@Test
1414
public void next() {
15+
AttachName.reset();
1516
assertEquals("attach1", AttachName.next());
1617
assertEquals("attach2", AttachName.next());
1718
assertEquals("attach3", AttachName.next());

library/src/test/java/com/pengrad/telegrambot/TelegramBotTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1967,4 +1967,16 @@ public void chatJoinRequest() {
19671967
assertFalse(response.isOk());
19681968
assertEquals("Bad Request: USER_ALREADY_PARTICIPANT", response.description());
19691969
}
1970+
1971+
@Test
1972+
public void banChatSenderChat() {
1973+
BaseResponse response = bot.execute(new BanChatSenderChat(channelName, memberBot).untilDate(123));
1974+
assertTrue(response.isOk());
1975+
}
1976+
1977+
@Test
1978+
public void unbanChatSenderChat() {
1979+
BaseResponse response = bot.execute(new UnbanChatSenderChat(channelName, memberBot));
1980+
assertTrue(response.isOk());
1981+
}
19701982
}

0 commit comments

Comments
 (0)