Example #1
0
        public void ReadFromSqlServer_ShouldReturnAllFiles_AsAddressBookObject()
        {
            //Arrange
            AddressBooks addressBooks = new AddressBooks();

            //Act
            SqlServerOperation.ReadFromSqlServer(ref addressBooks);
            //Assert
            Assert.AreEqual(2, addressBooks._multiAddressBooks["General"].AddressBook.Count);
        }
Example #2
0
        /// <summary>
        /// Read contact details from XML/ CSV / JSON file
        /// and store in AddressBooks class instance
        /// </summary>
        /// <param name="addressBooksCollection">reference to addressbooks instance to store contact details</param>
        private static void FileReadingOperation(ref AddressBooks addressBooksCollection)
        {
            LogDetails logDetails = new LogDetails();

            try
            {
                //IoOperations.DeserializeAddressBooks(ref addressBooksCollection);
                //CsvOperations.ReadFromCsv(ref addressBooksCollection);
                //JsonOperation.ReadFromJson(ref addressBooksCollection);
                SqlServerOperation.ReadFromSqlServer(ref addressBooksCollection);
            }
            catch (Exception e)
            {
                logDetails.LogDebug("IO Error in Reading operation");
                logDetails.LogError(e.Message);
            }
        }