From cea16601835a1188d650b8bfc2f7184c44619f3e Mon Sep 17 00:00:00 2001 From: Valentin Spiroski Date: Fri, 9 Feb 2024 22:41:32 +0100 Subject: [PATCH] refactoring:testEmojiPickerButtonCount --- src/test/java/TestEmojiPicker.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/test/java/TestEmojiPicker.java b/src/test/java/TestEmojiPicker.java index 997f920..8179e87 100644 --- a/src/test/java/TestEmojiPicker.java +++ b/src/test/java/TestEmojiPicker.java @@ -19,16 +19,18 @@ public class TestEmojiPicker { assertNotNull(emojiPicker); } + //Test to verify the correct number of emoji buttons in the EmojiPicker @Test public void testEmojiPickerButtonCount() { - JTextField textField = new JTextField(); - - EmojiPicker emojiPicker = new EmojiPicker(textField); - - Component[] components = emojiPicker.getComponents(); - - assertEquals(12, components.length); - + // Arrange + JTextField textField = new JTextField(); + EmojiPicker emojiPicker = new EmojiPicker(textField); + + // Act + Component[] components = emojiPicker.getComponents(); + + // Assert + assertEquals(12, components.length); // 12 buttons for 12 emojis }