Пример #1
0
        public void BuildWithFallBackPrioritizesFallbackArgumentsCorrectly()
        {
            const int InstanceSeedFallback = 500;
            const int DimensionsFallback   = 300;

            var fallback = new BbobRunnerConfiguration.BbobRunnerConfigurationBuilder()
                           .SetInstanceSeed(InstanceSeedFallback)
                           .SetDimensions(DimensionsFallback)
                           .Build();

            var config = new BbobRunnerConfiguration.BbobRunnerConfigurationBuilder()
                         .SetDimensions(BbobRunnerConfiguration.BbobRunnerConfigurationBuilder.DimensionsDefault)
                         .BuildWithFallback(fallback);

            config.Dimensions.ShouldBe(BbobRunnerConfiguration.BbobRunnerConfigurationBuilder.DimensionsDefault);
            config.InstanceSeed.ShouldBe(InstanceSeedFallback);
        }
Пример #2
0
        public void BuildWithFallBackPrioritizesFallbackArgumentsCorrectly()
        {
            const int    InstanceSeedFallback = 500;
            const int    DimensionsFallback   = 300;
            const string PythonBinFallback    = "dummy";
            const int    FunctionIdFallback   = 5;

            var fallback = new BbobRunnerConfiguration.BbobRunnerConfigurationBuilder()
                           .SetPythonBin(PythonBinFallback)
                           .SetFunctionId(FunctionIdFallback)
                           .SetInstanceSeed(InstanceSeedFallback)
                           .SetDimensions(DimensionsFallback)
                           .Build();

            var config = new BbobRunnerConfiguration.BbobRunnerConfigurationBuilder()
                         .SetDimensions(BbobRunnerConfiguration.BbobRunnerConfigurationBuilder.DimensionsDefault)
                         .BuildWithFallback(fallback);

            config.PythonBin.ShouldBe(PythonBinFallback);
            config.FunctionId.ShouldBe(FunctionIdFallback);
            config.Dimensions.ShouldBe(BbobRunnerConfiguration.BbobRunnerConfigurationBuilder.DimensionsDefault);
            config.InstanceSeed.ShouldBe(InstanceSeedFallback);
        }