Skip to content

Commit ea071c8

Browse files
Fix newline/whitespace issues
1 parent 4970685 commit ea071c8

File tree

4 files changed

+62
-62
lines changed

4 files changed

+62
-62
lines changed

Diff for: src/React.Core/IReactSiteConfiguration.cs

+10-10
Original file line numberDiff line numberDiff line change
@@ -178,20 +178,20 @@ public interface IReactSiteConfiguration
178178
/// <summary>
179179
/// Disables server-side rendering. This is useful when debugging your scripts.
180180
/// </summary>
181-
IReactSiteConfiguration DisableServerSideRendering();
182-
181+
IReactSiteConfiguration DisableServerSideRendering();
182+
183183
/// <summary>
184184
/// An exception handler which will be called if a render exception is thrown.
185185
/// If unset, unhandled exceptions will be thrown for all component renders.
186186
/// </summary>
187-
Action<Exception> ExceptionHandler { get; set; }
188-
189-
/// <summary>
190-
/// Sets an exception handler which will be called if a render exception is thrown.
191-
/// If unset, unhandled exceptions will be thrown for all component renders.
192-
/// </summary>
193-
/// <param name="handler"></param>
194-
/// <returns></returns>
187+
Action<Exception> ExceptionHandler { get; set; }
188+
189+
/// <summary>
190+
/// Sets an exception handler which will be called if a render exception is thrown.
191+
/// If unset, unhandled exceptions will be thrown for all component renders.
192+
/// </summary>
193+
/// <param name="handler"></param>
194+
/// <returns></returns>
195195
IReactSiteConfiguration SetExceptionHandler(Action<Exception> handler);
196196
}
197197
}

Diff for: src/React.Core/ReactSiteConfiguration.cs

+9-9
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
* of patent rights can be found in the PATENTS file in the same directory.
88
*/
99

10-
using Newtonsoft.Json;
10+
using System;
1111
using System.Collections.Generic;
1212
using System.Linq;
13-
using System;
13+
using Newtonsoft.Json;
1414

