예제 #1
0
        public void aliasPrefixTest3()
        {
            using (dynamic l = new ConariX(UNLIB_DLL, true, "apiprefix_"))
            {
                bool expected = false;

                var pa = new ProcAlias("apiprefix_GFlag", new AliasCfg()
                {
                    NoPrefixR = true
                });
                l.Aliases["GF"] = l.Aliases["apiprefix_GF"] = pa;

                Assert.Equal(expected, l.ExVar.get <bool>("apiprefix_GF"));
                Assert.Equal(expected, l.ExVar.getVar <bool>("GF"));
                Assert.Equal(expected, l.ExVar.getField <bool>("GF").value);
                Assert.Equal(expected, l.ExVar.getField(typeof(bool), "GF").value);
            }
        }
예제 #2
0
        public void aliasPrefixTest5()
        {
            using (var l = new ConariL(UNLIB_DLL))
            {
                var pa = new ProcAlias("apiprefix_GFlag", new AliasCfg()
                {
                    NoPrefixR = true
                });
                l.Aliases["one"] = l.Aliases["two"] = pa;

                bool exp = false;

                l.Prefix = "apiprefix_";
                Assert.AreEqual(exp, l.ExVar.DLR.one <bool>());

                l.Prefix = "";
                Assert.AreEqual(exp, l.ExVar.DLR.one <bool>());
            }
        }
예제 #3
0
        public void aliasPrefixTest2()
        {
            using (var l = new ConariL(UNLIB_DLL, "apiprefix_"))
            {
                bool expected = false;

                var pa = new ProcAlias("apiprefix_GFlag", new AliasCfg()
                {
                    NoPrefixR = true
                });
                l.Aliases["GF"] = l.Aliases["apiprefix_GF"] = pa;

                Assert.AreEqual(expected, l.ExVar.DLR.GF <bool>(), "1");
                Assert.AreEqual(expected, l.ExVar.get <bool>("GF"), "2");
                Assert.AreEqual(expected, l.ExVar.getVar <bool>("apiprefix_GF"), "3");

                Assert.AreEqual(expected, l.ExVar.getField <bool>("apiprefix_GF").value, "4");
                Assert.AreEqual(expected, l.ExVar.getField(typeof(bool), "apiprefix_GF").value, "5");
            }
        }
예제 #4
0
        public void aliasPrefixTest5()
        {
            using (dynamic l = new ConariX(gCfgUnlib))
            {
                var pa = new ProcAlias("apiprefix_GFlag", new AliasCfg()
                {
                    NoPrefixR = true
                });
                l.Aliases["one"] = l.Aliases["two"] = pa;

                bool exp = false;

                l.Prefix = "apiprefix_";
                Assert.Equal(exp, l.V.one <bool>());
                Assert.Equal(exp, l.ExVar.DLR.one <bool>());

                l.Prefix = "";
                Assert.Equal(exp, l.V.one <bool>());
                Assert.Equal(exp, l.ExVar.DLR.one <bool>());
            }
        }