@@ -59,7 +59,7 @@ public void ReactWithInitShouldReturnHtmlAndScript()
5959 public void ReactWithClientOnlyTrueShouldCallRenderHtmlWithTrue ( )
6060 {
6161 var component = new Mock < IReactComponent > ( ) ;
62- component . Setup ( x => x . RenderHtml ( true , false ) ) . Returns ( "HTML" ) ;
62+ component . Setup ( x => x . RenderHtml ( true , true ) ) . Returns ( "HTML" ) ;
6363 var environment = ConfigureMockEnvironment ( ) ;
6464 environment . Setup ( x => x . CreateComponent (
6565 "ComponentName" ,
@@ -73,9 +73,31 @@ public void ReactWithClientOnlyTrueShouldCallRenderHtmlWithTrue()
7373 props : new { } ,
7474 htmlTag : "span" ,
7575 clientOnly : true ,
76- renderReactAttributes : false
76+ renderReactAttributes : true
7777 ) ;
78- component . Verify ( x => x . RenderHtml ( It . Is < bool > ( y => y == true ) , It . Is < bool > ( z => z == false ) ) , Times . Once ) ;
78+ component . Verify ( x => x . RenderHtml ( It . Is < bool > ( y => y == true ) , It . Is < bool > ( z => z == true ) ) , Times . Once ) ;
7979 }
80+
81+ [ Test ]
82+ public void ReactWithRenderReactAttributesfalseShouldCallRenderHtmlWithfalse ( ) {
83+ var component = new Mock < IReactComponent > ( ) ;
84+ component . Setup ( x => x . RenderHtml ( true , false ) ) . Returns ( "HTML" ) ;
85+ var environment = ConfigureMockEnvironment ( ) ;
86+ environment . Setup ( x => x . CreateComponent (
87+ "ComponentName" ,
88+ new { } ,
89+ null
90+ ) ) . Returns ( component . Object ) ;
91+
92+ var result = HtmlHelperExtensions . React (
93+ htmlHelper : null ,
94+ componentName : "ComponentName" ,
95+ props : new { } ,
96+ htmlTag : "span" ,
97+ clientOnly : true ,
98+ renderReactAttributes : false
99+ ) ;
100+ component . Verify ( x => x . RenderHtml ( It . Is < bool > ( y => y == true ) , It . Is < bool > ( z => z == false ) ) , Times . Once ) ;
101+ }
80102 }
81103}
0 commit comments