Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[T4A6][W11-B2] Zhi Jiang #1667

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions src/seedu/addressbook/common/UtilsTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package seedu.addressbook.common;

import static org.junit.Assert.*;
import static seedu.addressbook.common.Messages.MESSAGE_INVALID_COMMAND_FORMAT;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;

import org.junit.Before;
import org.junit.Test;

import seedu.addressbook.commands.HelpCommand;
import seedu.addressbook.parser.Parser;

public class UtilsTest {

@Test
public void emptyInput_returnsCorrect() {
final Object obj = null;
assertTrue(Utils.isAnyNull(obj));
}

@Test
public void NonEmptyInput_returnsIncorrect() {
final Object obj = new Object();
assertFalse(Utils.isAnyNull(obj));
}

@Test
public void NonIdenticalInput_returnsCorrect() {
final ArrayList<Integer> lst = new ArrayList<Integer>(Arrays.asList(1,2,3,4,5));
assertTrue(Utils.elementsAreUnique(lst));
}

@Test
public void IdenticalInput_returnsIncorrect() {
final ArrayList<Integer> lst = new ArrayList<Integer>(Arrays.asList(1,1,3,4,5));
assertTrue(Utils.elementsAreUnique(lst));
}
}