Ejemplo n.º 1
0
            private static IEnumerable <TestCaseData> GetUnequalTestCases()
            {
                var random = new Random(21);
                MacroStabilityInwardsSoilProfile1D baseProfile = CreateSoilProfile();

                yield return(new TestCaseData(new MacroStabilityInwardsSoilProfile1D("Different name",
                                                                                     baseProfile.Bottom,
                                                                                     baseProfile.Layers))
                             .SetName("Name"));

                yield return(new TestCaseData(new MacroStabilityInwardsSoilProfile1D(baseProfile.Name,
                                                                                     baseProfile.Bottom - random.NextDouble(),
                                                                                     baseProfile.Layers))
                             .SetName("Bottom"));

                yield return(new TestCaseData(new MacroStabilityInwardsSoilProfile1D(baseProfile.Name,
                                                                                     baseProfile.Bottom,
                                                                                     new[]
                {
                    MacroStabilityInwardsSoilLayer1DTestFactory.CreateMacroStabilityInwardsSoilLayer1D(random.NextDouble())
                }))
                             .SetName("Layer"));

                yield return(new TestCaseData(new MacroStabilityInwardsSoilProfile1D(baseProfile.Name,
                                                                                     baseProfile.Bottom,
                                                                                     new[]
                {
                    MacroStabilityInwardsSoilLayer1DTestFactory.CreateMacroStabilityInwardsSoilLayer1D(random.NextDouble()),
                    MacroStabilityInwardsSoilLayer1DTestFactory.CreateMacroStabilityInwardsSoilLayer1D(random.NextDouble())
                }))
                             .SetName("Layer Count"));
            }
Ejemplo n.º 2
0
            private static MacroStabilityInwardsSoilProfile1D CreateSoilProfile()
            {
                var    random = new Random(21);
                double bottom = -random.NextDouble();

                return(new MacroStabilityInwardsSoilProfile1D("Profile Name", bottom, new[]
                {
                    MacroStabilityInwardsSoilLayer1DTestFactory.CreateMacroStabilityInwardsSoilLayer1D()
                }));
            }