예제 #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);
        }