Ejemplo n.º 1
0
        /// <summary>
        /// Writes a single <see cref="ScenarioConfiguration"/> as a scenario element in file.
        /// </summary>
        /// <param name="writer">The writer to use to write the scenario.</param>
        /// <param name="scenarioConfiguration">The scenario to write.</param>
        /// <exception cref="ArgumentNullException">Thrown when any of the input parameters is <c>null</c>.</exception>
        /// <exception cref="InvalidOperationException">Thrown when the <paramref name="writer"/>
        /// is closed.</exception>
        public static void WriteScenario(this XmlWriter writer, ScenarioConfiguration scenarioConfiguration)
        {
            if (writer == null)
            {
                throw new ArgumentNullException(nameof(writer));
            }

            if (scenarioConfiguration == null)
            {
                throw new ArgumentNullException(nameof(scenarioConfiguration));
            }

            writer.WriteStartElement(ConfigurationSchemaIdentifiers.ScenarioElement);

            if (scenarioConfiguration.IsRelevant.HasValue)
            {
                writer.WriteElementString(ConfigurationSchemaIdentifiers.IsRelevantForScenario,
                                          XmlConvert.ToString(scenarioConfiguration.IsRelevant.Value));
            }

            if (scenarioConfiguration.Contribution.HasValue)
            {
                writer.WriteElementString(ConfigurationSchemaIdentifiers.ScenarioContribution,
                                          XmlConvert.ToString(scenarioConfiguration.Contribution.Value));
            }

            writer.WriteEndElement();
        }
Ejemplo n.º 2
0
        protected BankingTestBase(ITestOutputHelper output)
        {
            var hostBuilder = new HostBuilder()
                              .ConfigureWebHost(builder =>
                                                builder
                                                .UseStartup <Startup>()
                                                .UseTestServer()
                                                .UseEnvironment("development"));

            _host = hostBuilder.Start();

            _httpClient = _host.GetTestClient();

            var scenario = ScenarioConfiguration
                           .WithStoryBook <BankingStory, BankingStoryData>()
                           .Configure(options =>
            {
                options.Client             = _httpClient;
                options.LogMessage         = output.WriteLine;
                options.Services           = _host.Services;
                options.BadRequestProvider = new MyBadRequestProvider();
            });

            MyScenario = scenario;
            Given      = scenario.Given;
            When       = scenario.When;
            Then       = scenario.Then;
        }
Ejemplo n.º 3
0
        public Calling_the_slow_running_end_point(ITestOutputHelper output)
        {
            var hostBuilder = new HostBuilder()
                              .ConfigureWebHost(builder =>
                                                builder
                                                .UseStartup <Startup>()
                                                .UseTestServer()
                                                .UseEnvironment("development"));

            _host = hostBuilder.Start();

            _httpClient = _host.GetTestClient();

            var scenario = ScenarioConfiguration
                           .Configure(options =>
            {
                options.MaxApiResponseTime = 2000;
                options.Client             = _httpClient;
                options.LogMessage         = output.WriteLine;
                options.Services           = _host.Services;
                options.BadRequestProvider = new MyBadRequestProvider();
            });

            When = scenario.When;
            Then = scenario.Then;
        }
Ejemplo n.º 4
0
        public void Constructor_ExpectedValues()
        {
            // Call
            var configuration = new ScenarioConfiguration();

            // Assert
            Assert.IsNull(configuration.Contribution);
            Assert.IsNull(configuration.IsRelevant);
        }
Ejemplo n.º 5
0
        private static ScenarioConfiguration CreateScenarioConfiguration()
        {
            var config = new ScenarioConfiguration(TimeSpan.FromMilliseconds(60000))
            {
                Iterations = (int)s_iterations
            };

            return(config);
        }
