예제 #1
0
        protected IdCard(string version, XElement domElement, string cardId, AuthenticationLevel authenticationLevel, string issuer, SystemInfo systemInfo, string certHash, string alternativeIdentifier, string userName, string password)
        {
            ModelUtilities.ValidateNotEmpty(issuer, "'Issuer' cannot be null or empty");
            ModelUtilities.ValidateNotNull(authenticationLevel, "'AuthenticationLevel' cannot be null");

            Version     = version;
            CreatedDate = DateTime.Now.AddMinutes(-IDCARD_BEGIN_TIME_BUFFER_IN_MINUTES);
            ExpiryDate  = CreatedDate.AddHours(MAX_IDCARD_LIFE_IN_HOURS);

            Issuer = issuer;
            AuthenticationLevel = authenticationLevel;
            if (AuthenticationLevel.MocesTrustedUser.Equals(authenticationLevel) || AuthenticationLevel.VocesTrustedSystem.Equals(authenticationLevel))
            {
                CertHash = certHash ?? "";
            }
            AlternativeIdentifier = alternativeIdentifier;
            if (AuthenticationLevel.UsernamePasswordAuthentication.Equals(authenticationLevel))
            {
                ModelUtilities.ValidateNotEmpty(userName, "'username' cannot be null or empty for authenticationlevel 2");
                ModelUtilities.ValidateNotEmpty(password, "'password' cannot be null or empty for authenticationlevel 2");
                Username = userName;
                Password = password;
            }

            Xassertion     = domElement;
            NeedsSignature = (Xassertion == null);

            IdCardId = cardId;
        }
예제 #2
0
        protected override IEnumerable <Event> Given()
        {
            yield return(new LoanCreatedEvent(CreatedDate, LoanAmount, new Duration(12, DurationUnit.Month), PaymentPlan.Weekly));

            yield return(new LoanCustomerContactChangedEvent("bob", "0444444444", "0812341234", "10 Random Street"));

            yield return(new LoanBankAccountChangedEvent("066-000", "12345678"));

            yield return(new LoanDisbursedFundsEvent(CreatedDate.AddHours(1), -LoanAmount, new BankAccount("066-000", "12345678")));
        }
예제 #3
0
        public SLAStatusList SLAStatus()
        {
            if (SLAOffset > 0)
            {
                if (CreatedDate.AddHours(SLAOffset) < DateTime.UtcNow)
                {
                    return(SLAStatusList.Disturbance);
                }
                else if (CreatedDate.AddHours(SLAOffset) >= DateTime.UtcNow && CreatedDate.AddHours(SLAOffset - 1) <= DateTime.UtcNow)
                {
                    return(SLAStatusList.Warning);
                }
            }

            return(SLAStatusList.NoWarning);
        }