public void ReParseWithMessageBundle() { InternationalGadgetTestData data = new InternationalGadgetTestData(); GadgetMaster target = GadgetMaster.CreateGadget(TEST_FACTORY_KEY, data.Source); int ctlCount = target.CountInternalControls(); Assert.Greater(ctlCount, 0); target.ReParse(); Assert.AreEqual(ctlCount, target.CountInternalControls()); }
public void InFactoryGlobalCountersEnabled() { InitGadgetControlFactory(); ControlFactory factory = ControlFactory.GetControlFactory(TEST_FACTORY_KEY); factory.Counters.IsGlobalCounterEnabled = true; Assert.AreEqual(0, factory.Counters.GetGlobalCount(), "Count not initially zero"); GadgetMaster master = GadgetMaster.CreateGadget(TEST_FACTORY_KEY, GadgetTestData.FullGadget, new OffsetItem(GadgetTestData.GadgetOffsetListString)); ResolveDataControlValues(master.MyDataContext, GadgetTestData.Viewer, GadgetTestData.Viewer, null); string result = master.RenderToString("profile"); Assert.IsFalse(String.IsNullOrEmpty(result), "Empty rendered results"); Assert.Greater(master.Controls.Count, 0, "Empty control tree"); Assert.Greater(factory.Counters.GetGlobalCount(), 0, "Counter is zero after render"); Assert.AreEqual(master.CountInternalControls(), factory.Counters.GetGlobalCount(), "Counts do not match"); }