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

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

added Setup method to initialize properties per thread

parent 34c625e7
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,7 @@ public class PrimaryBusSimulation
private ThreadLocal<StandardKernel> _kernel;
private StandardKernel Kernel => _kernel.Value;
private IXMLInputDataReader _xmlReader;
[OneTimeSetUp]
......@@ -50,10 +51,17 @@ public class PrimaryBusSimulation
_kernel = new ThreadLocal<StandardKernel>(() => new StandardKernel(new VectoNinjectModule()));
_xmlReader = Kernel.Get<IXMLInputDataReader>();
}
[SetUp]
public void Setup()
{
Kernel.Rebind<IDeclarationCycleFactory>().To<TestDeclarationCycleFactoryVariant>().InSingletonScope();
var cycleFactory = Kernel.Get<IDeclarationCycleFactory>() as TestDeclarationCycleFactoryVariant;
cycleFactory.Variant = "Short_10";
}
}
[
......
......@@ -43,7 +43,10 @@ namespace TUGraz.VectoCore.Tests.Utils
{
private const string BASE_PATH = "Resources/Missions/";
public TestDeclarationCycleFactoryVariant() { }
public TestDeclarationCycleFactoryVariant()
{
}
public string Variant { get; set; } = "Short_10";
......
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