Exemplo n.º 1
0
        public void Should_provide_a_clear_syntax_for_method_selection()
        {
            FooId <TestFeature> fooId = FooIds.Enabled <TestFeature>();

            fooId.If(() =>
            {
                // run if it is enabled
            });

            fooId.Unless(() =>
            {
                // run if disabled
            });

            fooId.If(() =>
            {
                /* enabled */
            }, () =>
            {
                /* disabled */
            });


            var result = fooId.Iff(() => 27, () => 42);

            Assert.AreEqual(27, result);

            var value = fooId.Iff((a, b) => a, (a, b) => b, 27, 42);

            Assert.AreEqual(27, value);
        }
Exemplo n.º 2
0
 public void MethodCall(int value, string text)
 {
     _useNewMethod.If(MethodCallV2, MethodCallOld, value, text);
 }