SignoutRule testé
This commit is contained in:
parent
2c0d56b304
commit
d3361a7679
@ -31,7 +31,7 @@ public abstract class ProtocolWriter {
|
|||||||
public String execute(String... datas) {
|
public String execute(String... datas) {
|
||||||
// Concatatène le nom de la commande avec les données (trim), avec un espace entre chaque
|
// Concatatène le nom de la commande avec les données (trim), avec un espace entre chaque
|
||||||
String command = null;
|
String command = null;
|
||||||
StringJoiner builder = new StringJoiner(" ", this.cmdName, "");
|
StringJoiner builder = new StringJoiner(" ", this.cmdName, "\r\n");
|
||||||
|
|
||||||
for (String data : datas)
|
for (String data : datas)
|
||||||
builder.add(data);
|
builder.add(data);
|
||||||
|
@ -1,7 +1,21 @@
|
|||||||
package lightcontainer.protocol.rules.writer;
|
package lightcontainer.protocol.rules.writer;
|
||||||
|
|
||||||
|
import lightcontainer.protocol.ProtocolWriter;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
class SignoutRuleTest {
|
class SignoutRuleTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenRuleIsRightThenReturnCommand() {
|
||||||
|
//GIVEN
|
||||||
|
ProtocolWriter protocolWriter = new SignoutRule();
|
||||||
|
String[] datas = {};
|
||||||
|
|
||||||
|
//EXPECT
|
||||||
|
assertNotNull(protocolWriter.execute(datas));
|
||||||
|
assertEquals("SIGNOUT\r\n", protocolWriter.execute(datas));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user