package com.example.whatsmymood;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.location.Location;
import android.test.ActivityInstrumentationTestCase2;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by nathan on 21/02/17.
 */

public class MoodTest extends ActivityInstrumentationTestCase2 {

    public MoodTest() {
        super(MainActivity.class);
    }

    public void testGetMoodType() {
        Mood mood = new Mood("Nathan", "Happy");

        assertEquals(mood.getMoodType(), "Happy");

        Mood mood2 = new Mood("Nathan", "Happy");
        mood2.setMoodType("Sad");

        assertEquals(mood2.getMoodType(), "Sad");
    }

    public void testGetMoodAuthor() {
        Mood mood1 = new Mood("Nathan", "Happy");

        assertEquals(mood1.getMoodAuthor(), "Nathan");

        Mood mood2 = new Mood("Nathan", "Happy");
        mood2.setMoodAuthor("Eddy");

        assertEquals(mood2.getMoodAuthor(), "Eddy");

    }

    public void testGetMoodMessage() {
        Mood mood = new Mood("Nathan", "Happy");
        mood.setMoodMsg("Wow!");

        assertEquals(mood.getMoodMsg(), "Wow!");
    }

    public void testGetLocation() {
        Mood mood = new Mood("Nathan", "Happy");
        Location location = new Location("provider");
        location.setLatitude(100.0);
        location.setLongitude(50.0);
        mood.setLocation(location);

        assertEquals(mood.getLocation().getLatitude(), 100.0);
        assertEquals(mood.getLocation().getLongitude(), 50.0);
        try {
            Date date = new SimpleDateFormat("yyyy-MM-dd").parse("2011-01-08");
            Mood mood2 = new Mood("Nathan", "Happy", date
        }

        public void testGetSocialSit() {
            Mood mood = new Mood("Nathan", "Happy");
            mood.setSocialSit("With Eddy");

            assertEquals(mood.getSocialSit(), "With Eddy");
        }

        public void testGetDate() {
            Mood mood1 = new Mood("Nathan", "Happy");
            );

            mood1.setDate(date);

            assertEquals(mood1.getDate(), date);
            assertEquals(mood2.getDate(), date);
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }

    public void testGetPhoto() {
        Mood mood = new Mood("Nathan", "Happy");

        Bitmap bitmap = BitmapFactory.decodeResource(null, R.mipmap.ic_launcher);
        mood.setPhoto(bitmap);

        assertEquals(mood.getPhoto(), bitmap);
    }
}
@@ -1590,171 +1590,11 @@
     
-    try %7B%0A            Date date = new SimpleDateFormat(%22yyyy-MM-dd%22).parse(%222011-01-08%22);%0A            Mood mood2 = new Mood(%22Nathan%22, %22Happy%22, date%0A        %7D%0A%0A    
+%7D%0A%0A
     
@@ -1616,26 +1616,17 @@
 tGet
-SocialSit
+Date
 () %7B%0A
-    
     
@@ -1630,32 +1630,33 @@
        Mood mood
+1
  = new Mood(%22Nat
@@ -1683,151 +1683,93 @@
     
-   
- mood.setSocialSit(%22With Eddy%22);%0A%0A            assertEquals(mood.getSocialSit(), %22With E
+try %7B%0A            Date date = new SimpleDateFormat(%22yyyy-MM-
 dd
-y
 %22)
-;%0A        %7D%0A%0A        public void testGetDate() %7B
+.parse(%222011-01-08%22);
 %0A   
@@ -1778,33 +1778,33 @@
        Mood mood
-1
+2
  = new Mood(%22Nat
@@ -1820,27 +1820,17 @@
 ppy%22
-);%0A            
+, date
 );%0A
-%0A
     
@@ -2036,32 +2036,222 @@
        %7D%0A    %7D%0A%0A
+    public void testGetSocialSit() %7B%0A        Mood mood = new Mood(%22Nathan%22, %22Happy%22);%0A        mood.setSocialSit(%22With Eddy%22);%0A%0A        assertEquals(mood.getSocialSit(), %22With Eddy%22);%0A    %7D%0A%0A
     public void 

Fix MoodTest code