示例#1
0
        public void OverrideRegistrationTest()
        {
            var tm     = new TestDataManager();
            var newDic = new SqlItemDictionary();

            tm.Dictionaries.Register <SqlItemDictionary>(newDic, true);

            Assert.AreSame(newDic, tm.Sql);
        }
示例#2
0
        public void OverrideRegistrationTest()
        {
            var tm     = new TestDataManager(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath);
            var newDic = new SqlItemDictionary();

            tm.Dictionaries.Register <SqlItemDictionary>(newDic, true);

            Assert.AreSame(newDic, tm.Sql);
        }
示例#3
0
        public void RegistrationWithInstanceTest()
        {
            var tm     = new TestDataManager();
            var newDic = new SqlItemDictionary();

            tm.Dictionaries.Clear();
            tm.Dictionaries.ExtensionMappings.Clear();
            tm.Dictionaries.Register <SqlItemDictionary>(newDic);


            Assert.AreSame(newDic, tm.Sql);
        }
示例#4
0
        public void RegistrationWithInstanceTest()
        {
            var tm     = new TestDataManager(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath);
            var newDic = new SqlItemDictionary();

            tm.Dictionaries.Clear();
            tm.Dictionaries.ExtensionMappings.Clear();
            tm.Dictionaries.Register <SqlItemDictionary>(newDic);


            Assert.AreSame(newDic, tm.Sql);
        }
示例#5
0
        public void RegistrationWithInstanceAndNoOverrideTest()
        {
            var tm     = new TestDataManager();
            var newDic = new SqlItemDictionary();


            void RegisterAction()
            {
                tm.Dictionaries.Register <SqlItemDictionary>(newDic);
            }

            Assert.Throws <ArgumentException>(RegisterAction, "Dictionary already registered and override is disabled. Dictionary type: .sql");
        }