Ejemplo n.º 1
0
        public async Task LoadingSaving()
        {
            var file = Path.Combine(TestContext.CurrentContext.TestDirectory, Guid.NewGuid().ToString());
            TrainingResultsHandler loader = new TrainingResultsHandler(file);
            var data = await loader.Load(CancellationToken.None).ConfigureAwait(false);

            Assert.IsNull(data);
            data = TestConstants.GetTrainingResults();
            await loader.Save(data, CancellationToken.None).ConfigureAwait(false);

            data = await loader.Load(CancellationToken.None).ConfigureAwait(false);

            Assert.IsNotNull(data);
            Assert.IsTrue(Directory.Exists(file));
        }
Ejemplo n.º 2
0
        protected override void ConfigureContainer()
        {
            base.ConfigureContainer();
            LightSplitterHelper helper = new LightSplitterHelper();

            helper.Load();
            var documentParser = new DocumentParser(helper, new DevExpressParserFactory(20));
            var factory        = new FileManagerFactory(documentParser);

            Container.ComposeExportedValue <IFileManagerFactory>(factory);
            FileMonitorFactory monitorFactory = new FileMonitorFactory(documentParser);

            Container.ComposeExportedValue <IFileMonitorFactory>(monitorFactory);

            var documentHandler = new DocumentSetHandler(System.IO.Path.Combine(".", "documents.dat"));

            Container.ComposeExportedValue <IDataHandler <DocumentSet> >(documentHandler);

            var trainingResultLoader = new TrainingResultsHandler("Learning");

            Container.ComposeExportedValue <IDataHandler <TrainingResults> >(trainingResultLoader);
        }