Browse Source

Added Luticate2.Auth, unit tests and sample projects

master
Robin Thoni 6 years ago
parent
commit
4bdb0146cd

+ 49
- 0
.idea/.idea.luticate2/.idea/contentModel.xml View File

@@ -2,8 +2,57 @@
2 2
 <project version="4">
3 3
   <component name="ContentModelStore">
4 4
     <e p="$USER_HOME$/.Rider2018.1/system/resharper-host/local/Transient/ReSharperHost/v12/SolutionCaches/_luticate2.1484521948.00" t="ExcludeRecursive" />
5
+    <e p="$USER_HOME$/.nuget/packages/xunit.runner.visualstudio/2.3.1/build/netcoreapp1.0/xunit.runner.reporters.netcoreapp10.dll" t="Include" />
6
+    <e p="$USER_HOME$/.nuget/packages/xunit.runner.visualstudio/2.3.1/build/netcoreapp1.0/xunit.runner.utility.netcoreapp10.dll" t="Include" />
7
+    <e p="$USER_HOME$/.nuget/packages/xunit.runner.visualstudio/2.3.1/build/netcoreapp1.0/xunit.runner.visualstudio.dotnetcore.testadapter.dll" t="Include" />
5 8
     <e p="$PROJECT_DIR$" t="IncludeFlat">
9
+      <e p="Auth" t="Include" />
10
+      <e p="Luticate2.Auth" t="IncludeRecursive">
11
+        <e p="Class1.cs" t="Include" />
12
+        <e p="Luticate2.Auth.csproj" t="IncludeRecursive" />
13
+        <e p="bin" t="ExcludeRecursive" />
14
+        <e p="obj" t="ExcludeRecursive">
15
+          <e p="Debug" t="Include">
16
+            <e p="netstandard2.0" t="Include">
17
+              <e p="Luticate2.Auth.AssemblyInfo.cs" t="Include" />
18
+            </e>
19
+          </e>
20
+        </e>
21
+      </e>
22
+      <e p="Luticate2.Auth.Tests" t="IncludeRecursive">
23
+        <e p="Luticate2.Auth.Tests.csproj" t="IncludeRecursive" />
24
+        <e p="UnitTest1.cs" t="Include" />
25
+        <e p="bin" t="ExcludeRecursive" />
26
+        <e p="obj" t="ExcludeRecursive">
27
+          <e p="Debug" t="Include">
28
+            <e p="netcoreapp2.0" t="Include">
29
+              <e p="Luticate2.Auth.Tests.AssemblyInfo.cs" t="Include" />
30
+              <e p="Luticate2.Auth.Tests.Program.cs" t="Include" />
31
+            </e>
32
+          </e>
33
+        </e>
34
+      </e>
35
+      <e p="Luticate2.Auth.WebApiSample" t="IncludeRecursive">
36
+        <e p="Controllers" t="Include">
37
+          <e p="ValuesController.cs" t="Include" />
38
+        </e>
39
+        <e p="Luticate2.Auth.WebApiSample.csproj" t="IncludeRecursive" />
40
+        <e p="Program.cs" t="Include" />
41
+        <e p="Startup.cs" t="Include" />
42
+        <e p="appsettings.Development.json" t="Include" />
43
+        <e p="appsettings.json" t="Include" />
44
+        <e p="bin" t="ExcludeRecursive" />
45
+        <e p="obj" t="ExcludeRecursive">
46
+          <e p="Debug" t="Include">
47
+            <e p="netcoreapp2.0" t="Include">
48
+              <e p="Luticate2.Auth.WebApiSample.AssemblyInfo.cs" t="Include" />
49
+            </e>
50
+          </e>
51
+        </e>
52
+        <e p="wwwroot" t="Include" />
53
+      </e>
6 54
       <e p="luticate2.sln" t="IncludeFlat" />
55
+      <e p="packages" t="ExcludeRecursive" />
7 56
     </e>
