package com.hamishrickerby.http_server;

import junit.framework.TestCase;

/**
 * Created by rickerbh on 15/08/2016.
 */
public class AppArgumentsTest extends TestCase {
    public void testEmptyArgumentsAre0Long() {
        String[] inputArgs = new String[0];
        AppArguments args = new AppArguments(inputArgs);
        assertEquals(0, args.size());
    }

    public void testArgumentsParseCorrectly() {
        String[] inputArgs = {"-p", "3000", "-d", "hello"};
        AppArguments args = new AppArguments(inputArgs);
        assertEquals("3000", args.get("-p"));
        assertEquals("hello", args.get("-d"));
    }

    public void testIncompleteArgumentsFailToGetRead() {
        String[] inputArgs = {"-p", "3000", "-d"};
        AppArguments args = new AppArguments(inputArgs);
        assertEquals("3000", args.get("-p"));
        assertNull(args.get("-d"));
    }

    public void testNotPresentArgumentReturnsNull() {
        String[] inputArgs = {"-p", "3000"};
        AppArguments args = new AppArguments(inputArgs);
        assertEquals("3000", args.get("-p"));
        assertNull(args.get("-d"));
    }
}

@@ -188,16 +188,33 @@
 estEmpty
+InputReturnsValid
 Argument
@@ -218,16 +218,8 @@
 ents
-Are0Long
 () %7B
@@ -398,22 +398,20 @@
 ents
-ParseCorrectly
+AreRetrieved
 () %7B
@@ -659,16 +659,29 @@
 ompleteA
+ndNotPresentA
 rguments
@@ -896,244 +896,46 @@
     
-%7D%0A%0A
     
-public void testNotPresentArgumentReturnsNull() %7B%0A        String%5B%5D inputArgs = %7B%22-p%22, %223000%22%7D;%0A        AppArguments args = new AppArguments(inputArgs);%0A        assertEquals(%223000%22, args.get(%22-p%22));%0A        assertNull(args.get(%22-d
+assertNull(args.get(%22i-don't-exist
 %22));
@@ -941,10 +941,11 @@
 ;%0A    %7D%0A
+%0A
 %7D%0A

Rename and refactor argument tests