Exemplo n.º 1
0
 public void Setup()
 {
     dataViewModel      = new Mock <IDataSelectViewModel>();
     trainingViewModel  = new Mock <ITrainingViewModel>();
     seletableViewModel = new Mock <ISelectableViewModel>();
     dataViewModel.Setup(item => item.Select).Returns(seletableViewModel.Object);
     fileMonitorFactory = new Mock <IFileMonitorFactory>();
     fileFolder         = new Mock <IFolderBrowserDialogService>();
     training           = TestConstants.GetTrainingResults();
 }
Exemplo n.º 2
0
        public void Create()
        {
            string path    = @"c:\";
            var    results = TestConstants.GetTrainingResults();

            Assert.Throws <ArgumentNullException>(() => instance.Create(null, results));
            Assert.Throws <ArgumentNullException>(() => instance.Create(path, null));
            var result = instance.Create(path, results);

            Assert.IsNotNull(result);
            result.Dispose();
        }
Exemplo n.º 3
0
 public void Setup()
 {
     manager              = new StateManager();
     training             = TestConstants.GetTrainingResults();
     dataViewModel        = new Mock <IDataSelectViewModel>();
     trainingManager      = new Mock <ITrainingManager>();
     dataHandler          = new Mock <IDataHandler <TrainingResults> >();
     documentSet          = new DocumentSet();
     documentSet.Document = new[] { new DocumentDefinition {
                                        Labels = new[] { "Test" }
                                    } };
 }
Exemplo n.º 4
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));
        }