File tree 1 file changed +48
-0
lines changed
templateview/src/test/java/com/iluwatar/templateview
1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com .iluwatar .templateview ;
2
+
3
+ import org .junit .jupiter .api .BeforeEach ;
4
+ import org .junit .jupiter .api .Test ;
5
+
6
+
7
+ class TemplateViewRobotTest {
8
+
9
+ private TemplateViewRobot robot ;
10
+
11
+ @ BeforeEach
12
+ void setUp () {
13
+ robot = new TemplateViewRobot ();
14
+ }
15
+
16
+ @ Test
17
+ void shouldRenderHomePageCorrectly () {
18
+
19
+ TemplateView homePage = new HomePageView ();
20
+
21
+ robot .render (homePage )
22
+ .verifyContent ("Rendering header..." )
23
+ .verifyContent ("Rendering HomePage dynamic content..." )
24
+ .verifyContent ("Rendering footer..." );
25
+ }
26
+
27
+ @ Test
28
+ void shouldRenderContactPageCorrectly () {
29
+
30
+ TemplateView contactPage = new ContactPageView ();
31
+
32
+ robot .render (contactPage )
33
+ .verifyContent ("Rendering header..." )
34
+ .verifyContent ("Rendering ContactPage dynamic content..." )
35
+ .verifyContent ("Rendering footer..." );
36
+ }
37
+
38
+ @ Test
39
+ void shouldResetCapturedOutput () {
40
+ TemplateView homePage = new HomePageView ();
41
+
42
+ robot .render (homePage )
43
+ .verifyContent ("Rendering HomePage dynamic content..." )
44
+ .reset ()
45
+ .render (new ContactPageView ())
46
+ .verifyContent ("Rendering ContactPage dynamic content..." );
47
+ }
48
+ }
You can’t perform that action at this time.
0 commit comments