Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test builds #109

Merged
merged 8 commits into from
May 16, 2017
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Task("TestNetFramework")

NuGetRestore(
string.Format("./tests/{0}/{0}.csproj", frameworkTestProject),
new NuGetRestoreSettings { PackagesDirectory = string.Format("./tests/{0}/packages/", frameworkTestProject) });
new NuGetRestoreSettings { PackagesDirectory = string.Format("./packages/", frameworkTestProject) });

MSBuild(
string.Format("./tests/{0}/{0}.csproj", frameworkTestProject),
Expand Down
10 changes: 10 additions & 0 deletions tests/JWT.Tests.Common/JWT.Tests.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,14 @@
<TargetFramework>netstandard1.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Remove="JwtDecoderTest.cs" />
<Compile Remove="JwtEncoderTest.cs" />
</ItemGroup>

<ItemGroup>
<None Include="JwtDecoderTest.cs" />
<None Include="JwtEncoderTest.cs" />
</ItemGroup>

</Project>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
using System.Collections.Generic;
using FluentAssertions;
using JWT.Algorithms;
using JWT.Serializers;
using Xunit;
using JWT.Tests.Common;
namespace JWT.Tests
{
public class JwtEncoderTest
{
[Fact]
public void Encode_Should_Encode_To_Token()
{
var serializer = new JsonNetSerializer();
var urlEncoder = new JwtBase64UrlEncoder();
var encoder = new JwtEncoder(new HMACSHA256Algorithm(), serializer, urlEncoder);
var actual = encoder.Encode(TestData.Customer, "ABC");
actual.Should().Be(TestData.Token);
}
[Fact]
public void Encode_Should_Encode_To_Token_With_Extra_Headers()
{
var serializer = new JsonNetSerializer();
var urlEncoder = new JwtBase64UrlEncoder();
var encoder = new JwtEncoder(new HMACSHA256Algorithm(), serializer, urlEncoder);
var extraheaders = new Dictionary<string, object> { { "foo", "bar" } };
var actual = encoder.Encode(extraheaders, TestData.Customer, "ABC");
actual.Should().Be(TestData.ExtraHeadersToken);
}
}
using System.Collections.Generic;
using FluentAssertions;
using JWT.Algorithms;
using JWT.Serializers;
using Xunit;
using JWT.Tests.Common;

namespace JWT.Tests
{
public class JwtEncoderTest
{
[Fact]
public void Encode_Should_Encode_To_Token()
{
var serializer = new JsonNetSerializer();
var urlEncoder = new JwtBase64UrlEncoder();
var encoder = new JwtEncoder(new HMACSHA256Algorithm(), serializer, urlEncoder);

var actual = encoder.Encode(TestData.Customer, "ABC");

actual.Should().Be(TestData.Token);
}

[Fact]
public void Encode_Should_Encode_To_Token_With_Extra_Headers()
{
var serializer = new JsonNetSerializer();
var urlEncoder = new JwtBase64UrlEncoder();
var encoder = new JwtEncoder(new HMACSHA256Algorithm(), serializer, urlEncoder);

var extraheaders = new Dictionary<string, object> { { "foo", "bar" } };
var actual = encoder.Encode(extraheaders, TestData.Customer, "ABC");

actual.Should().Be(TestData.ExtraHeadersToken);
}
}
}
5 changes: 5 additions & 0 deletions tests/JWT.Tests.Core/JWT.Tests.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\JWT.Tests.Common\JwtDecoderTest.cs" Link="JwtDecoderTest.cs" />
<Compile Include="..\JWT.Tests.Common\JwtEncoderTest.cs" Link="JwtEncoderTest.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="4.19.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
Expand Down
24 changes: 12 additions & 12 deletions tests/JWT.Tests.NETFramework/JWT.Tests.NETFramework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,36 +39,36 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="FluentAssertions, Version=4.19.2.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>packages\FluentAssertions.4.19.2\lib\net45\FluentAssertions.dll</HintPath>
<HintPath>..\..\packages\FluentAssertions.4.19.2\lib\net45\FluentAssertions.dll</HintPath>
</Reference>
<Reference Include="FluentAssertions.Core, Version=4.19.2.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>.\packages\FluentAssertions.4.19.2\lib\net45\FluentAssertions.Core.dll</HintPath>
</Reference>
<Reference Include="ServiceStack.Text, Version=4.5.6.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>.\packages\ServiceStack.Text.4.5.6\lib\net45\ServiceStack.Text.dll</HintPath>
<HintPath>..\..\packages\FluentAssertions.4.19.2\lib\net45\FluentAssertions.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>.\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll</HintPath>
<HintPath>..\..\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll</HintPath>
</Reference>
<Reference Include="xunit.assert, Version=2.2.0.3545, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>.\packages\xunit.assert.2.2.0\lib\netstandard1.1\xunit.assert.dll</HintPath>
<HintPath>..\..\packages\xunit.assert.2.2.0\lib\netstandard1.1\xunit.assert.dll</HintPath>
</Reference>
<Reference Include="xunit.core, Version=2.2.0.3545, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>.\packages\xunit.extensibility.core.2.2.0\lib\netstandard1.1\xunit.core.dll</HintPath>
<HintPath>..\..\packages\xunit.extensibility.core.2.2.0\lib\netstandard1.1\xunit.core.dll</HintPath>
</Reference>
<Reference Include="xunit.execution.desktop, Version=2.2.0.3545, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>.\packages\xunit.extensibility.execution.2.2.0\lib\net452\xunit.execution.desktop.dll</HintPath>
<HintPath>..\..\packages\xunit.extensibility.execution.2.2.0\lib\net452\xunit.execution.desktop.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\JWT.Tests.Common\JwtDecoderTest.cs">
<Link>JwtDecoderTest.cs</Link>
</Compile>
<Compile Include="..\JWT.Tests.Common\JwtEncoderTest.cs">
<Link>JwtEncoderTest.cs</Link>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Serializers\ServiceStackJsonSerializer.cs" />
<Compile Include="Serializers\WebScriptJsonSerializer.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
Expand Down

This file was deleted.

This file was deleted.