Skip to content

Commit 1995355

Browse files
authored
Merge pull request #42 from geeklearningio/release/1.0.0
Release/1.0.0
2 parents 929165d + 1affc5f commit 1995355

File tree

14 files changed

+70
-102
lines changed

14 files changed

+70
-102
lines changed

global.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"projects": [ "src", "sample" ],
3-
"sdk": {
4-
"version": "1.0.4"
5-
}
2+
"projects": [ "src", "sample" ]
3+
//"sdk": {
4+
// "version": "1.0.4"
5+
//}
66
}

sample/Sample.Test.Splecflow/Sample.Test.Splecflow.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net461</TargetFrameworks>
5-
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
4+
<TargetFramework>netcoreapp2.0</TargetFramework>
5+
<!--<RuntimeIdentifier>win7-x86</RuntimeIdentifier>-->
66
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
77
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
88
</PropertyGroup>
@@ -18,6 +18,7 @@
1818
<PackageReference Include="MSTest.TestFramework" Version="1.1.18" />
1919
<PackageReference Include="SpecFlow" Version="2.2.0" />
2020
<PackageReference Include="SpecFlow.NetCore" Version="1.0.0-rc8" />
21+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.4.0" />
2122
</ItemGroup>
2223

2324
<ItemGroup>

sample/Sample.Test/Sample.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp1.1</TargetFrameworks>
4+
<TargetFramework>netcoreapp2.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp1.1;net461</TargetFrameworks>
4+
<TargetFramework>netcoreapp2.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
88
<ProjectReference Include="..\..\src\GeekLearning.Testavior.Configuration\GeekLearning.Testavior.Configuration.csproj" />
99
</ItemGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.2" />
13-
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.3" />
14-
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.2" />
15-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.2" />
16-
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="1.1.1" />
17-
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.2" />
18-
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.2" />
12+
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
1913
</ItemGroup>
2014

2115
<ItemGroup>
22-
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0" />
16+
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
2317
</ItemGroup>
2418

2519
</Project>

sample/Sample.Web/bundleconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// An array of relative input file paths. Globbing patterns supported
77
"inputFiles": [
88
"wwwroot/css/site.css"
9-
]
9+
]
1010
},
1111
{
1212
"outputFileName": "wwwroot/js/site.min.js",

src/GeekLearning.Testavior.Configuration/GeekLearning.Testavior.Configuration.csproj

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,19 @@
44
<Description>Configure your projects to easily integrate behavior tests with Testavior.</Description>
55
<VersionPrefix>0.0.1</VersionPrefix>
66
<Authors>Geek Learning;Arnaud Auroux</Authors>
7-
<TargetFrameworks>netstandard1.6;net451</TargetFrameworks>
7+
<TargetFrameworks>netstandard2.0</TargetFrameworks>
88
<AssemblyName>GeekLearning.Testavior.Configuration</AssemblyName>
99
<PackageId>GeekLearning.Testavior.Configuration</PackageId>
1010
<PackageTags>dotnet;AspNetCore;UnitTest;Test</PackageTags>
11-
<PackageProjectUrl>https://github.com/geeklearningio/testavior</PackageProjectUrl>
12-
<NetStandardImplicitPackageVersion>1.6.1</NetStandardImplicitPackageVersion>
11+
<PackageProjectUrl>https://github.com/geeklearningio/testavior</PackageProjectUrl>
1312
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
1413
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
1514
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
1615
</PropertyGroup>
1716

1817
<ItemGroup>
19-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="1.1.2" />
20-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="1.1.3" />
21-
</ItemGroup>
22-
23-
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
24-
<Reference Include="System" />
25-
<Reference Include="Microsoft.CSharp" />
26-
</ItemGroup>
27-
28-
<ItemGroup>
29-
<Folder Include="Properties\" />
18+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.0" />
19+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.0.0" />
3020
</ItemGroup>
3121

3222
</Project>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
namespace GeekLearning.Testavior.Authentication
2+
{
3+
using Microsoft.AspNetCore.Authentication;
4+
using Microsoft.Extensions.DependencyInjection;
5+
using Microsoft.Extensions.DependencyInjection.Extensions;
6+
using Microsoft.Extensions.Options;
7+
using System;
8+
9+
public static class TestAuthenticationExtensions
10+
{
11+
public static AuthenticationBuilder AddTestAuthentication(this AuthenticationBuilder builder, string authenticationScheme, string displayName, Action<TestAuthenticationOptions> configureOptions)
12+
{
13+
builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IPostConfigureOptions<TestAuthenticationOptions>, TestAuthenticationPostConfigureOptions>());
14+
return builder.AddScheme<TestAuthenticationOptions, TestAuthenticationHandler>(authenticationScheme, displayName, configureOptions);
15+
}
16+
}
17+
}
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
namespace GeekLearning.Testavior.Authentication
22
{
33
using Microsoft.AspNetCore.Authentication;
4-
using Microsoft.AspNetCore.Http.Authentication;
4+
using Microsoft.Extensions.Logging;
5+
using Microsoft.Extensions.Options;
56
using System.Security.Claims;
7+
using System.Text.Encodings.Web;
68
using System.Threading.Tasks;
79

810
public class TestAuthenticationHandler : AuthenticationHandler<TestAuthenticationOptions>
911
{
12+
public TestAuthenticationHandler(IOptionsMonitor<TestAuthenticationOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock)
13+
: base(options, logger, encoder, clock) { }
14+
1015
protected override Task<AuthenticateResult> HandleAuthenticateAsync()
1116
{
1217
return Task.FromResult(
1318
AuthenticateResult.Success(
1419
new AuthenticationTicket(
1520
new ClaimsPrincipal(Options.Identity),
1621
new AuthenticationProperties(),
17-
this.Options.AuthenticationScheme)));
22+
this.Scheme.Name)));
1823
}
1924
}
2025
}

src/GeekLearning.Testavior/Authentication/TestAuthenticationMiddleware.cs

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
namespace GeekLearning.Testavior.Authentication
22
{
3-
using Microsoft.AspNetCore.Builder;
3+
using Microsoft.AspNetCore.Authentication;
44
using System.Security.Claims;
55

6-
public class TestAuthenticationOptions : AuthenticationOptions
6+
public class TestAuthenticationOptions : AuthenticationSchemeOptions
77
{
88
public ClaimsIdentity Identity { get; set; }
9-
10-
public TestAuthenticationOptions()
11-
{
12-
this.AuthenticationScheme = "TestAuthenticationMiddleware";
13-
this.AutomaticAuthenticate = true;
14-
}
159
}
1610
}

0 commit comments

Comments
 (0)