Ejemplo n.º 1
0
        public void TestStandardTypeLocator()
        {
            var tl       = new StandardTypeLocator();
            var prefixes = tl.ImportPrefixes;

            Assert.Single(prefixes);
            tl.RegisterImport("System.Collections");
            prefixes = tl.ImportPrefixes;
            Assert.Equal(2, prefixes.Count);
            tl.RemoveImport("System.Collections");
            prefixes = tl.ImportPrefixes;
            Assert.Single(prefixes);
        }
Ejemplo n.º 2
0
        public void TestStandardEvaluationContext()
        {
            var context = new StandardEvaluationContext();

            Assert.NotNull(context.TypeComparator);

            var tc = new StandardTypeComparator();

            context.TypeComparator = tc;
            Assert.Equal(tc, context.TypeComparator);

            var tl = new StandardTypeLocator();

            context.TypeLocator = tl;
            Assert.Equal(tl, context.TypeLocator);
        }