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); }
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")); }
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); }
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")); }
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); }
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); }