Skip to content

Commit 8907811

Browse files
committed
[r] file-scoped namespaces
1 parent 4f67cc5 commit 8907811

File tree

252 files changed

+11105
-11344
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+11105
-11344
lines changed
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
using Simplify.Web.Attributes;
22
using Simplify.Web.Responses;
33

4-
namespace Simplify.Web.Examples.Katana.Controllers
4+
namespace Simplify.Web.Examples.Katana.Controllers;
5+
6+
[Get("/")]
7+
public class DefaultController : Controller
58
{
6-
[Get("/")]
7-
public class DefaultController : Controller
9+
public override ControllerResponse Invoke()
810
{
9-
public override ControllerResponse Invoke()
10-
{
11-
return new Tpl("Hello from OWIN IIS-hosted application!");
12-
}
11+
return new Tpl("Hello from OWIN IIS-hosted application!");
1312
}
1413
}

src/Examples/Simplify.Web.Examples.Katana/Simplify.Web.Examples.Katana.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>net462</TargetFrameworks>
4+
<LangVersion>latest</LangVersion>
45
<IsPackable>false</IsPackable>
56
<OutputPath>bin</OutputPath>
67
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>

src/Examples/Simplify.Web.Examples.Katana/Startup.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
using Simplify.Web.Meta;
33
using Simplify.Web.Owin;
44

5-
namespace Simplify.Web.Examples.Katana
5+
namespace Simplify.Web.Examples.Katana;
6+
7+
public class Startup
68
{
7-
public class Startup
9+
public void Configuration(IAppBuilder app)
810
{
9-
public void Configuration(IAppBuilder app)
10-
{
11-
// Exclude Simplify.Web from exclude assemblies to be able to load example controllers
12-
SimplifyWebTypesFinder.ExcludedAssembliesPrefixes.Remove("Simplify");
11+
// Exclude Simplify.Web from exclude assemblies to be able to load example controllers
12+
SimplifyWebTypesFinder.ExcludedAssembliesPrefixes.Remove("Simplify");
1313

14-
app.UseSimplifyWeb();
15-
}
14+
app.UseSimplifyWeb();
1615
}
1716
}
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
using Simplify.Web.Attributes;
22
using Simplify.Web.Responses;
33

4-
namespace Simplify.Web.Examples.Nowin.Controllers
4+
namespace Simplify.Web.Examples.Nowin.Controllers;
5+
6+
[Get("/")]
7+
public class DefaultController : Controller
58
{
6-
[Get("/")]
7-
public class DefaultController : Controller
9+
public override ControllerResponse Invoke()
810
{
9-
public override ControllerResponse Invoke()
10-
{
11-
return new Tpl("Hello from OWIN self-hosted application with NOWIN web-server!");
12-
}
11+
return new Tpl("Hello from OWIN self-hosted application with NOWIN web-server!");
1312
}
1413
}
Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
using System;
22
using Microsoft.Owin.Hosting;
33

4-
namespace Simplify.Web.Examples.Nowin
4+
namespace Simplify.Web.Examples.Nowin;
5+
6+
internal class Program
57
{
6-
internal class Program
8+
private static void Main()
79
{
8-
private static void Main()
10+
var options = new StartOptions
911
{
10-
var options = new StartOptions
11-
{
12-
ServerFactory = "Nowin",
13-
Port = 8080
14-
};
12+
ServerFactory = "Nowin",
13+
Port = 8080
14+
};
1515

16-
using (WebApp.Start<Startup>(options))
17-
{
18-
Console.WriteLine("Running a http server on port 8080");
19-
Console.ReadKey();
20-
}
16+
using (WebApp.Start<Startup>(options))
17+
{
18+
Console.WriteLine("Running a http server on port 8080");
19+
Console.ReadKey();
2120
}
2221
}
2322
}

src/Examples/Simplify.Web.Examples.Nowin/Simplify.Web.Examples.Nowin.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>net462</TargetFrameworks>
4+
<LangVersion>latest</LangVersion>
45
<OutputType>Exe</OutputType>
56
<IsPackable>false</IsPackable>
67

src/Examples/Simplify.Web.Examples.Nowin/Startup.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
using Simplify.Web.Meta;
33
using Simplify.Web.Owin;
44

