public void Test_Triangle_And_Midpoint_With_Initial_Objects(int iterations, int expectedCount) { // Prepare the objects var A = new LooseConfigurationObject(Point); var B = new LooseConfigurationObject(Point); var C = new LooseConfigurationObject(Point); var P = new ConstructedConfigurationObject(Midpoint, A, B); var Q = new ConstructedConfigurationObject(Midpoint, B, C); var R = new ConstructedConfigurationObject(Midpoint, C, A); // Prepare the configuration var configuration = Configuration.DeriveFromObjects(Triangle, A, B, C, P, Q, R); // Prepare the input with just the midpoint construction var input = new ConfigurationGeneratorInput ( initialConfiguration: configuration, constructions: new HashSet <Construction> { Midpoint }.ToReadOnlyHashSet(), numberOfIterations: iterations, maximalNumbersOfObjectsToAdd: new Dictionary <ConfigurationObjectType, int> { { Point, int.MaxValue } }, configurationFilter: _ => true ); // Assert counts (can be verified by hand) GetGenerator(ConfigurationFilterType.Fast).Generate(input).ToArray().Length.Should().Be(expectedCount); GetGenerator(ConfigurationFilterType.MemoryEfficient).Generate(input).ToArray().Length.Should().Be(expectedCount); }
public void Test_Triangle_And_Various_Constructions_With_Limiting_Number_Of_Objects() { // Prepare the objects var A = new LooseConfigurationObject(Point); var B = new LooseConfigurationObject(Point); var C = new LooseConfigurationObject(Point); // Prepare the configuration var configuration = Configuration.DeriveFromObjects(Triangle, A, B, C); // Prepare the input with just the midpoint construction var input = new ConfigurationGeneratorInput ( initialConfiguration: configuration, constructions: new HashSet <Construction> { Midpoint, LineFromPoints, Circumcircle }.ToReadOnlyHashSet(), numberOfIterations: 42, maximalNumbersOfObjectsToAdd: new Dictionary <ConfigurationObjectType, int> { { Point, 1 }, { Line, 1 }, { Circle, 0 }, }, configurationFilter: _ => true ); // Assert counts (can be verified by hand) GetGenerator(ConfigurationFilterType.Fast).Generate(input).ToArray().Length.Should().Be(6); GetGenerator(ConfigurationFilterType.MemoryEfficient).Generate(input).ToArray().Length.Should().Be(6); }