--- /dev/null
+package net.pterodactylus.fcp;
+
+import org.junit.Test;
+
+import static net.pterodactylus.fcp.test.MessageTests.verifyFieldValueAfterSettingProperty;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.nullValue;
+
+public class TestDDAResponseTest {
+
+ @Test
+ public void testDDAResponseMessageWithTwoArgumentConstructorHasCorrectName() {
+ TestDDAResponse testDDAResponse = new TestDDAResponse("/some/directory", "foo");
+ assertThat(testDDAResponse.getName(), equalTo("TestDDAResponse"));
+ }
+
+ @Test
+ public void testDDAResponseMessageWithTwoArgumentConstructorSetsDirectoryField() {
+ TestDDAResponse testDDAResponse = new TestDDAResponse("/some/directory", "foo");
+ assertThat(testDDAResponse.getField("Directory"), equalTo("/some/directory"));
+ }
+
+ @Test
+ public void testDDAResponseMessageWithTwoArgumentConstructorSetsReadContentField() {
+ TestDDAResponse testDDAResponse = new TestDDAResponse("/some/directory", "foo");
+ assertThat(testDDAResponse.getField("ReadContent"), equalTo("foo"));
+ }
+
+ @Test
+ public void testDDAResponseMessageHasCorrectName() {
+ assertThat(testDDAResponse.getName(), equalTo("TestDDAResponse"));
+ }
+
+ @Test
+ public void testDDAResponseMessageSetsDirectoryField() {
+ assertThat(testDDAResponse.getField("Directory"), equalTo("/some/directory"));
+ }
+
+ @Test
+ public void testDDAResponseMessageHasNoReadContentField() {
+ assertThat(testDDAResponse.getField("ReadContent"), nullValue());
+ }
+
+ @Test
+ public void settingReadContentResultsInReadContentFieldBeingSet() {
+ verifyFieldValueAfterSettingProperty(testDDAResponse, TestDDAResponse::setReadContent, "ReadContent", "foo", equalTo("foo"));
+ }
+
+ private final TestDDAResponse testDDAResponse = new TestDDAResponse("/some/directory");
+
+}