Example #1
0
        public void ensureApplyRemovesUnnecessaryFinishes()
        {
            Console.WriteLine("ensureApplyRemovesUnnecessaryFinishes");
            Material                  material     = new Material("#24", "K6205", "ola.jpg", new List <Color>(new[] { Color.valueOf("Epigraph of the Closed Curve: Close Epigraph", 100, 100, 100, 100) }), new List <Finish>(new[] { Finish.valueOf("der alte wurfelt nicht", 12), Finish.valueOf("schrödinger's box", 13) }));
            ProductCategory           cat          = new ProductCategory("AI");
            DiscreteDimensionInterval discrete     = new DiscreteDimensionInterval(new List <double>(new[] { 50.0, 90.0, 100.0, 150.0 }));
            Measurement               measurement  = new Measurement(discrete, discrete, discrete);
            List <Measurement>        measurements = new List <Measurement>()
            {
                measurement
            };
            Product           product   = new Product("#12", "Mother Goose of Mutual Recursion: Recursive Mother Goose", "product12.glb", cat, new List <Material>(new[] { material }), measurements);
            Product           component = new Product("#13", "Mother Goose of Diffractive Recitavo: Diffraction Mother Goose", "product13.gltf", cat, new List <Material>(new[] { material }), measurements);
            CustomizedProduct custom    = CustomizedProductBuilder.createCustomizedProduct("#8", product, CustomizedDimensions.valueOf(100, 100, 100)).withMaterial(CustomizedMaterial.valueOf(material, Color.valueOf("Epigraph of the Closed Curve: Close Epigraph", 100, 100, 100, 100), Finish.valueOf("schrödinger's box", 13))).build();
            Algorithm         algorithm = new AlgorithmFactory().createAlgorithm(RestrictionAlgorithm.SAME_MATERIAL_AND_FINISH_ALGORITHM);

            Assert.Equal("schrödinger's box", algorithm.apply(custom, component).productMaterials[0].material.Finishes[0].description);
        }