Ejemplo n.º 1
0
        protected static List <T> GetObjectFromFileXml <T>(string fileName)
        {
            List <T> retval = new List <T>();

            using (StreamReader reader =
                       new StreamReader(HelperBase.GetDataFileFullPath(fileName)))
            {
                retval =
                    (List <T>) new XmlSerializer(typeof(List <T>)).Deserialize(reader);
            }
            return(retval);
        }
        public ApplicationManager()
        {
            FirefoxDriverFactory driverFactory = new FirefoxDriverFactory();

            Driver = driverFactory.GetFirefoxDriver();

            AccountFactory   = new AccountFactory();
            Environment      = new TestingEnvironment();
            HelperBase       = new HelperBase(this);
            LoginHelper      = new LoginHelper(this);
            NavigationHelper = new NavigationHelper(this, Environment);
            GroupHelper      = new GroupHelper(this);
            ContactHelper    = new ContactHelper(this);
        }
Ejemplo n.º 3
0
 private static List <ContactData> GetContactsFromFileCsv()
 {
     if (null == _contactsFromFile)
     {
         _contactsFromFile = new List <ContactData>();
         var engine = new FileHelperEngine <ContactDataCsv>();
         var contactsFromFileCsv =
             new List <ContactDataCsv>(engine.ReadFile(HelperBase.GetDataFileFullPath("Contacts.csv")));
         foreach (var contactDataCsv in contactsFromFileCsv)
         {
             _contactsFromFile.Add(contactDataCsv.ContactData());
         }
     }
     return(_contactsFromFile);
 }
Ejemplo n.º 4
0
        protected static List <T> GetObjectFromFileJson <T>(string fileName)
        {
            List <T> retval = new List <T>();

            using (StreamReader reader =
                       new StreamReader(HelperBase.GetDataFileFullPath(fileName)))
            {
                string jsonDataRaw = reader.ReadToEnd();
                JArray deserialisedJsonContactData = (JArray)JsonConvert.DeserializeObject(jsonDataRaw);
                foreach (var contactData in deserialisedJsonContactData)
                {
                    retval.Add(contactData.ToObject <T>());
                }
            }

            return(retval);
        }