Exemple #1
0
        public void CreateClaimExecute_NewPolicyId_InsertedClaimHasSameStatus()
        {
            // Arrange
            var interactor = CreateClaimInteractorFactory.Create();
            var newClaim   = ClaimFactory.Create();

            // Run
            var result = interactor.Execute(newClaim.PolicyId, newClaim.StatusId);

            // Assert
            result.StatusId.ShouldBe(newClaim.StatusId);
        }
        public void UpdateStatus_NewClaimIdAndStatusId_UpdatedClaimHasNewStatusId()
        {
            // Arrange
            var          interactor    = UpdateClaimInteractorFactory.Create();
            ClaimEntity  claimToUpdate = ClaimFactory.Create();
            StatusEntity newStatus     = StatusFactory.Create("Closed");

            // Run
            var result = interactor.UpdateStatus(claimToUpdate, newStatus);

            // Assert
            result.StatusId.ShouldBe(newStatus.Id);
        }
Exemple #3
0
 // Creates a Claim from a TClaim object (duck typing).
 //
 // The TClaim must have the following shape:
 // class TClaim {
 //   string ClaimType { get; } // or just 'Type'
 //   string Value { get; }
 // }
 internal static Claim Create <TClaim>(TClaim claim)
 {
     return(ClaimFactory <TClaim> .Create(claim));
 }
Exemple #4
0
        // Creates a Claim from a TClaim object (duck typing).
        //
        // The TClaim must have the following shape:
        // class TClaim {
        //   string ClaimType { get; } // or just 'Type'
        //   string Value { get; }
        // }

        internal static Claim Create <TClaim>(TClaim claim) =>
        ClaimFactory <TClaim> .Create(claim);
Exemple #5
0
 public static Task AddClaimAsync(this UserManager <IdentityUser, int> userManager, int userId, Enum claimType, Enum value)
 {
     return(userManager.AddClaimAsync(userId, ClaimFactory.Create(claimType, value)));
 }