package com.pollistics.models;

import org.junit.Test;

import java.util.HashMap;

import static org.assertj.core.api.Assertions.assertThat;

public class PollTest {

	@Test
	public void membersTest() {
		HashMap<String, Integer> options = new HashMap<>();
		options.put("Blauw", 1);
		Poll p = new Poll("Kleuren", options);
		assertThat(p.getName().equals("Kleuren"));
		p.setName("andere naam");
		assertThat(p.getName().equals("andere naam"));
		assertThat(p.getOptions().keySet().contains("Blauw"));
		assertThat(p.getOptions().entrySet().contains(1));
	}
}

@@ -552,11 +552,379 @@
 (1));%0A%09%7D
+%0A%0A%09@Test%0A%09public void userTest() %7B%0A%09%09HashMap%3CString, Integer%3E options = new HashMap%3C%3E();%0A%09%09options.put(%22Blauw%22, 1);%0A%09%09User user = new User(%22someone%22, %22somepass%22);%0A%09%09Poll p = new Poll(%22Kleuren%22, options, user);%0A%09%09assertThat(p.getUser().equals(user));%0A%09%09User newUser = new User(%22other person%22, %22pass%22);%0A%09%09p.setUser(newUser);%0A%09%09assertThat(p.getUser().equals(newUser));%0A%09%7D
 %0A%7D%0A

test poll belonging to a user