Ejemplo n.º 6
0
        public void GetScenarioConfiguration_OtherDescendantElement_ReturnsNull()
        {
            // Setup
            var xElement = new XElement("root", new XElement("OtherDescendantElement"));

            // Call
            ScenarioConfiguration configuration = xElement.GetScenarioConfiguration();

            // Assert
            Assert.IsNull(configuration);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Writes a scenario configuration when it has a value.
        /// </summary>
        /// <param name="writer">The writer to use for writing.</param>
        /// <param name="configuration">The configuration for the scenario that can be <c>null</c>.</param>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="writer"/> is <c>null</c>.</exception>
        /// <exception cref="InvalidOperationException">Thrown when the <paramref name="writer"/>
        /// is closed.</exception>
        protected static void WriteScenarioWhenAvailable(XmlWriter writer, ScenarioConfiguration configuration)
        {
            if (writer == null)
            {
                throw new ArgumentNullException(nameof(writer));
            }

            if (configuration != null)
            {
                writer.WriteScenario(configuration);
            }
        }
Ejemplo n.º 8
0
        static Program()
        {
            s_ScenarioConfiguration = new ScenarioConfiguration(TimeSpan.FromMilliseconds(20000))
            {
                Iterations = 11
            };

            // Set variables we will need to store results.
            s_iteration          = 0;
            s_startupTimes       = new double[s_ScenarioConfiguration.Iterations];
            s_requestTimes       = new double[s_ScenarioConfiguration.Iterations];
            s_targetArchitecture = "";
        }
Ejemplo n.º 9
0
        public JsonPlaceHolderTests(ITestOutputHelper output)
        {
            _httpClient = new HttpClient();
            var scenario = ScenarioConfiguration
                           .Configure(options =>
            {
                options.Client     = _httpClient;
                options.LogMessage = output.WriteLine;
            });

            When = scenario.When;
            Then = scenario.Then;
        }
        public JsonPlaceHolderTestsWithStoryBook(ITestOutputHelper output)
        {
            _httpClient = new HttpClient();
            var scenario = ScenarioConfiguration
                           .WithStoryBook <JsonPlaceHolderStoryBook, JsonPlaceHolderStoryData>()
                           .Configure(options =>
            {
                options.Client     = _httpClient;
                options.LogMessage = output.WriteLine;
            });

            Given = scenario.Given;
            When  = scenario.When;
            Then  = scenario.Then;
        }
Ejemplo n.º 11
0
        public void GetScenarioConfiguration_WithIsRelevant_ReturnsConfiguration()
        {
            // Setup
            const string isRelevant = "true";

            var isRelevantElement    = new XElement("gebruik", isRelevant);
            var configurationElement = new XElement("scenario", isRelevantElement);
            var xElement             = new XElement("root", configurationElement);

            // Call
            ScenarioConfiguration configuration = xElement.GetScenarioConfiguration();

            // Assert
            Assert.IsTrue(configuration.IsRelevant);
            Assert.IsNull(configuration.Contribution);
        }
Ejemplo n.º 12
0
        public void GetScenarioConfiguration_WithContribution_ReturnsConfiguration()
        {
            // Setup
            const double contribution = 2.1;

            var contributionElement  = new XElement("bijdrage", contribution);
            var configurationElement = new XElement("scenario", contributionElement);
            var xElement             = new XElement("root", configurationElement);

            // Call
            ScenarioConfiguration configuration = xElement.GetScenarioConfiguration();

            // Assert
            Assert.AreEqual(contribution, configuration.Contribution);
            Assert.IsNull(configuration.IsRelevant);
        }
Ejemplo n.º 13
0
        public void SimpleProperties_SetNewValue_GetsNewlySetValue()
        {
            // Setup
            var random        = new Random(236789);
            var configuration = new ScenarioConfiguration();

            double contribution = random.NextDouble();
            bool   isRelevant   = random.NextBoolean();

            // Call
            configuration.Contribution = contribution;
            configuration.IsRelevant   = isRelevant;

            // Assert
            Assert.AreEqual(contribution, configuration.Contribution);
            Assert.AreEqual(isRelevant, configuration.IsRelevant);
        }
        public void WriteScenarioWhenAvailable_ScenarioConfigurationSet_WriterCalledWithExpectedParameters()
        {
            // Setup
            var configuration = new ScenarioConfiguration();

            var mocks     = new MockRepository();
            var xmlWriter = mocks.StrictMock <XmlWriter>();

            xmlWriter.Expect(w => w.WriteScenario(configuration));
            mocks.ReplayAll();

            // Call
            ExposedCalculationConfigurationWriter.PublicWriteScenarioWhenAvailable(
                xmlWriter,
                configuration);

            // Assert
            mocks.VerifyAll();
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Assigns the <paramref name="scenarioConfiguration"/> parameters to the <paramref name="scenario"/>.
        /// </summary>
        /// <param name="scenarioConfiguration">The scenario configuration containing values for the parameters.</param>
        /// <param name="scenario">The input to assign the values to.</param>
        /// <returns><c>true</c> if no <paramref name="scenarioConfiguration"/> was given, or when
        /// the <paramref name="scenarioConfiguration"/> is not empty, <c>false</c> otherwise.</returns>
        protected bool TrySetScenarioParameters(ScenarioConfiguration scenarioConfiguration, ICalculationScenario scenario)
        {
            if (scenarioConfiguration == null)
            {
                return(true);
            }

            bool hasContribution = scenarioConfiguration.Contribution.HasValue;
            bool hasRelevance    = scenarioConfiguration.IsRelevant.HasValue;

            if (!hasContribution && !hasRelevance)
            {
                Log.LogCalculationConversionError(Resources.CalculationConfigurationImporter_TrySetScenarioParameters_Scenario_empty,
                                                  scenario.Name);
                return(false);
            }

            if (hasContribution)
            {
                double contribution = scenarioConfiguration.Contribution.Value;

                if (double.IsNaN(contribution))
                {
                    Log.LogCalculationConversionError(Resources.CalculationConfigurationImporter_TrySetScenarioParameters_ScenarioContribution_Invalid,
                                                      scenario.Name);
                    return(false);
                }

                scenario.Contribution = (RoundedDouble)(contribution / 100);
            }

            if (hasRelevance)
            {
                scenario.IsRelevant = scenarioConfiguration.IsRelevant.Value;
            }

            return(true);
        }
        public void ToScenarioConfiguration_ValidCalculationScenario_InstanceWithExpectedParametersSet()
        {
            // Setup
            var mocks    = new MockRepository();
            var scenario = mocks.Stub <ICalculationScenario>();

            mocks.ReplayAll();

            var           random       = new Random(21);
            RoundedDouble contribution = random.NextRoundedDouble();
            bool          relevant     = random.NextBoolean();

            scenario.Contribution = contribution;
            scenario.IsRelevant   = relevant;

            // Call
            ScenarioConfiguration configuration = scenario.ToScenarioConfiguration();

            // Assert
            Assert.AreEqual(contribution * 100, configuration.Contribution);
            Assert.AreEqual(relevant, configuration.IsRelevant);
            mocks.VerifyAll();
        }
Ejemplo n.º 17
0
        public CreatingABankAccount(ITestOutputHelper output)
        {
            var hostBuilder = new HostBuilder()
                              .ConfigureWebHost(builder =>
                                                builder
                                                .UseStartup <Startup>()
                                                .UseTestServer()
                                                .UseEnvironment("development"));

            _host = hostBuilder.Start();

            _httpClient = _host.GetTestClient();

            Scenario = ScenarioConfiguration
                       .Configure(options =>
            {
                options.Client     = _httpClient;
                options.LogMessage = output.WriteLine;
                options.Services   = _host.Services;
            });

            When = Scenario.When;
            Then = Scenario.Then;
        }
Ejemplo n.º 18
0
        public void GetScenarioConfiguration_WithAllParameters_ReturnsConfiguration()
        {
            // Setup
            var    random       = new Random(123);
            double contribution = random.NextDouble();
            bool   isRelevant   = random.NextBoolean();

            var contributionElement = new XElement("bijdrage", contribution);
            var isRelevantElement   = new XElement("gebruik", isRelevant
                                                                ? "true"
                                                                : "false");

            var configurationElement = new XElement("scenario",
                                                    contributionElement,
                                                    isRelevantElement);
            var xElement = new XElement("root", configurationElement);

            // Call
            ScenarioConfiguration configuration = xElement.GetScenarioConfiguration();

            // Assert
            Assert.AreEqual(contribution, configuration.Contribution);
            Assert.AreEqual(isRelevant, configuration.IsRelevant);
        }
Ejemplo n.º 19
0
        static void Main(string[] args)
        {
            var options = JitBenchHarnessOptions.Parse(args);

            SetupStatics(options);

            using (var h = new XunitPerformanceHarness(args))
            {
                ProcessStartInfo startInfo = options.UseExistingSetup ? UseExistingSetup() : CreateNewSetup();

                string scenarioName = "MusicStore";
                if (!startInfo.Environment.ContainsKey("DOTNET_MULTILEVEL_LOOKUP"))
                {
                    throw new InvalidOperationException("DOTNET_MULTILEVEL_LOOKUP was not defined.");
                }
                if (startInfo.Environment["DOTNET_MULTILEVEL_LOOKUP"] != "0")
                {
                    throw new InvalidOperationException("DOTNET_MULTILEVEL_LOOKUP was not set to 0.");
                }

                if (options.EnableTiering)
                {
                    startInfo.Environment.Add("COMPlus_EXPERIMENTAL_TieredCompilation", "1");
                    scenarioName += " Tiering";
                }

                if (options.Minopts)
                {
                    startInfo.Environment.Add("COMPlus_JITMinOpts", "1");
                    scenarioName += " Minopts";
                }

                if (options.DisableR2R)
                {
                    startInfo.Environment.Add("COMPlus_ReadyToRun", "0");
                    scenarioName += " NoR2R";
                }

                if (options.DisableNgen)
                {
                    startInfo.Environment.Add("COMPlus_ZapDisable", "1");
                    scenarioName += " NoNgen";
                }

                var program = new JitBenchHarness("JitBench");
                try
                {
                    var scenarioConfiguration = new ScenarioConfiguration(TimeSpan.FromMilliseconds(60000), startInfo)
                    {
                        Iterations            = (int)options.Iterations,
                        PreIterationDelegate  = program.PreIteration,
                        PostIterationDelegate = program.PostIteration,
                    };
                    var processesOfInterest = new string[] {
                        "dotnet.exe",
                    };
                    var modulesOfInterest = new string[] {
                        "Anonymously Hosted DynamicMethods Assembly",
                        "clrjit.dll",
                        "coreclr.dll",
                        "dotnet.exe",
                        "MusicStore.dll",
                        "ntoskrnl.exe",
                        "System.Private.CoreLib.dll",
                        "Unknown",
                    };

                    if (!File.Exists(startInfo.FileName))
                    {
                        throw new FileNotFoundException(startInfo.FileName);
                    }
                    if (!Directory.Exists(startInfo.WorkingDirectory))
                    {
                        throw new DirectoryNotFoundException(startInfo.WorkingDirectory);
                    }

                    h.RunScenario(scenarioConfiguration, teardownDelegate: () => {
                        return(program.PostRun("MusicStore", processesOfInterest, modulesOfInterest));
                    });
                }
                catch
                {
                    Console.WriteLine(program.StandardOutput);
                    Console.WriteLine(program.StandardError);
                    throw;
                }
            }
        }
 public bool PublicTrySetScenarioParameters(ScenarioConfiguration scenarioConfiguration, ICalculationScenario scenario)
 {
     return TrySetScenarioParameters(scenarioConfiguration, scenario);
 }
Ejemplo n.º 21
0
        public void WriteScenario_WithoutDifferentSetParameters_WritesExpectedParameters(ScenarioConfiguration configuration, string fileName)
        {
            // Setup
            string filePath = TestHelper.GetScratchPadPath(
                $"{nameof(WriteScenario_WithoutDifferentSetParameters_WritesExpectedParameters)}.{fileName}");

            try
            {
                using (XmlWriter xmlWriter = CreateXmlWriter(filePath))
                {
                    // Call
                    xmlWriter.WriteScenario(configuration);
                }

                // Assert
                string actualXml   = File.ReadAllText(filePath);
                string expectedXml = GetTestFileContent(fileName);
                Assert.AreEqual(expectedXml, actualXml);
            }
            finally
            {
                File.Delete(filePath);
            }
        }
 public static void PublicWriteScenarioWhenAvailable(XmlWriter writer, ScenarioConfiguration configuration)
 {
     WriteScenarioWhenAvailable(writer, configuration);
 }
Ejemplo n.º 23
0
        public static int Main(String [] args)
        {
            bool   doSetup            = true;
            bool   doBuild            = true;
            string runId              = "";
            string outputdir          = ".";
            string runOne             = null;
            bool   benchmarkSpecified = false;

            for (int i = 0; i < args.Length; i++)
            {
                if (String.Compare(args[i], "--nosetup", true) == 0)
                {
                    doSetup = false;
                }
                else if (String.Compare(args[i], "--nobuild", true) == 0)
                {
                    doSetup = false;
                    doBuild = false;
                }
                else if (String.Compare(args[i], "--perf:runid", true) == 0)
                {
                    if (i + 1 < args.Length)
                    {
                        runId = args[++i] + "-";
                    }
                    else
                    {
                        Console.WriteLine("Missing runID ");
                        return(UsageError());
                    }
                }
                else if (String.Compare(args[i], "--perf:outputdir", true) == 0)
                {
                    if (i + 1 < args.Length)
                    {
                        outputdir = args[++i];
                    }
                    else
                    {
                        Console.WriteLine("Missing output directory.");
                        return(UsageError());
                    }
                }
                else if (args[i].Equals("--target-architecture", StringComparison.OrdinalIgnoreCase))
                {
                    if (i + 1 < args.Length)
                    {
                        ++i; // Ignore this argument.
                    }
                    else
                    {
                        Console.WriteLine("Missing target architecture.");
                        return(UsageError());
                    }
                }
                else if (args[i][0] == '-')
                {
                    Console.WriteLine("Unknown Option {0}", args[i]);
                    return(UsageError());
                }
                else
                {
                    foreach (Benchmark benchmark in Benchmarks)
                    {
                        if (String.Compare(args[i], benchmark.Name, true) == 0)
                        {
                            benchmark.SetToRun();
                            benchmarkSpecified = true;
                            break;
                        }
                    }

                    if (!benchmarkSpecified)
                    {
                        Console.WriteLine("Unknown Benchmark {0}", args[i]);
                    }
                }
            }

            // If benchmarks are not explicitly specified, run the default set of benchmarks
            if (!benchmarkSpecified)
            {
                foreach (Benchmark benchmark in Benchmarks)
                {
                    if (benchmark.runByDefault)
                    {
                        benchmark.SetToRun();
                    }
                }
            }

            // Workspace is the ROOT of the coreclr tree.
            // If CORECLR_REPO is not set, the script assumes that the location of sandbox
            // is <path>\coreclr\sandbox.
            LinkBenchRoot = Directory.GetCurrentDirectory();
            Workspace     = Environment.GetEnvironmentVariable("CORECLR_REPO");
            if (Workspace == null)
            {
                Workspace = Directory.GetParent(LinkBenchRoot).FullName;
            }
            if (Workspace == null)
            {
                Console.WriteLine("CORECLR_REPO not found");
                return(-1);
            }

            string linkBenchSrcDir = Workspace + "\\tests\\src\\performance\\linkbench\\";

            ScriptDir = linkBenchSrcDir + "scripts\\";
            AssetsDir = linkBenchSrcDir + "assets\\";

            Environment.SetEnvironmentVariable("LinkBenchRoot", LinkBenchRoot);
            Environment.SetEnvironmentVariable("__dotnet", LinkBenchRoot + "\\.Net\\dotnet.exe");
            Environment.SetEnvironmentVariable("__dotnet2", LinkBenchRoot + "\\.Net2\\dotnet.exe");


            // Update the build files to facilitate the link step
            if (doSetup)
            {
                // Clone the benchmarks
                using (var setup = new Process())
                {
                    setup.StartInfo.FileName = ScriptDir + "clone.cmd";
                    setup.Start();
                    setup.WaitForExit();
                    if (setup.ExitCode != 0)
                    {
                        Console.WriteLine("Benchmark Setup failed");
                        return(-2);
                    }
                }

                // Setup the benchmarks

                foreach (Benchmark benchmark in Benchmarks)
                {
                    if (benchmark.doRun && benchmark.Setup != null)
                    {
                        benchmark.Setup();
                    }
                }
            }

            if (doBuild)
            {
                // Run the setup Script, which clones, builds and links the benchmarks.
                using (var setup = new Process())
                {
                    setup.StartInfo.FileName  = ScriptDir + "build.cmd";
                    setup.StartInfo.Arguments = AssetsDir;
                    setup.Start();
                    setup.WaitForExit();
                    if (setup.ExitCode != 0)
                    {
                        Console.WriteLine("Benchmark build failed");
                        return(-3);
                    }
                }
            }

            // Since this is a size measurement scenario, there are no iterations
            // to perform. So, create a process that does nothing, to satisfy XUnit.
            // All size measurements are performed PostRun()
            var emptyCmd = new ProcessStartInfo()
            {
                FileName = ScriptDir + "empty.cmd"
            };

            for (int i = 0; i < Benchmarks.Length; i++)
            {
                CurrentBenchmark = Benchmarks[i];
                if (!CurrentBenchmark.doRun)
                {
                    continue;
                }

                string[] scriptArgs =
                {
                    "--perf:runid",     runId + CurrentBenchmark.Name,
                    "--perf:outputdir", outputdir
                };
                using (var h = new XunitPerformanceHarness(scriptArgs))
                {
                    var configuration = new ScenarioConfiguration(new TimeSpan(2000000), emptyCmd);
                    h.RunScenario(configuration, PostRun);
                }
            }

            return(0);
        }
        private static void AssertConfiguration(MacroStabilityInwardsCalculationConfiguration configuration, bool hydraulicBoundaryLocation)
        {
            Assert.AreEqual("Calculation", configuration.Name);

            if (hydraulicBoundaryLocation)
            {
                Assert.IsNull(configuration.AssessmentLevel);
                Assert.AreEqual("Locatie", configuration.HydraulicBoundaryLocationName);
            }
            else
            {
                Assert.AreEqual(1.1, configuration.AssessmentLevel);
                Assert.IsNull(configuration.HydraulicBoundaryLocationName);
            }

            Assert.AreEqual("Profielschematisatie", configuration.SurfaceLineName);
            Assert.AreEqual("Ondergrondmodel", configuration.StochasticSoilModelName);
            Assert.AreEqual("Ondergrondschematisatie", configuration.StochasticSoilProfileName);

            Assert.AreEqual(ConfigurationDikeSoilScenario.SandDikeOnClay, configuration.DikeSoilScenario);
            Assert.AreEqual(10.5, configuration.WaterLevelRiverAverage);

            Assert.IsTrue(configuration.DrainageConstructionPresent);
            Assert.AreEqual(10.6, configuration.XCoordinateDrainageConstruction);
            Assert.AreEqual(10.7, configuration.ZCoordinateDrainageConstruction);

            Assert.AreEqual(10.9, configuration.MinimumLevelPhreaticLineAtDikeTopRiver);
            Assert.AreEqual(10.8, configuration.MinimumLevelPhreaticLineAtDikeTopPolder);

            Assert.IsTrue(configuration.AdjustPhreaticLine3And4ForUplift);

            Assert.AreEqual(20.1, configuration.PiezometricHeadPhreaticLine2Inwards);
            Assert.AreEqual(20.2, configuration.PiezometricHeadPhreaticLine2Outwards);
            Assert.AreEqual(10.1, configuration.LeakageLengthInwardsPhreaticLine3);
            Assert.AreEqual(10.2, configuration.LeakageLengthOutwardsPhreaticLine3);
            Assert.AreEqual(10.3, configuration.LeakageLengthInwardsPhreaticLine4);
            Assert.AreEqual(10.4, configuration.LeakageLengthOutwardsPhreaticLine4);

            MacroStabilityInwardsLocationInputConfiguration dailyConfiguration = configuration.LocationInputDaily;

            Assert.IsNotNull(dailyConfiguration);
            Assert.AreEqual(2.2, dailyConfiguration.WaterLevelPolder);
            Assert.IsTrue(dailyConfiguration.UseDefaultOffsets);
            Assert.AreEqual(2.21, dailyConfiguration.PhreaticLineOffsetBelowDikeTopAtRiver);
            Assert.AreEqual(2.24, dailyConfiguration.PhreaticLineOffsetBelowDikeToeAtPolder);
            Assert.AreEqual(2.22, dailyConfiguration.PhreaticLineOffsetBelowDikeTopAtPolder);
            Assert.AreEqual(2.23, dailyConfiguration.PhreaticLineOffsetBelowShoulderBaseInside);

            MacroStabilityInwardsLocationInputExtremeConfiguration extremeConfiguration = configuration.LocationInputExtreme;

            Assert.IsNotNull(extremeConfiguration);
            Assert.AreEqual(15.2, extremeConfiguration.WaterLevelPolder);
            Assert.AreEqual(16.2, extremeConfiguration.PenetrationLength);
            Assert.IsFalse(extremeConfiguration.UseDefaultOffsets);
            Assert.AreEqual(15.21, extremeConfiguration.PhreaticLineOffsetBelowDikeTopAtRiver);
            Assert.AreEqual(15.24, extremeConfiguration.PhreaticLineOffsetBelowDikeToeAtPolder);
            Assert.AreEqual(15.22, extremeConfiguration.PhreaticLineOffsetBelowDikeTopAtPolder);
            Assert.AreEqual(15.23, extremeConfiguration.PhreaticLineOffsetBelowShoulderBaseInside);

            Assert.AreEqual(0.4, configuration.SlipPlaneMinimumDepth);
            Assert.AreEqual(0.5, configuration.SlipPlaneMinimumLength);
            Assert.AreEqual(0.6, configuration.MaximumSliceWidth);

            Assert.IsTrue(configuration.CreateZones);
            Assert.AreEqual(ConfigurationZoningBoundariesDeterminationType.Manual, configuration.ZoningBoundariesDeterminationType);
            Assert.AreEqual(10.0, configuration.ZoneBoundaryLeft);
            Assert.AreEqual(43.5, configuration.ZoneBoundaryRight);

            Assert.IsTrue(configuration.MoveGrid);
            Assert.AreEqual(ConfigurationGridDeterminationType.Automatic, configuration.GridDeterminationType);

            Assert.AreEqual(ConfigurationTangentLineDeterminationType.LayerSeparated, configuration.TangentLineDeterminationType);
            Assert.AreEqual(10, configuration.TangentLineZTop);
            Assert.AreEqual(1, configuration.TangentLineZBottom);
            Assert.AreEqual(5, configuration.TangentLineNumber);

            MacroStabilityInwardsGridConfiguration leftGridConfiguration = configuration.LeftGrid;

            Assert.IsNotNull(leftGridConfiguration);
            Assert.IsNaN(leftGridConfiguration.XLeft);
            Assert.IsNaN(leftGridConfiguration.XRight);
            Assert.IsNaN(leftGridConfiguration.ZTop);
            Assert.IsNaN(leftGridConfiguration.ZBottom);
            Assert.AreEqual(6, leftGridConfiguration.NumberOfVerticalPoints);
            Assert.AreEqual(5, leftGridConfiguration.NumberOfHorizontalPoints);

            MacroStabilityInwardsGridConfiguration rightGridConfiguration = configuration.RightGrid;

            Assert.IsNotNull(rightGridConfiguration);
            Assert.AreEqual(1, rightGridConfiguration.XLeft);
            Assert.AreEqual(2, rightGridConfiguration.XRight);
            Assert.AreEqual(4, rightGridConfiguration.ZTop);
            Assert.AreEqual(3, rightGridConfiguration.ZBottom);
            Assert.AreEqual(5, rightGridConfiguration.NumberOfVerticalPoints);
            Assert.AreEqual(6, rightGridConfiguration.NumberOfHorizontalPoints);

            ScenarioConfiguration scenarioConfiguration = configuration.Scenario;

            Assert.IsNotNull(scenarioConfiguration);
            Assert.AreEqual(8.8, scenarioConfiguration.Contribution);
            Assert.IsFalse(scenarioConfiguration.IsRelevant);
        }