Exemple #1
0
        /// <summary>
        /// Tests that a scenario definition won't be built if the mappings don't have the same number of scenarios
        /// </summary>
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expectedExceptions = IllegalArgumentException.class) public void ofMappingsDifferentNumberOfScenarios()
        public virtual void ofMappingsDifferentNumberOfScenarios()
        {
            PerturbationMapping <object>          mappingC = PerturbationMapping.of(FILTER_C, new TestPerturbation(27));
            IList <PerturbationMapping <object> > mappings = ImmutableList.of(MAPPING_A, MAPPING_B, mappingC);

            ScenarioDefinition.ofMappings(mappings);
        }
Exemple #2
0
        /// <summary>
        /// Tests that a scenario definition won't be built if the scenarios names are specified and there
        /// are the wrong number. The mappings all have 2 perturbations which should mean 2 scenarios, but
        /// there are 3 scenario names.
        /// </summary>
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expectedExceptions = IllegalArgumentException.class) public void ofMappingsWrongNumberOfScenarioNames()
        public virtual void ofMappingsWrongNumberOfScenarioNames()
        {
            IList <PerturbationMapping <object> > mappings = ImmutableList.of(MAPPING_A, MAPPING_B, MAPPING_C);
            IList <string> scenarioNames = ImmutableList.of("foo", "bar", "baz");

            ScenarioDefinition.ofMappings(mappings, scenarioNames);
        }
Exemple #3
0
        /// <summary>
        /// Tests that exceptions are thrown when the scenario names contain duplicate values.
        /// </summary>
        public virtual void nonUniqueNames()
        {
            IList <PerturbationMapping <object> > mappings2 = ImmutableList.of(MAPPING_A, MAPPING_B, MAPPING_C);
            IList <string> names2 = ImmutableList.of("foo", "foo");
            string         msg2   = "Scenario names must be unique but duplicates were found: foo";

            assertThrows(() => ScenarioDefinition.ofMappings(mappings2, names2), typeof(System.ArgumentException), msg2);
        }
Exemple #4
0
        public virtual void ofMappingsWithNames()
        {
            IList <PerturbationMapping <object> > mappings = ImmutableList.of(MAPPING_A, MAPPING_B, MAPPING_C);
            IList <string>     scenarioNames      = ImmutableList.of("foo", "bar");
            ScenarioDefinition scenarioDefinition = ScenarioDefinition.ofMappings(mappings, scenarioNames);

            assertThat(scenarioDefinition.Mappings).isEqualTo(mappings);
            assertThat(scenarioDefinition.ScenarioNames).isEqualTo(scenarioNames);
        }