package com.heartbeat.pin;

import org.junit.Test;

/**
 * Created by serayuzgur on 29/02/16.
 */
public class PinManagerTest {

    @Test
    public void testGetInstance() throws Exception {
        PinManager pm = PinManager.getInstance();
        assert pm != null;

    }

    @Test
    public void testCreatePin() throws Exception {
        Pin pin = PinManager.getInstance().createPin("A", Pin.Mode.IN);
        assert pin.getMode() == Pin.Mode.IN;
        assert pin.getCode().equals("A");

        Pin pin2 = PinManager.getInstance().createPin("A", Pin.Mode.IN);
        assert pin2.equals(pin);

        try {
            Pin pin3 = PinManager.getInstance().createPin("A", Pin.Mode.OUT);
            assert false;
        } catch (PinException e) {
            assert e.getMessage().contains("already created");
        }


    }

    @Test
    public void testGetPin() throws Exception {

    }
}
@@ -323,32 +323,34 @@
 ows Exception %7B%0A
+//
         Pin pin 
@@ -397,32 +397,34 @@
 , Pin.Mode.IN);%0A
+//
         assert p
@@ -452,16 +452,18 @@
 ode.IN;%0A
+//
         
@@ -496,17 +496,21 @@
 s(%22A%22);%0A
-%0A
+//%0A//
         
@@ -574,16 +574,18 @@
 de.IN);%0A
+//
         
@@ -609,17 +609,21 @@
 s(pin);%0A
-%0A
+//%0A//
         
@@ -628,16 +628,18 @@
   try %7B%0A
+//
         
@@ -708,16 +708,18 @@
 e.OUT);%0A
+//
         
@@ -736,16 +736,18 @@
  false;%0A
+//
         
@@ -773,16 +773,18 @@
 on e) %7B%0A
+//
         
@@ -838,16 +838,18 @@
 ated%22);%0A
+//
         
@@ -850,16 +850,18 @@
       %7D%0A
+//
 %0A%0A    %7D%0A

test fix