/**
 * The MIT License
 *
 * Copyright for portions of unirest-java are held by Kong Inc (c) 2013.
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package kong.unirest;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class HeadersTest {

    @Test
    public void canGetApacheHeaders() {
        Headers headers = new Headers();
        headers.add("foo","bar");

        Header h = headers.all().get(0);

        assertEquals("foo", h.getName());
        assertEquals("bar", h.getValue());
    }

    @Test
    public void dontBombOnNull(){
        Headers h = new Headers();
        h.add(null, "foo");

        assertEquals(0, h.size());
    }
}
@@ -1295,16 +1295,64 @@
 sTest %7B%0A
+    private String ls  = System.lineSeparator();
 %0A    @Te
@@ -1752,10 +1752,366 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void toStringOverride() %7B%0A        Headers h  = new Headers();%0A        h.add(%22a%22, %221%22);%0A        h.add(null, %222%22);%0A        h.add(%22c%22, () -%3E %223%22);%0A        h.add(%22d%22, (String) null);%0A%0A        String toString = h.toString();%0A        assertEquals(%22a: 1%22 + ls +%0A                %22c: 3%22 + ls +%0A                %22d: null%22 + ls, toString);%0A    %7D
 %0A%7D

add a test for the line seperator