public void Apply_With_One_Point()
        {
            var msf = new MembershipFunction{{0, 0.7}};

            var sut = new MinMsfScalingStrategy();

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

            Assert.AreEqual(1, result1.Count);
            foreach (var point in result1)
                Assert.AreEqual(0.5, point.Value);

            Assert.AreEqual(1, result2.Count);
            foreach (var point in result2)
                Assert.AreEqual(0.7, point.Value);
        }
        public void Apply_With_No_Point()
        {
            var msf = new MembershipFunction();

            var sut = new MinMsfScalingStrategy();

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

            Assert.AreEqual(0, result.Count);
        }
        public void Apply_With_Triangle_3()
        {
            var msf = new MembershipFunction { { -7, 0 }, { -5, 1 }, { 0, 0 } };

            var sut = new MinMsfScalingStrategy();

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

            Assert.AreEqual(4, result.Count);
            Assert.AreEqual(0, msf.Apply(-7), 0.000000000001);
            Assert.AreEqual(0.5, msf.Apply(-6), 0.000000000001);
            Assert.AreEqual(0.5, msf.Apply(-2.5), 0.000000000001);
            Assert.AreEqual(0, msf.Apply(0), 0.000000000001);
        }
        public void Apply_With_Triangle()
        {
            var msf = new MembershipFunction{ { 0, 0 }, { 1, 1 }, { 2, 0 } };

            var sut = new MinMsfScalingStrategy();

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

            Assert.AreEqual(4, result.Count);

            Assert.IsTrue(result.Contains(new KeyValuePair<double, double>(0, 0)));
            Assert.IsTrue(result.Contains(new KeyValuePair<double, double>(0.5, 0.5)));
            Assert.IsTrue(result.Contains(new KeyValuePair<double, double>(1.5, 0.5)));
            Assert.IsTrue(result.Contains(new KeyValuePair<double, double>(2, 0)));
        }