@@ -21,7 +21,9 @@ public void RenderHtmlShouldThrowExceptionIfComponentDoesNotExist()
2121 {
2222 var environment = new Mock < IReactEnvironment > ( ) ;
2323 environment . Setup ( x => x . Execute < bool > ( "typeof Foo !== 'undefined'" ) ) . Returns ( false ) ;
24- var component = new ReactComponent ( environment . Object , null , "Foo" , "container" ) ;
24+ var config = new Mock < IReactSiteConfiguration > ( ) ;
25+ config . Setup ( x => x . UseServerSideRendering ) . Returns ( true ) ;
26+ var component = new ReactComponent ( environment . Object , config . Object , "Foo" , "container" ) ;
2527
2628 Assert . Throws < ReactInvalidComponentException > ( ( ) =>
2729 {
@@ -35,6 +37,7 @@ public void RenderHtmlShouldCallRenderComponent()
3537 var environment = new Mock < IReactEnvironment > ( ) ;
3638 environment . Setup ( x => x . Execute < bool > ( "typeof Foo !== 'undefined'" ) ) . Returns ( true ) ;
3739 var config = new Mock < IReactSiteConfiguration > ( ) ;
40+ config . Setup ( x => x . UseServerSideRendering ) . Returns ( true ) ;
3841
3942 var component = new ReactComponent ( environment . Object , config . Object , "Foo" , "container" )
4043 {
@@ -53,6 +56,7 @@ public void RenderHtmlShouldWrapComponentInDiv()
5356 environment . Setup ( x => x . Execute < string > ( @"ReactDOMServer.renderToString(React.createElement(Foo, {""hello"":""World""}))" ) )
5457 . Returns ( "[HTML]" ) ;
5558 var config = new Mock < IReactSiteConfiguration > ( ) ;
59+ config . Setup ( x => x . UseServerSideRendering ) . Returns ( true ) ;
5660
5761 var component = new ReactComponent ( environment . Object , config . Object , "Foo" , "container" )
5862 {
@@ -88,6 +92,7 @@ public void RenderHtmlShouldNotRenderClientSideAttributes()
8892 var environment = new Mock < IReactEnvironment > ( ) ;
8993 environment . Setup ( x => x . Execute < bool > ( "typeof Foo !== 'undefined'" ) ) . Returns ( true ) ;
9094 var config = new Mock < IReactSiteConfiguration > ( ) ;
95+ config . Setup ( x => x . UseServerSideRendering ) . Returns ( true ) ;
9196
9297 var component = new ReactComponent ( environment . Object , config . Object , "Foo" , "container" )
9398 {
@@ -102,6 +107,7 @@ public void RenderHtmlShouldNotRenderClientSideAttributes()
102107 public void RenderHtmlShouldWrapComponentInCustomElement ( )
103108 {
104109 var config = new Mock < IReactSiteConfiguration > ( ) ;
110+ config . Setup ( x => x . UseServerSideRendering ) . Returns ( true ) ;
105111 var environment = new Mock < IReactEnvironment > ( ) ;
106112 environment . Setup ( x => x . Execute < bool > ( "typeof Foo !== 'undefined'" ) ) . Returns ( true ) ;
107113 environment . Setup ( x => x . Execute < string > ( @"ReactDOMServer.renderToString(React.createElement(Foo, {""hello"":""World""}))" ) )
@@ -121,6 +127,7 @@ public void RenderHtmlShouldWrapComponentInCustomElement()
121127 public void RenderHtmlShouldAddClassToElement ( )
122128 {
123129 var config = new Mock < IReactSiteConfiguration > ( ) ;
130+ config . Setup ( x => x . UseServerSideRendering ) . Returns ( true ) ;
124131 var environment = new Mock < IReactEnvironment > ( ) ;
125132 environment . Setup ( x => x . Execute < bool > ( "typeof Foo !== 'undefined'" ) ) . Returns ( true ) ;
126133 environment . Setup ( x => x . Execute < string > ( @"ReactDOMServer.renderToString(React.createElement(Foo, {""hello"":""World""}))" ) )
0 commit comments