/// <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 TestGetAccountNode() { _fileHandler.FileSys = TestFileSystem.CreateFileSystem(); IXmlAccountConfig indexSpecification = new XmlAccountConfig(_accountConfigPath, _fileHandler); Assert.Equal("99802", indexSpecification.GetAccountNode("99802").FirstChild.InnerText); }
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); }
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); }