예제 #1
0
        public void Cpf_DeveSerValido_False(string numeroCpf)
        {
            // Arrange
            Cpf Cpf;

            // Act
            Cpf = Cpf.Factory(numeroCpf);

            // Assert
            Assert.NotNull(Cpf);
            Assert.False(Cpf.EstaValido());
        }
예제 #2
0
        public void Cpf_QuandoCpfsSaoDiferentes_DeveGerarHashCodeDiferentes()
        {
            // Arrange
            var Cpf1 = Cpf.Factory("056.375.168-12");
            var Cpf2 = Cpf.Factory("100.295.118-60");

            // Act
            var hashcode1 = Cpf1.GetHashCode();
            var hashcode2 = Cpf2.GetHashCode();

            // Assert
            Assert.NotEqual(hashcode1, hashcode2);
        }
예제 #3
0
        public void Cpf_QuandoCpfsSaoIguais_DeveGerarMesmoHashCode()
        {
            // Arrange
            var Cpf1 = Cpf.Factory("056.375.168-12");
            var Cpf2 = Cpf.Factory("05637516812");

            // Act
            var hashcode1 = Cpf1.GetHashCode();
            var hashcode2 = Cpf2.GetHashCode();

            // Assert
            Assert.Equal(hashcode1, hashcode2);
        }
예제 #4
0
        public void Cpf_DeveFormatarCorretamente()
        {
            // Arrange
            string numeroCpfEsperado = "056.375.168-12";
            Cpf    Cpf;

            Cpf = Cpf.Factory(numeroCpfEsperado);

            // Act
            string CpfFormatado = Cpf.ToCpfFormat();

            // Assert
            Assert.Equal(numeroCpfEsperado, CpfFormatado);
        }
예제 #5
0
        public void Cpf_DeveSerDiferente_True()
        {
            // Arrange
            Cpf cpf1;
            Cpf cpf2;
            Cpf cpf3;

            // Act
            cpf1 = Cpf.Factory("056.375.168-12");
            cpf2 = Cpf.Factory("100.295.188-60");
            cpf3 = cpf1;

            // Assert
            Assert.True(cpf1 != cpf2);
            Assert.True(cpf2 != cpf3);
        }
예제 #6
0
        public void Cpf_DeveSerIgual_True()
        {
            // Arrange
            Cpf cpf1;
            Cpf cpf2;
            Cpf cpf3;

            // Act
            cpf1 = Cpf.Factory("056.375.168-12");
            cpf2 = Cpf.Factory("056.375.168-12");
            cpf3 = cpf1;

            // Assert
            Assert.True(cpf1 == cpf2);
            Assert.True(cpf2 == cpf3);
        }