Exemple #1
0
        /// <summary>
        /// initializes the IdxBuilder object of the FileExporter
        /// </summary>
        public void InitializeIdxBuilder()
        {
            XmlAccountConfig         accountConfig      = new XmlAccountConfig(ExportModel.AccountConfig, _fileHandler);
            XmlIdxIndexSpecification indexSpecification = new XmlIdxIndexSpecification(ExportModel.IdxIndexSpecification, _fileHandler);

            _idxBuilder = new IdxBuilder(accountConfig, indexSpecification, _fileHandler);
        }
        public void TestGetRootNode()
        {
            _fileHandler.FileSys = TestFileSystem.CreateFileSystem();

            IXmlIdxIndexSpecification indexSpecification = new XmlIdxIndexSpecification(_idxSpecification, _fileHandler);

            indexSpecification.GetIndexListNode();

            Assert.Equal("Index", indexSpecification.GetIndexListNode().Name);
        }
Exemple #3
0
        public void TestCreateIdxForDestinationNotExisting()
        {
            //Arrange
            XmlAccountConfig         accountConfig      = new XmlAccountConfig(@"c:\NotfallImporter\AccountConfig.xml", _fileHandler);
            XmlIdxIndexSpecification indexSpecification = new XmlIdxIndexSpecification(@"c:\NotfallImporter\IdxIndexSpezifikation.xml", _fileHandler);

            IdxBuilder idxBuilder = new IdxBuilder(accountConfig, indexSpecification);
            Action     a          = () => idxBuilder.BuildIdx(new ExportFile(_fileHandler.FileSys.FileInfo.FromFileName(@"c:\NotfallImporter\Error\vmi_20190304121156_99998_0000798569_0170631125_0123456789.zip")));

            //Act and Assert
            Assert.Throws <DirectoryNotFoundException>(a);
        }
Exemple #4
0
        public void TestCreateIdx()
        {
            //Arrange

            XmlAccountConfig         accountConfig      = new XmlAccountConfig(@"c:\NotfallImporter\AccountConfig.xml", _fileHandler);
            XmlIdxIndexSpecification indexSpecification = new XmlIdxIndexSpecification(@"c:\NotfallImporter\IdxIndexSpezifikation.xml", _fileHandler);

            IdxBuilder idxBuilder = new IdxBuilder(accountConfig, indexSpecification, _fileHandler);
            //Act
            IdxRepresentation idx = idxBuilder.BuildIdx(new ExportFile(_fileHandler.FileSys.FileInfo.FromFileName(@"c:\NotfallImporter\Error\vmi_20190304121156_99998_0000798569_0170631125_0123456789.zip")));

            //Assert
            Assert.True(_fileHandler.FileSys.File.Exists(@"c:\NotfallImporter\Import\vmi_20190304121156_99998_0000798569_0170631125_0123456789.idx"));
            string idxText = _fileHandler.FileSys.File.ReadAllText(@"c:\NotfallImporter\Import\vmi_20190304121156_99998_0000798569_0170631125_0123456789.idx");

            Assert.Equal("99998;200\r\n", idxText);
        }