8 57
   </component>
9 58
 </project>

+ 3
- 0
.idea/.idea.luticate2/riderModule.iml View File

@@ -1,6 +1,9 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <module type="RIDER_MODULE" version="4">
3 3
   <component name="NewModuleRootManager">
4
+    <content url="file://$USER_HOME$/.nuget/packages/xunit.runner.visualstudio/2.3.1/build/netcoreapp1.0/xunit.runner.reporters.netcoreapp10.dll" />
5
+    <content url="file://$USER_HOME$/.nuget/packages/xunit.runner.visualstudio/2.3.1/build/netcoreapp1.0/xunit.runner.utility.netcoreapp10.dll" />
6
+    <content url="file://$USER_HOME$/.nuget/packages/xunit.runner.visualstudio/2.3.1/build/netcoreapp1.0/xunit.runner.visualstudio.dotnetcore.testadapter.dll" />
4 7
     <content url="file://$MODULE_DIR$/../.." />
5 8
     <orderEntry type="sourceFolder" forTests="false" />
6 9
   </component>

+ 15
- 0
Luticate2.Auth.Tests/Luticate2.Auth.Tests.csproj View File

@@ -0,0 +1,15 @@
1
+<Project Sdk="Microsoft.NET.Sdk">
2
+  <PropertyGroup>
3
+    <TargetFramework>netcoreapp2.0</TargetFramework>
4
+    <IsPackable>false</IsPackable>
5
+  </PropertyGroup>
6
+  <ItemGroup>
7
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
8
+    <PackageReference Include="xunit" Version="2.3.1" />
9
+    <PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
10
+    <DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
11
+  </ItemGroup>
12
+  <ItemGroup>
13
+    <ProjectReference Include="..\Luticate2.Auth\Luticate2.Auth.csproj" />
14
+  </ItemGroup>
15
+</Project>

+ 16
- 0
Luticate2.Auth.Tests/UnitTest1.cs View File

@@ -0,0 +1,16 @@
1
+using System;
2
+using Xunit;
3
+
4
+namespace Luticate2.Auth.Tests
5
+{
6
+    public class UnitTest1
7
+    {
8
+        [Fact]
9
+        public void Test1()
10
+        {
11
+            string expected = "testValue 0";
12
+            string actual = Class1.Method1("0");
13
+            Assert.Equal(expected, actual);
14
+        }
15
+    }
16
+}

+ 44
- 0
Luticate2.Auth.WebApiSample/Controllers/ValuesController.cs View File

@@ -0,0 +1,44 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Threading.Tasks;
5
+using Microsoft.AspNetCore.Mvc;
6
+
7
+namespace Luticate2.Auth.WebApiSample.Controllers
8
+{
9
+    [Route("api/[controller]")]
10
+    public class ValuesController : Controller
11
+    {
12
+        // GET api/values
13
+        [HttpGet]
14
+        public IEnumerable<string> Get()
15
+        {
16
+            return new string[] {Class1.Method1("value1"), Class1.Method1("value2")};
17
+        }
18
+
19
+        // GET api/values/5
20
+        [HttpGet("{id}")]
21
+        public string Get(int id)
22
+        {
23
+            return "value";
24
+        }
25
+
26
+        // POST api/values
27
+        [HttpPost]
28
+        public void Post([FromBody] string value)
29
+        {
30
+        }
31
+
32
+        // PUT api/values/5
33
+        [HttpPut("{id}")]
34
+        public void Put(int id, [FromBody] string value)
35
+        {
36
+        }
37
+
38
+        // DELETE api/values/5
39
+        [HttpDelete("{id}")]
40
+        public void Delete(int id)
41
+        {
42
+        }
43
+    }
44
+}

+ 17
- 0
Luticate2.Auth.WebApiSample/Luticate2.Auth.WebApiSample.csproj View File

