Ejemplo n.º 1
0
        //should not work
        public void TestExplicitDelegateStatic3()
        {
            var executor = new VaultActionExecutor();
            VaultAction <StringBuilder, string> vaDel = StaticAppendText;

            executor.ExecuteAction(vaDel, "Hi mom!");
        }
Ejemplo n.º 2
0
        //should not work
        public void TestLocalNonStatic()
        {
            var executor = new VaultActionExecutor();

            executor.ExecuteAction(AppendText, "Hi mom!");

            void AppendText(ref StringBuilder sb, in string appendMe)
            {
                _sb = sb;
                sb.AppendLine(appendMe);
            }
        }
Ejemplo n.º 3
0
        //should not work
        public void TestExplicitDelegateStatic2()
        {
            var executor = new VaultActionExecutor();
            VaultAction <StringBuilder, string> vaDel = (ref StringBuilder sb, in string s) =>
            {
                sb.AppendLine(s);
                //incorrect, references "this" and "_sb"
                StaticStringBuilder = sb;
            };

            executor.ExecuteAction(vaDel, "Hi mom!");
        }
Ejemplo n.º 4
0
        public void TestNonStaticMethodGetTest()
        {
            VaultActionExecutor executor = new VaultActionExecutor();

            executor.ExecuteAction(AppendText, "Hi mom!");
        }
Ejemplo n.º 5
0
        //should not work
        public void TestLocalStatic()
        {
            var executor = new VaultActionExecutor();

            executor.ExecuteAction(StaticAppendText, "Hi mom!");