Example #1
0
        public InformacoesDoCartaoDeCredito GetInformacoesDoCartaoDeCredito()
        {
            EnvironmentData environment = new EnvironmentData().GetEnvironmentData();

            var reader = new StreamReader(File.OpenRead(new DirectoryInfo(new System.Uri(Assembly.GetExecutingAssembly().CodeBase).AbsolutePath).Parent.Parent.Parent.FullName + Path.Combine(@"\Data\InformacoesDoCartaoDeCredito.csv")));
            Dictionary <string, string> informacoesDoCartaoDeCreditoDic = new Dictionary <string, string>();

            var header = reader.ReadLine().Split(';');
            var line   = reader.ReadLine().Split(';');

            for (int i = 0; i < line.Length; i++)
            {
                informacoesDoCartaoDeCreditoDic.Add(header[i], line[i]);
            }

            InformacoesDoCartaoDeCredito informacoesDoCartaoDeCredito = new InformacoesDoCartaoDeCredito();


            informacoesDoCartaoDeCredito.NumeroDoCartao       = informacoesDoCartaoDeCreditoDic["NumeroDoCartao"];
            informacoesDoCartaoDeCredito.NomeeSobreNome       = informacoesDoCartaoDeCreditoDic["NomeeSobreNome"];
            informacoesDoCartaoDeCredito.DataDeVencimento     = informacoesDoCartaoDeCreditoDic["DataDeVencimento"];
            informacoesDoCartaoDeCredito.CodigoDeSeguranca    = informacoesDoCartaoDeCreditoDic["CodigoDeSeguranca"];
            informacoesDoCartaoDeCredito.CPFDoTitularDoCartao = informacoesDoCartaoDeCreditoDic["CPFDoTitularDoCartao"];


            return(informacoesDoCartaoDeCredito);
        }
        public EnvironmentData GetEnvironmentData()
        {
            var reader = new StreamReader(File.OpenRead(new DirectoryInfo(new System.Uri(Assembly.GetExecutingAssembly().CodeBase).AbsolutePath).Parent.Parent.Parent.FullName + @"\Data\EnvironmentData.csv"));
            Dictionary <string, string> environmentDataDic = new Dictionary <string, string>();

            var header = reader.ReadLine().Split(';');
            var line   = reader.ReadLine().Split(';');

            for (int i = 0; i < line.Length; i++)
            {
                environmentDataDic.Add(header[i], line[i]);
            }

            EnvironmentData environmentData = new EnvironmentData();

            environmentData.UrlBase = environmentDataDic["UrlBase"];
            environmentData.Browser = environmentDataDic["Browser"];

            return(environmentData);
        }
Example #3
0
        public Usuario GetUsuario()
        {
            EnvironmentData environment = new EnvironmentData().GetEnvironmentData();

            var reader = new StreamReader(File.OpenRead(new DirectoryInfo(new System.Uri(Assembly.GetExecutingAssembly().CodeBase).AbsolutePath).Parent.Parent.Parent.FullName + Path.Combine(@"\Data\Usuario.csv")));
            Dictionary <string, string> userDic = new Dictionary <string, string>();

            var header = reader.ReadLine().Split(';');
            var line   = reader.ReadLine().Split(';');

            for (int i = 0; i < line.Length; i++)
            {
                userDic.Add(header[i], line[i]);
            }

            Usuario usuario = new Usuario();

            usuario.Login    = userDic["Login"];
            usuario.Password = userDic["Password"];

            return(usuario);
        }