Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 5653aa45 authored by Harald Martini's avatar Harald Martini
Browse files

Fixed error in CreateVifViewModel SetinputData

parent d6676692
No related branches found
No related tags found
No related merge requests found
......@@ -142,8 +142,8 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
}
Completed = inputDataProvider.Completed ?? false;
StageInputPath = inputDataProvider.StageInputData?.DataSource?.SourcePath;
PrimaryInputPath = inputDataProvider.StageInputData?.DataSource?.SourcePath;
StageInputPath = inputDataProvider.StageInputData?.DataSource?.SourceFile;
PrimaryInputPath = inputDataProvider.PrimaryVehicle?.DataSource?.SourceFile;
DataSource = inputData.DataSource;
UpdateTitleAndDocumentName();
}
......
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using System.Windows.Input;
using Ninject;
using NUnit.Framework;
using VECTO3GUI2020.ViewModel.Implementation;
using VECTO3GUI2020.ViewModel.Interfaces;
using VECTO3GUI2020.ViewModel.MultiStage.Implementation;
namespace Vecto3GUI2020Test.ViewModelTests
......@@ -168,5 +171,30 @@ namespace Vecto3GUI2020Test.ViewModelTests
Assert.IsNull(_createVifViewModel.PrimaryInputPath);
Assert.IsNull(_createVifViewModel.IsPrimaryExempted);
}
[Test]
public async Task SaveAndReload()
{
LoadValidNonExemptedFiles();
var primaryPath = _createVifViewModel.PrimaryInputPath;
var stagePath = _createVifViewModel.StageInputPath;
var savedToPath = _createVifViewModel.SaveJob("non_exempted.json");
WriteLine($"Saved to: {savedToPath}");
Assert.AreEqual(primaryPath, _createVifViewModel.PrimaryInputPath);
Assert.AreEqual(stagePath, _createVifViewModel.StageInputPath);
var jobListVm = _kernel.Get<IJobListViewModel>() as JobListViewModel;
var loadedDoc = await jobListVm.AddJobAsync(savedToPath) as CreateVifViewModel;
Assert.AreEqual(stagePath, loadedDoc.StageInputPath);
Assert.AreEqual(primaryPath, loadedDoc.PrimaryInputPath);
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment