-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from mrstebo/hotfix/default-services
Hotfix/default services
- Loading branch information
Showing
6 changed files
with
131 additions
and
2 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
47 changes: 47 additions & 0 deletions
47
src/Nancy.OAuth2.Tests/Services/DefaultAuthorizationEndpointServiceTests.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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using System; | ||
using Nancy.OAuth2.Models; | ||
using Nancy.OAuth2.Services; | ||
using NUnit.Framework; | ||
|
||
namespace Nancy.OAuth2.Tests.Services | ||
{ | ||
[TestFixture] | ||
[Parallelizable] | ||
public class DefaultAuthorizationEndpointServiceTests | ||
{ | ||
private IAuthorizationEndpointService _service; | ||
|
||
[SetUp] | ||
public void SetUp() | ||
{ | ||
_service = new DefaultAuthorizationEndpointService(); | ||
} | ||
|
||
[Test] | ||
public void GenerateAuthorizationToken_ShouldThrow_NotImplementedException() | ||
{ | ||
var request = new AuthorizationRequest(); | ||
var context = new NancyContext(); | ||
|
||
Assert.Throws<NotImplementedException>(() => _service.GenerateAuthorizationToken(request, context)); | ||
} | ||
|
||
[Test] | ||
public void ValidateRequest_ShouldThrow_NotImplementedException() | ||
{ | ||
var request = new AuthorizationRequest(); | ||
var context = new NancyContext(); | ||
|
||
Assert.Throws<NotImplementedException>(() => _service.ValidateRequest(request, context)); | ||
} | ||
|
||
[Test] | ||
public void GetAuthorizationView_ShouldThrow_NotImplementedException() | ||
{ | ||
var request = new AuthorizationRequest(); | ||
var context = new NancyContext(); | ||
|
||
Assert.Throws<NotImplementedException>(() => _service.GetAuthorizationView(request, context)); | ||
} | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
src/Nancy.OAuth2.Tests/Services/DefaultTokenEndpointServiceTests.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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System; | ||
using Nancy.OAuth2.Models; | ||
using Nancy.OAuth2.Services; | ||
using NUnit.Framework; | ||
|
||
namespace Nancy.OAuth2.Tests.Services | ||
{ | ||
[TestFixture] | ||
[Parallelizable] | ||
public class DefaultTokenEndpointServiceTests | ||
{ | ||
private ITokenEndpointService _service; | ||
|
||
[SetUp] | ||
public void SetUp() | ||
{ | ||
_service = new DefaultTokenEndpointService(); | ||
} | ||
|
||
[Test] | ||
public void ValidateRequest_ShouldThrow_NotImplementedException() | ||
{ | ||
var request = new TokenRequest(); | ||
var context = new NancyContext(); | ||
|
||
Assert.Throws<NotImplementedException>(() => _service.ValidateRequest(request, context)); | ||
} | ||
|
||
[Test] | ||
public void CreateTokenResponse_ShouldThrow_NotImplementedException() | ||
{ | ||
var request = new TokenRequest(); | ||
var context = new NancyContext(); | ||
|
||
Assert.Throws<NotImplementedException>(() => _service.CreateTokenResponse(request, context)); | ||
} | ||
} | ||
} |
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
23 changes: 23 additions & 0 deletions
23
src/Nancy.OAuth2/Services/DefaultAuthorizationEndpointService.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System; | ||
using Nancy.OAuth2.Models; | ||
|
||
namespace Nancy.OAuth2.Services | ||
{ | ||
public class DefaultAuthorizationEndpointService : IAuthorizationEndpointService | ||
{ | ||
public string GenerateAuthorizationToken(AuthorizationRequest request, NancyContext context) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public OAuthValidationResult ValidateRequest(AuthorizationRequest request, NancyContext context) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Tuple<string, object> GetAuthorizationView(AuthorizationRequest request, NancyContext context) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Nancy.OAuth2.Models; | ||
|
||
namespace Nancy.OAuth2.Services | ||
{ | ||
public class DefaultTokenEndpointService : ITokenEndpointService | ||
{ | ||
public OAuthValidationResult ValidateRequest(TokenRequest request, NancyContext context) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public TokenResponse CreateTokenResponse(TokenRequest request, NancyContext context) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
} | ||
} |