Exemplo n.º 1
0
        public void FSharpOptionals()
        {
            var c = new I.Class();

            Equal(c.FSharpOptionals(), 3);
            Equal(c.FSharpOptionals(5), 7);
            Equal(c.FSharpOptionals(y: 5), 6);
            Equal(c.FSharpOptionals(5, 5), 10);
        }
Exemplo n.º 2
0
        public void InlinedOptionals()
        {
            var c = new I.Class();

            Equal(c.OptionalsInl(5), 7);
            Equal(c.OptionalsInl(5, 5), 10);
            Equal(c.OptionalsInl(y: 5), 6);
            Equal(c.OptionalsInl(5, 5, 5), 15);
        }
Exemplo n.º 3
0
        public void Params()
        {
            var c = new I.Class();

            Equal(c.ParamsSum(), 0);
            Equal(c.ParamsSum(3), 3);
            Equal(c.ParamsSum(3, 4), 7);
            Equal(c.ParamsSum(new[] { 3, 4 }), 7);
        }
Exemplo n.º 4
0
        public void DelegateEvent()
        {
            var c = new I.Class();

            c.DelEvent += AddToTestInt;
            c.TriggerDelEvent(1);
            Equal(TestInt, 1, "adding handler then triggering");
            c.DelEvent += AddToTestInt;
            c.TriggerDelEvent(2);
            Equal(TestInt, 5, "adding another handler then triggering");
            c.DelEvent -= AddToTestInt;
            c.TriggerDelEvent(3);
            Equal(TestInt, 8, "removing one handler then triggering");
        }