예제 #1
0
        public void Idempotency_FourArgs()
        {
            string constant = "constant-value";
            Func <int, double, DateTime, char, string> function = Functor.Idempotency <int, double, DateTime, char, string>(constant);

            Assert.That(function.Target, Is.Not.Null);

            for (int i = 0; i < 200; ++i)
            {
                Assert.That(function(i, 2.5 * i, DateTime.Now, System.Convert.ToChar(i)), Is.SameAs(constant));
            }
        }
예제 #2
0
        public void Idempotency_TwoArgs()
        {
            string constant = "constant-value";
            Func <int, double, string> function = Functor.Idempotency <int, double, string>(constant);

            Assert.That(function.Target, Is.Not.Null);

            for (int i = 0; i < 200; ++i)
            {
                Assert.That(function(i, 2.5 * i), Is.SameAs(constant));
            }
        }