package ch.epfl.sweng.project;

import org.junit.Assert;
import org.junit.Test;

import ch.epfl.sweng.project.Model.AuthenticatedUser;
import ch.epfl.sweng.project.Model.TestUser;
import ch.epfl.sweng.project.Model.User;

/**
 * Test suite for User classes
 */
public class UserTest {

    @Test
    public void instantiationAndGettersWorkForTestUser() {

        User testUser = new TestUser();

        testUser.loginStatus();
        testUser.logoutStatus();

        Assert.assertEquals("Test User", testUser.getId());
        Assert.assertEquals("Test User", testUser.getEmail());
        Assert.assertEquals("Test User", testUser.getFamilyName());
        Assert.assertEquals("Test User", testUser.getName());
        Assert.assertEquals("", testUser.getPhotoUrl());
        Assert.assertEquals("6VauzC82b6YoNfRSo2ft4WFqoCu1", testUser.getFirebaseId());
        Assert.assertTrue(testUser.isLoggedIn());

    }

    @Test(expected = IllegalArgumentException.class)
    public void authUserWithNullAccountThrowsException() {
        new AuthenticatedUser(null);
    }
}

@@ -21,24 +21,174 @@
 g.project;%0A%0A
+import android.net.Uri;%0Aimport android.os.Parcel;%0A%0Aimport com.google.android.gms.auth.api.signin.GoogleSignInAccount;%0A%0Aimport org.json.JSONException;%0A
 import org.j
@@ -220,24 +220,48 @@
 unit.Test;%0A%0A
+import java.util.List;%0A%0A
 import ch.ep
@@ -1239,11 +1239,473 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void gettersWorkForAuthUser() %7B%0A%0A        try %7B%0A            GoogleSignInAccount googleUser = GoogleSignInAccount.zzfw(%22 %22);%0A            User testUser = new AuthenticatedUser(googleUser);%0A            testUser.getId();%0A            testUser.getEmail();%0A            testUser.getFamilyName();%0A            testUser.getName();%0A            testUser.getPhotoUrl();%0A        %7D catch (JSONException e) %7B%0A            e.printStackTrace();%0A        %7D%0A    %7D
 %0A%7D%0A

Add tests for authenticatedUser