Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

AspNetKatana,How to Unit Test " AuthenticationHandler" class

$
0
0

Summary of the problem I am having:

I am not able to write the unit test cases for my app class which is inheriting  public abstract class AuthenticationHandler<TOptions> : AuthenticationHandler whereTOptions : AuthenticationOptions

Error I am receiving:

My code:

nternal class FacebookAuthenticationHandler : AuthenticationHandler<FacebookAuthenticationOptions>
{
private const string XmlSchemaString = "http://www.w3.org/2001/XMLSchema#string";

private readonly ILogger _logger;
private readonly HttpClient _httpClient;

public FacebookAuthenticationHandler(HttpClient httpClient, ILogger logger)
{
_httpClient = httpClient;
_logger = logger;
}

protected override async Task<AuthenticationTicket> AuthenticateCoreAsync()
{
AuthenticationProperties properties = null;

try
{

properties = Options.StateDataFormat.Unprotect(state);// How can i Inject or mock the Options property ?
if (properties == null)
{
return null;
}

}

Thanks you,
Sandeep Kumar Ch


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>