Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
ConversationContextTest.java
1 package org.bukkit.conversations;
2 
3 import org.junit.Test;
4 import static org.junit.Assert.*;
5 
6 import java.util.HashMap;
7 import java.util.Map;
8 
9 /**
10  */
12  @Test
13  public void TestFromWhom() {
14  Conversable conversable = new FakeConversable();
15  ConversationContext context = new ConversationContext(null, conversable, new HashMap<Object, Object>());
16  assertEquals(conversable, context.getForWhom());
17  }
18 
19  @Test
20  public void TestPlugin() {
21  Conversable conversable = new FakeConversable();
22  ConversationContext context = new ConversationContext(null, conversable, new HashMap<Object, Object>());
23  assertEquals(null, context.getPlugin());
24  }
25 
26  @Test
27  public void TestSessionData() {
28  Conversable conversable = new FakeConversable();
29  Map session = new HashMap();
30  session.put("key", "value");
31  ConversationContext context = new ConversationContext(null, conversable, session);
32  assertEquals("value", context.getSessionData("key"));
33  }
34 }