示例#1
0
		public void RevertLowerValidFiscalCode()
		{
			var lowerFiscalCode = Known.FiscalCodes.FemaleCode.ToLower();
			var revertFiscalCode = new RevertedFiscalCode(lowerFiscalCode);
			revertFiscalCode.IsValid.Should().Be.True();
			revertFiscalCode.BirthDate.HasValue.Should().Be.True();
		}
示例#2
0
		public void ValidateFemaleFiscalCodeIsCorrect()
		{
			var fiscalCode = new RevertedFiscalCode(Known.FiscalCodes.FemaleCode);
			fiscalCode.Control.Should().Be.EqualTo("W");
			fiscalCode.BirthDate.Should().Be.EqualTo(new DateTime(1992, 8, 20));
			fiscalCode.IsValid.Should().Be.True();
		}
示例#3
0
		public void RevertNotValidFiscalCode()
		{
			var wrongFiscalCode = 'U' + Known.FiscalCodes.FemaleCode.Substring(1);
			var revertFiscalCode = new RevertedFiscalCode(wrongFiscalCode);
			revertFiscalCode.IsValid.Should().Be.False();
			revertFiscalCode.BirthDate.HasValue.Should().Be.False();
		}
示例#4
0
		public void ValidateMaleFiscalCodeWithSpaceInNameIsCorrect()
		{
			var fiscalCode = new RevertedFiscalCode(Known.FiscalCodes.MaleWothSpaceInNameCode);
			fiscalCode.Control.Should().Be.EqualTo("S");
			fiscalCode.BirthDate.Should().Be.EqualTo(new DateTime(1960, 1, 1));
			fiscalCode.IsValid.Should().Be.True();
		}
示例#5
0
        public void RevertLowerValidFiscalCode()
        {
            var lowerFiscalCode  = Known.FiscalCodes.FemaleCode.ToLower();
            var revertFiscalCode = new RevertedFiscalCode(lowerFiscalCode);

            revertFiscalCode.IsValid.Should().BeTrue();
            revertFiscalCode.BirthDate.HasValue.Should().BeTrue();
        }
示例#6
0
        public void RevertNotValidFiscalCode()
        {
            var wrongFiscalCode  = 'U' + Known.FiscalCodes.FemaleCode.Substring(1);
            var revertFiscalCode = new RevertedFiscalCode(wrongFiscalCode);

            revertFiscalCode.IsValid.Should().BeFalse();
            revertFiscalCode.BirthDate.HasValue.Should().BeFalse();
        }
示例#7
0
        public void ValidateFemaleFiscalCodeIsCorrect()
        {
            var fiscalCode = new RevertedFiscalCode(Known.FiscalCodes.FemaleCode);

            fiscalCode.Control.Should().Be("W");
            fiscalCode.BirthDate.Should().Be(new DateTime(1992, 8, 20));
            fiscalCode.IsValid.Should().BeTrue();
        }
示例#8
0
        public void ValidateMaleFiscalCodeWithSpaceInNameIsCorrect()
        {
            var fiscalCode = new RevertedFiscalCode(Known.FiscalCodes.MaleWothSpaceInNameCode);

            fiscalCode.Control.Should().Be("S");
            fiscalCode.BirthDate.Should().Be(new DateTime(1960, 1, 1));
            fiscalCode.IsValid.Should().BeTrue();
        }