Skip to content
Closed
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package com.iluwatar.templateview;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;


class TemplateViewRobotTest {

private TemplateViewRobot robot;

@BeforeEach
void setUp() {
robot = new TemplateViewRobot();
}

@Test
void shouldRenderHomePageCorrectly() {

TemplateView homePage = new HomePageView();

robot.render(homePage)
.verifyContent("Rendering header...")
.verifyContent("Rendering HomePage dynamic content...")
.verifyContent("Rendering footer...");
}

@Test
void shouldRenderContactPageCorrectly() {

TemplateView contactPage = new ContactPageView();

robot.render(contactPage)
.verifyContent("Rendering header...")
.verifyContent("Rendering ContactPage dynamic content...")
.verifyContent("Rendering footer...");
}

@Test
void shouldResetCapturedOutput() {
TemplateView homePage = new HomePageView();

robot.render(homePage)
.verifyContent("Rendering HomePage dynamic content...")
.reset()
.render(new ContactPageView())
.verifyContent("Rendering ContactPage dynamic content...");
}
}
Loading