Exemplo n.º 1
0
        public void IfThenNullTest()
        {
            var callElse = new DelegateCallHelper();

            1.If(null, callElse.Call);
            callElse.AssertNotCalled();
        }
Exemplo n.º 2
0
        public void IfElseNullTest()
        {
            var callThen = new DelegateCallHelper();

            0.If(callThen.Call);
            callThen.AssertNotCalled();
        }
Exemplo n.º 3
0
        public void IfTest(bool expected, object obj)
        {
            var callThen = new DelegateCallHelper();
            var callElse = new DelegateCallHelper();

            obj.If(() => callThen.Call(), () => callElse.Call());

            callThen.AssertCalled(expected);
            callElse.AssertCalled(!expected);
        }
Exemplo n.º 4
0
        public void IfTTest(bool expected, object obj)
        {
            var callThen = new DelegateCallHelper();
            var callElse = new DelegateCallHelper();

            obj.If(x => {
                Assert.AreEqual(obj, x);
                callThen.Call();
            }, x => {
                Assert.AreEqual(obj, x);
                callElse.Call();
            });

            callThen.AssertCalled(expected);
            callElse.AssertCalled(!expected);
        }