forked from github/copilot-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAgentInfoTest.java
More file actions
64 lines (52 loc) · 1.95 KB
/
AgentInfoTest.java
File metadata and controls
64 lines (52 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------------------------------------------*/
package com.github.copilot.sdk;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
import com.github.copilot.sdk.json.AgentInfo;
/**
* Unit tests for {@link AgentInfo} getters, setters, and fluent chaining.
*/
class AgentInfoTest {
@Test
void defaultValuesAreNull() {
var agent = new AgentInfo();
assertNull(agent.getName());
assertNull(agent.getDisplayName());
assertNull(agent.getDescription());
}
@Test
void nameGetterSetter() {
var agent = new AgentInfo();
agent.setName("coder");
assertEquals("coder", agent.getName());
}
@Test
void displayNameGetterSetter() {
var agent = new AgentInfo();
agent.setDisplayName("Code Assistant");
assertEquals("Code Assistant", agent.getDisplayName());
}
@Test
void descriptionGetterSetter() {
var agent = new AgentInfo();
agent.setDescription("Helps with coding tasks");
assertEquals("Helps with coding tasks", agent.getDescription());
}
@Test
void fluentChainingReturnsThis() {
var agent = new AgentInfo().setName("coder").setDisplayName("Code Assistant")
.setDescription("Helps with coding tasks");
assertEquals("coder", agent.getName());
assertEquals("Code Assistant", agent.getDisplayName());
assertEquals("Helps with coding tasks", agent.getDescription());
}
@Test
void fluentChainingReturnsSameInstance() {
var agent = new AgentInfo();
assertSame(agent, agent.setName("test"));
assertSame(agent, agent.setDisplayName("Test"));
assertSame(agent, agent.setDescription("A test agent"));
}
}