-
Notifications
You must be signed in to change notification settings - Fork 464
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove old serializers (deprecated after v3) * Add sanity tests to NETFramework project * Fix package hint path * Remove old dependencies * Reuse test code * Moving tests to Common. Adding them to test projects as links
- Loading branch information
1 parent
e0092b8
commit d51a8a3
Showing
8 changed files
with
263 additions
and
284 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
398 changes: 199 additions & 199 deletions
398
tests/JWT.Tests.Core/JwtDecoderTest.cs → tests/JWT.Tests.Common/JwtDecoderTest.cs
Large diffs are not rendered by default.
Oops, something went wrong.
72 changes: 36 additions & 36 deletions
72
tests/JWT.Tests.Core/JwtEncoderTest.cs → tests/JWT.Tests.Common/JwtEncoderTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
tests/JWT.Tests.NETFramework/Serializers/ServiceStackJsonSerializer.cs
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
tests/JWT.Tests.NETFramework/Serializers/WebScriptJsonSerializer.cs
This file was deleted.
Oops, something went wrong.