public void ensureSameInstanceIsEqual()
        {
            var list = new List <double>();

            list.Add(3.0);
            DiscreteDimensionInterval instance = new DiscreteDimensionInterval(list);

            Assert.True(instance.Equals(instance));
        }
        public void ensureInstancesOfDifferentTypesAreNotEqual()
        {
            var list = new List <double>();

            list.Add(2.0);
            DiscreteDimensionInterval instance = new DiscreteDimensionInterval(list);

            Assert.False(instance.Equals("Lil Pump"));
        }
        public void ensureInstanceAndNullAreNotEqual()
        {
            var list = new List <double>();

            list.Add(4.0);
            DiscreteDimensionInterval instance = new DiscreteDimensionInterval(list);

            Assert.False(instance.Equals(null));
        }
        public void ensureInstancesWithSameListsAreEqual()
        {
            var list = new List <double>();

            list.Add(33.0);
            DiscreteDimensionInterval instance = new DiscreteDimensionInterval(list);
            DiscreteDimensionInterval other    = new DiscreteDimensionInterval(list);

            Assert.True(instance.Equals(other));
        }
        public void ensureInstancesWithDifferentListsAreNotEqual()
        {
            var list      = new List <double>();
            var otherList = new List <double>();

            list.Add(6.9);
            otherList.Add(4.20);
            DiscreteDimensionInterval instance = new DiscreteDimensionInterval(list);
            DiscreteDimensionInterval other    = new DiscreteDimensionInterval(otherList);

            Assert.False(instance.Equals(other));
        }
        public void ensureApplyRemovesValuesFromDiscreteDimensions()
        {
            Color  color  = Color.valueOf("Epigraph of the Closed Curve: Close Epigraph", 100, 100, 100, 100);
            Finish finish = Finish.valueOf("der alte wurfelt nicht", 20);

            Material                  material    = new Material("#24", "K6205", "12.jpg", new List <Color>(new[] { color }), new List <Finish>(new[] { finish }));
            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(new SingleValueDimension(200), discrete, new SingleValueDimension(50));

            List <Measurement> measurements = new List <Measurement>()
            {
                measurement
            };

            Product component = new Product("#13", "Mother Goose of Diffractive Recitavo: Diffraction Mother Goose", "13.glb", cat, new List <Material>(new[] { material }), measurements);
            Product product   = new Product("#12", "Mother Goose of Mutual Recursion: Recursive Mother Goose ", "12.fbx", cat, new List <Material>(new[] { material }), measurements, new List <Product>()
            {
                component
            });

            CustomizedMaterial   customizedMaterial   = CustomizedMaterial.valueOf(material, color, finish);
            CustomizedDimensions customizedDimensions = CustomizedDimensions.valueOf(200, 100, 50);
            CustomizedProduct    custom = CustomizedProductBuilder.createCustomizedProduct("12345", product, customizedDimensions).withMaterial(customizedMaterial).build();

            WidthPercentageAlgorithm algorithm = new WidthPercentageAlgorithm();
            Input minInput = Input.valueOf("Minimum Percentage", "From 0 to 1");
            Input maxInput = Input.valueOf("Maximum Percentage", "From 0 to 1");
            Dictionary <Input, string> inputs = new Dictionary <Input, string>();

            inputs.Add(minInput, "0.9");
            inputs.Add(maxInput, "1.0");
            algorithm.setInputValues(inputs);
            Product alteredProduct = algorithm.apply(custom, component);
            DiscreteDimensionInterval discreteDimension = (DiscreteDimensionInterval)alteredProduct.productMeasurements[0].measurement.width;
            DiscreteDimensionInterval expected          = new DiscreteDimensionInterval(new List <double>(new[] { 90.0, 100.0 }));

            Assert.True(discreteDimension.Equals(expected));
        }