Пример #1
0
        public void readfile_when_file_does_not_exist_throws_exception()
        {
            string fullFilePath = @"C:\temp\filename.txt";

            DeleteTestFile(fullFilePath);

            string readContent = _fileIO.ReadFile(fullFilePath);

            Assert.Fail("Expected exception when file does not exist");
        }
Пример #2
0
        public ICollectionBase LoadCollection(string fullFilePath)
        {
            // read from file system, parse, and initialize
            string jsonCollection = _fileIO.ReadFile(fullFilePath);

            try
            {
                _homeCollection = ConvertJsonToCollection(jsonCollection);
            }
            catch (Exception ex)
            {
                throw new CollectionException($"Unable to load collection: {fullFilePath}", ex);
            }
            return(_homeCollection);
        }