Пример #1
0
        public void TestRegister()
        {
            CategoriesTemplatesProvider provider = new CategoriesTemplatesProvider(storage);
            LMDashboard d = LMDashboard.DefaultTemplate(10);

            d.Name = "system";
            provider.Register(d);
            Assert.IsNotNull(provider.Exists("system"));
            Assert.IsTrue(provider.Templates [0].Static);
        }
Пример #2
0
        public void TestSaveUpdateLoad()
        {
            CategoriesTemplatesProvider provider = new CategoriesTemplatesProvider(storage);
            LMDashboard d = LMDashboard.DefaultTemplate(10);

            d.Name = "jamematen";
            provider.Save(d);
            Assert.IsTrue(provider.Exists("jamematen"));

            d      = LMDashboard.DefaultTemplate(10);
            d.Name = "system";
            provider.Register(d);
            Assert.IsNotNull(provider.Exists("system"));
        }
Пример #3
0
        public void TestCreate()
        {
            bool eventEmitted = false;
            CategoriesTemplatesProvider provider = new CategoriesTemplatesProvider(storage);

            provider.CollectionChanged += (sender, e) => {
                if (e.Action == NotifyCollectionChangedAction.Add && ((Dashboard)e.NewItems [0]).Name == "jamematen")
                {
                    eventEmitted = true;
                }
            };
            provider.Register(provider.Create("jamematen"));

            Assert.AreEqual(2, provider.Templates.Count);
            Assert.IsTrue(provider.Exists("jamematen"));
            Assert.IsTrue(eventEmitted);
        }
Пример #4
0
        public void TestSaveUpdateLoad()
        {
            CategoriesTemplatesProvider provider = new CategoriesTemplatesProvider (storage);
            DashboardLongoMatch d = DashboardLongoMatch.DefaultTemplate (10);
            d.Name = "jamematen";
            provider.Save (d);
            Assert.IsTrue (provider.Exists ("jamematen"));

            d = DashboardLongoMatch.DefaultTemplate (10);
            d.Name = "system";
            provider.Register (d);
            Assert.IsNotNull (provider.Exists ("system"));
        }
Пример #5
0
 public void TestRegister()
 {
     CategoriesTemplatesProvider provider = new CategoriesTemplatesProvider (storage);
     DashboardLongoMatch d = DashboardLongoMatch.DefaultTemplate (10);
     d.Name = "system";
     provider.Register (d);
     Assert.IsNotNull (provider.Exists ("system"));
     Assert.IsTrue (provider.Templates [0].Static);
 }
Пример #6
0
        public void TestCreate()
        {
            bool eventEmitted = false;
            CategoriesTemplatesProvider provider = new CategoriesTemplatesProvider (storage);
            provider.CollectionChanged += (sender, e) => {
                if (e.Action == NotifyCollectionChangedAction.Add && ((Dashboard)e.NewItems [0]).Name == "jamematen") {
                    eventEmitted = true;
                }
            };
            provider.Register (provider.Create ("jamematen"));

            Assert.AreEqual (2, provider.Templates.Count);
            Assert.IsTrue (provider.Exists ("jamematen"));
            Assert.IsTrue (eventEmitted);
        }