LCOV - code coverage report
Current view: top level - Cqrs/Authentication - SingleSignOnTokenFactory.cs Hit Total Coverage
Test: doc-coverage.info Lines: 0 3 0.0 %
Date: 2017-07-26

          Line data    Source code
       1             : #region Copyright
       2             : // // -----------------------------------------------------------------------
       3             : // // <copyright company="cdmdotnet Limited">
       4             : // //   Copyright cdmdotnet Limited. All rights reserved.
       5             : // // </copyright>
       6             : // // -----------------------------------------------------------------------
       7             : #endregion
       8             : 
       9             : using System;
      10             : 
      11             : namespace Cqrs.Authentication
      12             : {
      13             :         public class SingleSignOnTokenFactory<TSingleSignOnToken> : ISingleSignOnTokenFactory<TSingleSignOnToken>
      14             :                         where TSingleSignOnToken : ISingleSignOnToken, new()
      15           0 :         {
      16           0 :                 public virtual TSingleSignOnToken CreateNew(int timeoutInMinutes = 360)
      17             :                 {
      18             :                         var token = new TSingleSignOnToken
      19             :                         {
      20             :                                 Token = Guid.NewGuid().ToString("N"),
      21             :                                 DateIssued = DateTime.UtcNow,
      22             :                                 TimeOfExpiry = DateTime.UtcNow.AddMinutes(timeoutInMinutes),
      23             :                         };
      24             : 
      25             :                         return RenewTokenExpiry(token, timeoutInMinutes);
      26             :                 }
      27             : 
      28           0 :                 public virtual TSingleSignOnToken RenewTokenExpiry(TSingleSignOnToken token, int timeoutInMinutes = 360)
      29             :                 {
      30             :                         token.TimeOfExpiry = DateTime.UtcNow.AddMinutes(timeoutInMinutes);
      31             : 
      32             :                         return token;
      33             :                 }
      34             :         }
      35             : }

Generated by: LCOV version 1.10