@@ -0,0 +1,17 @@
1
+<Project Sdk="Microsoft.NET.Sdk.Web">
2
+  <PropertyGroup>
3
+    <TargetFramework>netcoreapp2.0</TargetFramework>
4
+  </PropertyGroup>
5
+  <ItemGroup>
6
+    <Folder Include="wwwroot\" />
7
+  </ItemGroup>
8
+  <ItemGroup>
9
+    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.5" />
10
+  </ItemGroup>
11
+  <ItemGroup>
12
+    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.2" />
13
+  </ItemGroup>
14
+  <ItemGroup>
15
+    <ProjectReference Include="..\Luticate2.Auth\Luticate2.Auth.csproj" />
16
+  </ItemGroup>
17
+</Project>

+ 25
- 0
Luticate2.Auth.WebApiSample/Program.cs View File

@@ -0,0 +1,25 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.IO;
4
+using System.Linq;
5
+using System.Threading.Tasks;
6
+using Microsoft.AspNetCore;
7
+using Microsoft.AspNetCore.Hosting;
8
+using Microsoft.Extensions.Configuration;
9
+using Microsoft.Extensions.Logging;
10
+
11
+namespace Luticate2.Auth.WebApiSample
12
+{
13
+    public class Program
14
+    {
15
+        public static void Main(string[] args)
16
+        {
17
+            BuildWebHost(args).Run();
18
+        }
19
+
20
+        public static IWebHost BuildWebHost(string[] args) =>
21
+            WebHost.CreateDefaultBuilder(args)
22
+                .UseStartup<Startup>()
23
+                .Build();
24
+    }
25
+}

+ 40
- 0
Luticate2.Auth.WebApiSample/Startup.cs View File

@@ -0,0 +1,40 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Threading.Tasks;
5
+using Microsoft.AspNetCore.Builder;
6
+using Microsoft.AspNetCore.Hosting;
7
+using Microsoft.Extensions.Configuration;
8
+using Microsoft.Extensions.DependencyInjection;
9
+using Microsoft.Extensions.Logging;
10
+using Microsoft.Extensions.Options;
11
+
12
+namespace Luticate2.Auth.WebApiSample
13
+{
14
+    public class Startup
15
+    {
16
+        public Startup(IConfiguration configuration)
17
+        {
18
+            Configuration = configuration;
19
+        }
20
+
21
+        public IConfiguration Configuration { get; }
22
+
23
+        // This method gets called by the runtime. Use this method to add services to the container.
24
+        public void ConfigureServices(IServiceCollection services)
25
+        {
26
+            services.AddMvc();
27
+        }
28
+
29
+        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
30
+        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
31
+        {
32
+            if (env.IsDevelopment())
33
+            {
34
+                app.UseDeveloperExceptionPage();
35
+            }
36
+
37
+            app.UseMvc();
38
+        }
39
+    }
40
+}

+ 10
- 0
Luticate2.Auth.WebApiSample/appsettings.Development.json View File

@@ -0,0 +1,10 @@
1
+{
2
+  "Logging": {
3
+    "IncludeScopes": false,
4
+    "LogLevel": {
5
+      "Default": "Debug",
6
+      "System": "Information",
7
+      "Microsoft": "Information"
8
+    }
9
+  }
10
+}

+ 15
- 0
Luticate2.Auth.WebApiSample/appsettings.json View File

@@ -0,0 +1,15 @@
1
+{
2
+  "Logging": {
3
+    "IncludeScopes": false,
4
+    "Debug": {
5
+      "LogLevel": {
6
+        "Default": "Warning"
7
+      }
8
+    },
9
+    "Console": {
10
+      "LogLevel": {
11
+        "Default": "Warning"
12
+      }
13
+    }
14
+  }
15
+}

+ 12
- 0
Luticate2.Auth/Class1.cs View File

