package com.sleekbyte.tailor.output;

import com.sleekbyte.tailor.common.Messages;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;

import java.io.IOException;

import static junit.framework.TestCase.assertFalse;
import static org.junit.Assert.assertTrue;

/**
 * Tests for {@link ViolationMessage}
 */
@RunWith(MockitoJUnitRunner.class)

public class ViolationMessageTest {

    @Before
    public void setUp() throws IOException {

    }

    @After
    public void tearDown() { }

    @Test
    public void testCompareTo() throws Exception { }

    @Test
    public void testEquals() throws Exception {
        ViolationMessage violationMessageOne = new ViolationMessage("/usr/bin/local", 10, 1, Messages.ERROR, "errMsg");

        // Equal ViolationMessage
        ViolationMessage unequalViolationMessage = new ViolationMessage("/usr/bin/local", 12, 5, Messages.ERROR, "errMsg");
        assertFalse(violationMessageOne.equals(unequalViolationMessage));

        // Unequal ViolationMessage
        ViolationMessage equalViolationMessage = new ViolationMessage("/usr/bin/local", 10, 1, Messages.ERROR, "errMsg");
        assertTrue(violationMessageOne.equals(equalViolationMessage));
    }

    @Test
    public void testToString() throws Exception {

    }
}

@@ -258,16 +258,67 @@
 ption;%0A%0A
+import static junit.framework.Assert.assertEquals;%0A
 import s
@@ -795,19 +795,16 @@
 nMessage
-One
  = new V
@@ -1058,35 +1058,32 @@
 violationMessage
-One
 .equals(unequalV
@@ -1299,11 +1299,8 @@
 sage
-One
 .equ
@@ -1391,21 +1391,275 @@
 Exception %7B%0A
+        ViolationMessage violationMessage = new ViolationMessage(%22/usr/bin/local%22, 10, 1, Messages.ERROR, %22errMsg%22);%0A        String expectedOutput = %22/usr/bin/local:10:1: error: errMsg%22;%0A%0A        assertEquals(expectedOutput, violationMessage.toString());
 %0A    %7D%0A%7D%0A

Implement testToString()