package com.onlythenaive.concept.ecmarunner.internal;

import java.util.Arrays;
import java.util.List;

import org.junit.BeforeClass;
import org.junit.Test;

import com.onlythenaive.concept.ecmarunner.ExecutionInvoice;
import com.onlythenaive.concept.ecmarunner.ExecutionTerminationType;

public class ExecutionResultImplTest {

    private ExecutionInvoice invoice;
    private List<String> outputs;
    private ExecutionTerminationType terminationType;

    @BeforeClass
    public void beforeClass() {
        invoice = null;
        outputs = Arrays.asList("", "", "");
        terminationType = ExecutionTerminationType.SUCCESS;
    }

    @Test
    public void createNewResult() {
        new ExecutionResultImpl(
                invoice,
                outputs,
                terminationType
        );
    }

    @Test(expected = NullPointerException.class)
    public void failOnNullInvoice() {
        new ExecutionResultImpl(
                null,
                outputs,
                terminationType
        );
    }

    @Test(expected = NullPointerException.class)
    public void failOnNullOutputs() {
        new ExecutionResultImpl(
                invoice,
                null,
                terminationType
        );
    }

    @Test(expected = NullPointerException.class)
    public void failOnNullType() {
        new ExecutionResultImpl(
                invoice,
                outputs,
                null
        );
    }
}

@@ -124,15 +124,10 @@
 fore
-Class
 ;%0A
+
 impo
@@ -275,16 +275,74 @@
 ionType;
+%0Aimport com.onlythenaive.concept.ecmarunner.ServiceFacade;
 %0A%0Apublic
@@ -513,21 +513,16 @@
  @Before
-Class
 %0A    pub
@@ -564,20 +564,68 @@
 voice = 
-null
+ServiceFacade.invoiceBuilder().addScript(%22%22).build()
 ;%0A      

test fixed