1515
namespace React
1616
{
@@ -306,13 +306,13 @@ public IReactSiteConfiguration DisableServerSideRendering()
306306
/// Handle an exception caught during server-render of a component.
307307
/// If unset, unhandled exceptions will be thrown for all component renders.
308308
/// </summary>
309-
public Action<Exception> ExceptionHandler { get; set; }
310-
311-
/// <summary>
312-
///
313-
/// </summary>
314-
/// <param name="handler"></param>
315-
/// <returns></returns>
309+
public Action<Exception> ExceptionHandler { get; set; }
310+
311+
/// <summary>
312+
///
313+
/// </summary>
314+
/// <param name="handler"></param>
315+
/// <returns></returns>
316316
public IReactSiteConfiguration SetExceptionHandler(Action<Exception> handler)
317317
{
318318
ExceptionHandler = handler;

Diff for: src/React.Sample.CoreMvc/Startup.cs

+8-8
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ namespace React.Sample.CoreMvc
2121
public class Startup
2222
{
2323
public Startup(IHostingEnvironment env, ILogger<Startup> logger)
24-
{
25-
// Setup configuration sources.
24+
{
25+
// Setup configuration sources.
2626
var builder = new ConfigurationBuilder().AddEnvironmentVariables();
2727
Logger = logger;
2828
Configuration = builder.Build();
2929
}
3030

31-
public IConfiguration Configuration { get; set; }
31+
public IConfiguration Configuration { get; set; }
3232
public ILogger<Startup> Logger { get; set; }
3333

3434
// This method gets called by the runtime.
@@ -70,12 +70,12 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
7070
{
7171
config
7272
.SetReuseJavaScriptEngines(true)
73-
.AddScript("~/js/Sample.jsx")
74-
.SetExceptionHandler(ex =>
75-
{
76-
Logger.LogError("React component exception thrown!" + ex.ToString());
73+
.AddScript("~/js/Sample.jsx")
74+
.SetExceptionHandler(ex =>
75+
{
76+
Logger.LogError("React component exception thrown!" + ex.ToString());
7777
})
78-
.SetUseDebugReact(true);
78+
.SetUseDebugReact(true);
7979
});
8080

8181
// Add static files to the request pipeline.

Diff for: tests/React.Tests/Core/ReactComponentTest.cs

+35-35
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
* This source code is licensed under the BSD-style license found in the
66
* LICENSE file in the root directory of this source tree. An additional grant
77
* of patent rights can be found in the PATENTS file in the same directory.
8-
*/
9-
10-
using System;
11-
using JavaScriptEngineSwitcher.Core;
8+
*/
9+
10+
using System;
11+
using JavaScriptEngineSwitcher.Core;
1212
using Moq;
1313
using React.Exceptions;
1414
using Xunit;
15-
15+
1616
namespace React.Tests.Core
1717
{
1818
public class ReactComponentTest
@@ -162,7 +162,7 @@ public void RenderJavaScriptShouldCallRenderComponent()
162162
);
163163
}
164164

165-
[Theory]
165+
[Theory]
166166
[InlineData("Foo", true)]
167167
[InlineData("Foo.Bar", true)]
168168
[InlineData("Foo.Bar.Baz", true)]
@@ -192,43 +192,43 @@ public void GeneratesContainerIdIfNotProvided()
192192

193193
var component = new ReactComponent(environment.Object, config.Object, "Foo", null);
194194
Assert.StartsWith("react_", component.ContainerId);
195-
}
196-
197-
[Fact]
198-
public void ExceptionThrownIsHandled()
199-
{
195+
}
196+
197+
[Fact]
198+
public void ExceptionThrownIsHandled()
199+
{
200200
var environment = new Mock<IReactEnvironment>();
201201
environment.Setup(x => x.Execute<bool>("typeof Foo !== 'undefined'")).Returns(true);
202202
environment.Setup(x => x.Execute<string>(@"ReactDOMServer.renderToString(React.createElement(Foo, {""hello"":""World""}))"))
203-
.Throws(new JsRuntimeException("'undefined' is not an object"));
204-
205-
var config = new Mock<IReactSiteConfiguration>();
203+
.Throws(new JsRuntimeException("'undefined' is not an object"));
204+
205+
var config = new Mock<IReactSiteConfiguration>();
206206
config.Setup(x => x.UseServerSideRendering).Returns(true);
207207

208208
var component = new ReactComponent(environment.Object, config.Object, "Foo", "container")
209209
{
210210
Props = new { hello = "World" }
211-
};
212-
213-
// Default behavior
214-
bool exceptionCaught = false;
215-
try
216-
{
217-
component.RenderHtml();
218-
}
219-
catch (ReactServerRenderingException)
220-
{
221-
exceptionCaught = true;
222-
}
223-
224-
Assert.True(exceptionCaught);
225-
226-
// Custom exception handler set
227-
Exception caughtException = null;
228-
config.Setup(x => x.ExceptionHandler).Returns(ex => caughtException = ex);
229-
230-
var result = component.RenderHtml();
231-
Assert.Equal(@"<div id=""container""></div>", result);
211+
};
212+
213+
// Default behavior
214+
bool exceptionCaught = false;
215+
try
216+
{
217+
component.RenderHtml();
218+
}
219+
catch (ReactServerRenderingException)
220+
{
221+
exceptionCaught = true;
222+
}
223+
224+
Assert.True(exceptionCaught);
225+
226+
// Custom exception handler set
227+
Exception caughtException = null;
228+
config.Setup(x => x.ExceptionHandler).Returns(ex => caughtException = ex);
229+
230+
var result = component.RenderHtml();
231+
Assert.Equal(@"<div id=""container""></div>", result);
232232
Assert.NotNull(caughtException);
233233
}
234234
}

0 commit comments

Comments
 (0)