Example #1
0
        public void Cei_DeveSerValido_True(string numeroCei)
        {
            // Arrange
            Cei Cei;

            // Act
            Cei = Cei.Factory(numeroCei);

            // Assert
            Assert.NotNull(Cei);
            Assert.True(Cei.EstaValido());
        }
Example #2
0
        public void Cei_QuandoCeisSaoDiferentes_DeveGerarHashCodeDiferentes()
        {
            // Arrange
            var Cei1 = Cei.Factory("20.381.44217/87");
            var Cei2 = Cei.Factory("27.247.25187/86");

            // Act
            var hashcode1 = Cei1.GetHashCode();
            var hashcode2 = Cei2.GetHashCode();

            // Assert
            Assert.NotEqual(hashcode1, hashcode2);
        }
Example #3
0
        public void Cei_QuandoCeisSaoIguais_DeveGerarMesmoHashCode()
        {
            // Arrange
            var Cei1 = Cei.Factory("20.381.44217/87");
            var Cei2 = Cei.Factory("203814421787");

            // Act
            var hashcode1 = Cei1.GetHashCode();
            var hashcode2 = Cei2.GetHashCode();

            // Assert
            Assert.Equal(hashcode1, hashcode2);
        }
Example #4
0
        public void Cei_DeveFormatarCorretamente()
        {
            // Arrange
            string numeroCeiEsperado = "27.247.25187/86";
            Cei    Cei;

            Cei = Cei.Factory(numeroCeiEsperado);

            // Act
            string CeiFormatado = Cei.ToCeiFormat();

            // Assert
            Assert.Equal(numeroCeiEsperado, CeiFormatado);
        }
Example #5
0
        public void Cei_DeveSerDiferente_True()
        {
            // Arrange
            Cei Cei1;
            Cei Cei2;
            Cei Cei3;

            // Act
            Cei1 = Cei.Factory("24.985.96743/86");
            Cei2 = Cei.Factory("27.247.25187/86");
            Cei3 = Cei1;

            // Assert
            Assert.True(Cei1 != Cei2);
            Assert.True(Cei2 != Cei3);
        }
Example #6
0
        public void Cei_DeveSerIgual_True()
        {
            // Arrange
            Cei Cei1;
            Cei Cei2;
            Cei Cei3;

            // Act
            Cei1 = Cei.Factory("24.985.96743/86");
            Cei2 = Cei.Factory("24.985.96743/86");
            Cei3 = Cei1;

            // Assert
            Assert.True(Cei1 == Cei2);
            Assert.True(Cei2 == Cei3);
        }
Example #7
0
        public void IdData_Criar_USBFile(int Terminal, string Arquivo, List <int> Funcionarios)
        {
            AddLog("GERANDO " + Funcionarios.Count + " FUNCIONÁRIO(S), ARQUIVO: " + Arquivo + " ");

            DB db = new DB();

            string Identificador;
            string Nome;
            ulong  Cei;
            string Endereco;
            byte   IdentificadorTipo;

            db.LerEmpresa(Terminal, out IdentificadorTipo, out Identificador, out Nome, out Cei, out Endereco);

            string strPath            = Arquivo;
            uint   uiQuantityUsers    = Convert.ToUInt32(Funcionarios.Count);
            string strEmployerName    = Nome;
            string strCNPJ_CPF        = Identificador;
            string strCEI             = Cei.ToString();
            string strEmployerAddress = Endereco;
            string strNFR             = "";

            try
            {
                int iReturn = this.objIDSysR30.CreateFile(strPath, uiQuantityUsers, strEmployerName, strCNPJ_CPF, strCEI, strEmployerAddress, strNFR);

                if (iReturn < 0)
                {
                    AddLog("Erro ao criar o arquivo " + strPath + ". Erro: " + iReturn.ToString());
                    return;
                }

                for (int i = 0; i <= Funcionarios.Count - 1; i++)
                {
                    IdData_Exportar_USBUser(db, Funcionarios[i]);
                }

                IdData_Fechar_USBFile();
            }
            catch (Exception exError)
            {
                AddLog("Erro : " + exError.Message);
            }
        }