@@ -0,0 +1,12 @@
1
+using System;
2
+
3
+namespace Luticate2.Auth
4
+{
5
+    public class Class1
6
+    {
7
+        public static string Method1(string arg1)
8
+        {
9
+            return $"testValue {arg1}";
10
+        }
11
+    }
12
+}

+ 7
- 0
Luticate2.Auth/Luticate2.Auth.csproj View File

@@ -0,0 +1,7 @@
1
+<Project Sdk="Microsoft.NET.Sdk">
2
+
3
+    <PropertyGroup>
4
+        <TargetFramework>netstandard2.0</TargetFramework>
5
+    </PropertyGroup>
6
+
7
+</Project>

+ 27
- 0
luticate2.sln View File

@@ -1,8 +1,35 @@
1 1
 
2 2
 Microsoft Visual Studio Solution File, Format Version 12.00
3
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Auth", "Auth", "{A9D48433-4DD9-4CEC-89FA-0350C942EFC9}"
4
+EndProject
5
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Luticate2.Auth", "Luticate2.Auth\Luticate2.Auth.csproj", "{11727D2F-E2EE-4FD5-BEC4-C22B5B0D38A2}"
6
+EndProject
7
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Luticate2.Auth.Tests", "Luticate2.Auth.Tests\Luticate2.Auth.Tests.csproj", "{82A268E9-361D-4F4A-B3A9-3810C5275587}"
8
+EndProject
9
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Luticate2.Auth.WebApiSample", "Luticate2.Auth.WebApiSample\Luticate2.Auth.WebApiSample.csproj", "{0621B806-7B96-4C0B-BA14-F98E6ECCB322}"
10
+EndProject
3 11
 Global
4 12
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
5 13
 		Debug|Any CPU = Debug|Any CPU
6 14
 		Release|Any CPU = Release|Any CPU
7 15
 	EndGlobalSection
16
+	GlobalSection(NestedProjects) = preSolution
17
+		{11727D2F-E2EE-4FD5-BEC4-C22B5B0D38A2} = {A9D48433-4DD9-4CEC-89FA-0350C942EFC9}
18
+		{82A268E9-361D-4F4A-B3A9-3810C5275587} = {A9D48433-4DD9-4CEC-89FA-0350C942EFC9}
19
+		{0621B806-7B96-4C0B-BA14-F98E6ECCB322} = {A9D48433-4DD9-4CEC-89FA-0350C942EFC9}
20
+	EndGlobalSection
21
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
22
+		{11727D2F-E2EE-4FD5-BEC4-C22B5B0D38A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23
+		{11727D2F-E2EE-4FD5-BEC4-C22B5B0D38A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
24
+		{11727D2F-E2EE-4FD5-BEC4-C22B5B0D38A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
25
+		{11727D2F-E2EE-4FD5-BEC4-C22B5B0D38A2}.Release|Any CPU.Build.0 = Release|Any CPU
26
+		{82A268E9-361D-4F4A-B3A9-3810C5275587}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27
+		{82A268E9-361D-4F4A-B3A9-3810C5275587}.Debug|Any CPU.Build.0 = Debug|Any CPU
28
+		{82A268E9-361D-4F4A-B3A9-3810C5275587}.Release|Any CPU.ActiveCfg = Release|Any CPU
29
+		{82A268E9-361D-4F4A-B3A9-3810C5275587}.Release|Any CPU.Build.0 = Release|Any CPU
30
+		{0621B806-7B96-4C0B-BA14-F98E6ECCB322}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
31
+		{0621B806-7B96-4C0B-BA14-F98E6ECCB322}.Debug|Any CPU.Build.0 = Debug|Any CPU
32
+		{0621B806-7B96-4C0B-BA14-F98E6ECCB322}.Release|Any CPU.ActiveCfg = Release|Any CPU
33
+		{0621B806-7B96-4C0B-BA14-F98E6ECCB322}.Release|Any CPU.Build.0 = Release|Any CPU
34
+	EndGlobalSection
8 35
 EndGlobal

Loading…
Cancel
Save