Beispiel #1
0
        public void SetAccount_ToAValidValue_WhenNotOnAccountStep_DoesNotIncrementStep()
        {
            TagProfile tagProfile = new TagProfile();

            Assert.AreEqual(RegistrationStep.Operator, tagProfile.Step);
            tagProfile.SetAccount("account", "hash", "hashMethod");
            Assert.AreEqual(RegistrationStep.Operator, tagProfile.Step);
        }
Beispiel #2
0
        public void SetAccount_ToAnInvalidValue_DoesNotIncrementStep()
        {
            TagProfile tagProfile = new TagProfile();

            Assert.AreEqual(RegistrationStep.Operator, tagProfile.Step);
            tagProfile.SetDomain("domain");
            Assert.AreEqual(RegistrationStep.Account, tagProfile.Step);
            tagProfile.SetAccount("", "hash", "hashMethod");
            Assert.AreEqual(RegistrationStep.Account, tagProfile.Step);
        }
Beispiel #3
0
        public void SetAccount_ToAValidValue_IncrementsStep()
        {
            TagProfile tagProfile = new TagProfile();

            Assert.AreEqual(RegistrationStep.Operator, tagProfile.Step);
            tagProfile.SetDomain("domain");
            Assert.AreEqual(RegistrationStep.Account, tagProfile.Step);
            tagProfile.SetAccount("account", "hash", "hashMethod");
            Assert.AreEqual(RegistrationStep.RegisterIdentity, tagProfile.Step);
        }
Beispiel #4
0
        public void SetIsValidated_WhenNotValidated_DoesNotIncrementsStep()
        {
            TagProfile tagProfile = new TagProfile();

            Assert.AreEqual(RegistrationStep.Operator, tagProfile.Step);
            tagProfile.SetDomain("domain");
            Assert.AreEqual(RegistrationStep.Account, tagProfile.Step);
            tagProfile.SetAccount("account", "hash", "hashMethod");
            Assert.AreEqual(RegistrationStep.RegisterIdentity, tagProfile.Step);
            tagProfile.SetIsValidated();
            Assert.AreEqual(RegistrationStep.RegisterIdentity, tagProfile.Step);
        }
Beispiel #5
0
        public void SetPin_IfNotOnPinStep_DoesNotIncrementStep()
        {
            TagProfile tagProfile = new TagProfile();

            Assert.AreEqual(RegistrationStep.Operator, tagProfile.Step);
            tagProfile.SetDomain("domain");
            Assert.AreEqual(RegistrationStep.Account, tagProfile.Step);
            tagProfile.SetAccount("account", "hash", "hashMethod");
            Assert.AreEqual(RegistrationStep.RegisterIdentity, tagProfile.Step);
            tagProfile.SetPin("pin", false);
            Assert.AreEqual(RegistrationStep.RegisterIdentity, tagProfile.Step);
        }
Beispiel #6
0
        public void ClearLegalIdentity_DecrementsStep()
        {
            TagProfile tagProfile = new TagProfile();

            Assert.AreEqual(RegistrationStep.Operator, tagProfile.Step);
            tagProfile.SetDomain("domain");
            Assert.AreEqual(RegistrationStep.Account, tagProfile.Step);
            tagProfile.SetAccount("account", "hash", "hashMethod");
            Assert.AreEqual(RegistrationStep.RegisterIdentity, tagProfile.Step);
            tagProfile.ClearLegalIdentity();
            Assert.AreEqual(RegistrationStep.Account, tagProfile.Step);
        }
Beispiel #7
0
        public void ClearAccount_DecrementsStepToOperator()
        {
            TagProfile tagProfile = new TagProfile();

            Assert.AreEqual(RegistrationStep.Operator, tagProfile.Step);
            tagProfile.SetDomain("domain");
            Assert.AreEqual(RegistrationStep.Account, tagProfile.Step);
            tagProfile.SetAccount("account", "hash", "hashMethod");
            tagProfile.SetLegalJId("jid");
            Assert.AreEqual(RegistrationStep.RegisterIdentity, tagProfile.Step);
            tagProfile.ClearAccount();
            Assert.AreEqual(RegistrationStep.Operator, tagProfile.Step);
            Assert.IsNull(tagProfile.LegalJid);
        }
