public void Apply_With_No_Point()
        {
            var msf = new MembershipFunction();

            var sut = new ProdMsfScalingStrategy();

            var result = sut.Apply(msf, 0.5);

            Assert.AreEqual(0, result.Count);
        }
        public void Apply_With_One_Point()
        {
            var msf = new MembershipFunction{ { 0, 0.7 } };

            var sut = new ProdMsfScalingStrategy();

            var result1 = sut.Apply(msf, 0.5);

            Assert.AreEqual(1, result1.Count);
            foreach (var point in result1)
                Assert.AreEqual(0.5*0.7, point.Value);
        }
        public void Apply_With_Inverse_Triangle()
        {
            var msf = new MembershipFunction{ { 0, 1 }, { 1, 0 }, { 2, 1 } };

            var sut = new ProdMsfScalingStrategy();

            var result = sut.Apply(msf, 0.5);

            Assert.AreEqual(3, result.Count);

            Assert.IsTrue(result.Contains(new KeyValuePair<double, double>(0, 0.5)));
            Assert.IsTrue(result.Contains(new KeyValuePair<double, double>(1, 0)));
            Assert.IsTrue(result.Contains(new KeyValuePair<double, double>(2, 0.5)));
        }
        public void ToStringTest()
        {
            var sut = new ProdMsfScalingStrategy();

            Assert.AreEqual("Product Msf Scaling", sut.ToString());
        }
        public void Apply_With_Complex()
        {
            var msf = new MembershipFunction {{0, 0}, {1, 0.5}, {2, 0.5}, {3, 1}, {4, 0}};

            var sut = new ProdMsfScalingStrategy();

            var result = sut.Apply(msf, 0.5);

            Assert.AreEqual(5, result.Count);

            Assert.IsTrue(result.Contains(new KeyValuePair<double, double>(0, 0)));
            Assert.IsTrue(result.Contains(new KeyValuePair<double, double>(1, 0.25)));
            Assert.IsTrue(result.Contains(new KeyValuePair<double, double>(2, 0.25)));
            Assert.IsTrue(result.Contains(new KeyValuePair<double, double>(3, 0.5)));
            Assert.IsTrue(result.Contains(new KeyValuePair<double, double>(4, 0)));
        }