5-
namespace Simplify.Web.Examples.Nowin
5+
namespace Simplify.Web.Examples.Nowin;
6+
7+
public class Startup
68
{
7-
public class Startup
9+
public void Configuration(IAppBuilder app)
810
{
9-
public void Configuration(IAppBuilder app)
10-
{
11-
// Exclude Simplify.Web from exclude assemblies to be able to load example controllers
12-
SimplifyWebTypesFinder.ExcludedAssembliesPrefixes.Remove("Simplify");
11+
// Exclude Simplify.Web from exclude assemblies to be able to load example controllers
12+
SimplifyWebTypesFinder.ExcludedAssembliesPrefixes.Remove("Simplify");
1313

14-
app.UseSimplifyWeb();
15-
}
14+
app.UseSimplifyWeb();
1615
}
1716
}

src/Examples/Simplify.Web.Examples.SelfHosted.Tests/Controllers/Accounts/LogoutControllerTests.cs

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,30 @@
55
using Simplify.Web.Modules;
66
using Simplify.Web.Responses;
77

8-
namespace Simplify.Web.Examples.SelfHosted.Tests.Controllers.Accounts
8+
namespace Simplify.Web.Examples.SelfHosted.Tests.Controllers.Accounts;
9+
10+
[TestFixture]
11+
public class LogoutControllerTests
912
{
10-
[TestFixture]
11-
public class LogoutControllerTests
13+
[Test]
14+
public void Invoke_SignOutCalledRedirectedToDefaultPage()
1215
{
13-
[Test]
14-
public void Invoke_SignOutCalledRedirectedToDefaultPage()
15-
{
16-
// Assign
16+
// Assign
1717

18-
var c = new Mock<LogoutController> { CallBase = true };
19-
var context = new Mock<IWebContext>();
20-
var auth = new Mock<IAuthenticationManager>();
18+
var c = new Mock<LogoutController> { CallBase = true };
19+
var context = new Mock<IWebContext>();
20+
var auth = new Mock<IAuthenticationManager>();
2121

22-
auth.Setup(x => x.SignOut());
23-
context.SetupGet(x => x.Context.Authentication).Returns(auth.Object);
24-
c.SetupGet(x => x.Context).Returns(context.Object);
22+
auth.Setup(x => x.SignOut());
23+
context.SetupGet(x => x.Context.Authentication).Returns(auth.Object);
24+
c.SetupGet(x => x.Context).Returns(context.Object);
2525

26-
// Act
27-
var result = c.Object.Invoke();
26+
// Act
27+
var result = c.Object.Invoke();
2828

29-
// Assert
29+
// Assert
3030

31-
Assert.AreEqual(RedirectionType.DefaultPage, ((Redirect)result).RedirectionType);
32-
auth.Verify(x => x.SignOut());
33-
}
31+
Assert.AreEqual(RedirectionType.DefaultPage, ((Redirect)result).RedirectionType);
32+
auth.Verify(x => x.SignOut());
3433
}
3534
}

src/Examples/Simplify.Web.Examples.SelfHosted.Tests/Controllers/DefaultPageControllerTests.cs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,21 @@
33
using Simplify.Web.Examples.SelfHosted.Controllers;
44
using Simplify.Web.Responses;
55

6-
namespace Simplify.Web.Examples.SelfHosted.Tests.Controllers
6+
namespace Simplify.Web.Examples.SelfHosted.Tests.Controllers;
7+
8+
[TestFixture]
9+
public class DefaultPageControllerTests
710
{
8-
[TestFixture]
9-
public class DefaultPageControllerTests
11+
[Test]
12+
public void Invoke_Default_MainContentSet()
1013
{
11-
[Test]
12-
public void Invoke_Default_MainContentSet()
13-
{
14-
// Assign
15-
var c = new Mock<DefaultController> { CallBase = true };
14+
// Assign
15+
var c = new Mock<DefaultController> { CallBase = true };
1616

17-
// Act
18-
var result = c.Object.Invoke();
17+
// Act
18+
var result = c.Object.Invoke();
1919

20-
// Assert
21-
Assert.AreEqual("Default", ((StaticTpl)result).TemplateFileName);
22-
}
20+
// Assert
21+
Assert.AreEqual("Default", ((StaticTpl)result).TemplateFileName);
2322
}
2423
}

src/Examples/Simplify.Web.Examples.SelfHosted.Tests/Simplify.Web.Examples.SelfHosted.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>net462</TargetFrameworks>
4+
<LangVersion>latest</LangVersion>
45
<Authors>Alexander Krylkov</Authors>
56
<Product>Simplify</Product>
67
<Description>Simplify.Web.Examples.SelfHosted unit tests</Description>

0 commit comments

Comments
 (0)