Package com.gophers.services.testCases
Class ChatBotGeneratorTest
java.lang.Object
com.gophers.services.testCases.ChatBotGeneratorTest
Unit tests for the `ChatBotGenerator` class, focusing on verifying that the
`generateChatBotLLM` method is correctly implemented and returns expected
results
based on various input codes. Tests check method statics, expected return
values,
and handling of invalid input codes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetUp()Initializes the `generator` reference to the `ChatBotGenerator` class before each test.voidtearDown()Cleans up the `generator` reference by setting it to null after each test.voidTests that `generateChatBotLLM` returns "Bard" for input code 3.voidTests that `generateChatBotLLM` returns "ChatGPT-3.5" for invalid codes.voidTests that `generateChatBotLLM` returns "Claude" for input code 4.voidTests that `generateChatBotLLM` returns "LLaMa" for input code 1.voidTests that `generateChatBotLLM` returns "Mistral7B" for input code 2.voidTests that `generateChatBotLLM` returns "Solar" for input code 5.voidTests if the `generateChatBotLLM` method is static and successfully returns a non-null result when invoked with a valid input.
-
Constructor Details
-
ChatBotGeneratorTest
public ChatBotGeneratorTest()
-
-
Method Details
-
setUp
public void setUp()Initializes the `generator` reference to the `ChatBotGenerator` class before each test. -
tearDown
public void tearDown()Cleans up the `generator` reference by setting it to null after each test. -
testMethodIsStatic_generateChatBotLLM
public void testMethodIsStatic_generateChatBotLLM()Tests if the `generateChatBotLLM` method is static and successfully returns a non-null result when invoked with a valid input. Fails if the method is not found or if invocation fails. -
testGenerateChatBotLLM_ReturnsLLaMaForCode1
public void testGenerateChatBotLLM_ReturnsLLaMaForCode1()Tests that `generateChatBotLLM` returns "LLaMa" for input code 1. -
testGenerateChatBotLLM_ReturnsMistral7BForCode2
public void testGenerateChatBotLLM_ReturnsMistral7BForCode2()Tests that `generateChatBotLLM` returns "Mistral7B" for input code 2. -
testGenerateChatBotLLM_ReturnsBardForCode3
public void testGenerateChatBotLLM_ReturnsBardForCode3()Tests that `generateChatBotLLM` returns "Bard" for input code 3. -
testGenerateChatBotLLM_ReturnsClaudeForCode4
public void testGenerateChatBotLLM_ReturnsClaudeForCode4()Tests that `generateChatBotLLM` returns "Claude" for input code 4. -
testGenerateChatBotLLM_ReturnsSolarForCode5
public void testGenerateChatBotLLM_ReturnsSolarForCode5()Tests that `generateChatBotLLM` returns "Solar" for input code 5. -
testGenerateChatBotLLM_ReturnsChatGPT35ForInvalidCodes
public void testGenerateChatBotLLM_ReturnsChatGPT35ForInvalidCodes()Tests that `generateChatBotLLM` returns "ChatGPT-3.5" for invalid codes. Codes tested include 0, values outside the defined range, and boundary values.
-