package com.github.verhagen.textadventure.core.domain;

import static org.testng.Assert.assertEquals;

import org.testng.annotations.Test;

import com.github.verhagen.textadventure.core.impl.domain.Item;
import com.github.verhagen.textadventure.core.impl.domain.Room;
import com.github.verhagen.textadventure.core.impl.domain.TextVisitor;

public class TextVisitorTest {

	@Test
	public void visitEmptyHall() {
		String description = "There is a front door on the south and a door on the east.";
		IRoom hall = new Room("hall", description);
		
		TextVisitor visitor = new TextVisitor();
		hall.accept(visitor);
		
		assertEquals(visitor.asText(), description);
	}

	@Test
	public void visitHallWithABook() {
		String description = "There is a front door on the south and a door on the east.";
		String title = "TRS-80 Assembly-Language Programming";
		IRoom hall = new Room("hall", description);
		IItem book = new Item("book", title);
		hall.add(book);

		TextVisitor visitor = new TextVisitor();
		hall.accept(visitor);
		
		assertEquals(visitor.asText(), description + "Items: " + book.getName());
	}

}

@@ -535,18 +535,16 @@
 ption);%0A
-%09%09
 %0A%09%09TextV
@@ -595,34 +595,32 @@
 ccept(visitor);%0A
-%09%09
 %0A%09%09assertEquals(
@@ -628,32 +628,56 @@
 isitor.asText(),
+ %22You are in a hall. %22 +
  description);%0A%09
@@ -1036,18 +1036,16 @@
 sitor);%0A
-%09%09
 %0A%09%09asser
@@ -1069,16 +1069,40 @@
 sText(),
+ %22You are in a hall. %22 +
  descrip
@@ -1109,16 +1109,17 @@
 tion + %22
+ 
 Items: %22

Update test cases asserts, to update TextVisitor creating better description