Beispiel #8
0
        public void CompromiseLegalIdentity_DecrementsStep()
        {
            TagProfile tagProfile = new TagProfile();

            Assert.AreEqual(RegistrationStep.Operator, tagProfile.Step);
            tagProfile.SetDomain("domain");
            Assert.AreEqual(RegistrationStep.Account, tagProfile.Step);
            tagProfile.SetAccount("account", "hash", "hashMethod");
            Assert.AreEqual(RegistrationStep.RegisterIdentity, tagProfile.Step);
            LegalIdentity identity = CreateIdentity(IdentityState.Created);

            tagProfile.SetLegalIdentity(identity);
            Assert.AreEqual(RegistrationStep.ValidateIdentity, tagProfile.Step);
            tagProfile.CompromiseLegalIdentity(CreateIdentity(IdentityState.Compromised));
            Assert.AreEqual(RegistrationStep.RegisterIdentity, tagProfile.Step);
        }
Beispiel #9
0
        public void SetLegalIdentity_ToAValidValue2_IncrementsStep()
        {
            TagProfile tagProfile = new TagProfile();

            Assert.AreEqual(RegistrationStep.Operator, tagProfile.Step);
            tagProfile.SetDomain("domain");
            Assert.AreEqual(RegistrationStep.Account, tagProfile.Step);
            tagProfile.SetAccount("account", "hash", "hashMethod");
            Assert.AreEqual(RegistrationStep.RegisterIdentity, tagProfile.Step);
            LegalIdentity identity = new LegalIdentity {
                State = IdentityState.Approved
            };

            tagProfile.SetLegalIdentity(identity);
            Assert.AreEqual(RegistrationStep.ValidateIdentity, tagProfile.Step);
        }
Beispiel #10
0
        public void ClearPin_WhenNotComplete_DecrementsStep()
        {
            TagProfile tagProfile = new TagProfile();

            Assert.AreEqual(RegistrationStep.Operator, tagProfile.Step);
            tagProfile.SetDomain("domain");
            Assert.AreEqual(RegistrationStep.Account, tagProfile.Step);
            tagProfile.SetAccount("account", "hash", "hashMethod");
            Assert.AreEqual(RegistrationStep.RegisterIdentity, tagProfile.Step);
            LegalIdentity identity = new LegalIdentity {
                State = IdentityState.Approved
            };

            tagProfile.SetLegalIdentity(identity);
            Assert.AreEqual(RegistrationStep.ValidateIdentity, tagProfile.Step);
            tagProfile.SetIsValidated();
            Assert.AreEqual(RegistrationStep.Pin, tagProfile.Step);
            tagProfile.ClearPin();
            Assert.AreEqual(RegistrationStep.ValidateIdentity, tagProfile.Step);
        }
Beispiel #11
0
        public void ClearIsValidated_DecrementsStep()
        {
            TagProfile tagProfile = new TagProfile();

            Assert.AreEqual(RegistrationStep.Operator, tagProfile.Step);
            tagProfile.SetDomain("domain");
            Assert.AreEqual(RegistrationStep.Account, tagProfile.Step);
            tagProfile.SetAccount("account", "hash", "hashMethod");
            tagProfile.SetLegalJId("jid");
            Assert.AreEqual(RegistrationStep.RegisterIdentity, tagProfile.Step);
            LegalIdentity identity = new LegalIdentity {
                State = IdentityState.Approved
            };

            tagProfile.SetLegalIdentity(identity);
            Assert.AreEqual(RegistrationStep.ValidateIdentity, tagProfile.Step);
            tagProfile.ClearIsValidated();
            Assert.AreEqual(RegistrationStep.RegisterIdentity, tagProfile.Step);
            Assert.IsNull(tagProfile.LegalIdentity);
            Assert.AreEqual("jid", tagProfile.LegalJid);
        }
Beispiel #12
0
        public void SetLegalIdentity_ToAnInvalidValue_DoesNotIncrementStep()
        {
            TagProfile tagProfile = new TagProfile();

            Assert.AreEqual(RegistrationStep.Operator, tagProfile.Step);
            tagProfile.SetDomain("domain");
            Assert.AreEqual(RegistrationStep.Account, tagProfile.Step);
            tagProfile.SetAccount("account", "hash", "hashMethod");
            Assert.AreEqual(RegistrationStep.RegisterIdentity, tagProfile.Step);

            LegalIdentity identity = new LegalIdentity {
                State = IdentityState.Compromised
            };

            tagProfile.SetLegalIdentity(identity);
            Assert.AreEqual(RegistrationStep.RegisterIdentity, tagProfile.Step);
            identity.State = IdentityState.Obsoleted;
            tagProfile.SetLegalIdentity(identity);
            Assert.AreEqual(RegistrationStep.RegisterIdentity, tagProfile.Step);
            identity.State = IdentityState.Rejected;
            tagProfile.SetLegalIdentity(identity);
            Assert.AreEqual(RegistrationStep.RegisterIdentity, tagProfile.Step);
        }