public void TestAllTemplates() { RepeaterTester all = new RepeaterTester("allRepeater", true, true, true); AssertFiveThings(all, "allLabel"); AssertFourSeparators(all, "allSeparatorTemplateLabel"); Assert.AreEqual("header", new LabelTester("allHeaderTemplateLabel", all.Header).Text); Assert.AreEqual("footer", new LabelTester("allFooterTemplateLabel", all.Footer).Text); }
private static string GetMessage(string aspId, RepeaterTester repeater) { return String.Format( "Tester '{0}' has RepeaterTester '{1}' as its container. That isn't allowed. " + "It should be a RepeaterTester.RepeaterTemplateTester. " + "When constructing {0}, pass '{1}.Item(#)', '{1}.Header', '{1}.Footer', " + "or '{1}.GetSeparator(#)' as the container argument.", aspId, repeater.AspId); }
public void TestDescriptions() { RepeaterTester all = new RepeaterTester("allRepeater", true, true, true); AssertDescription("RepeaterTester 'allRepeater'", all); AssertDescription("HeaderTemplate in RepeaterTester 'allRepeater'", all.Header); AssertDescription("Item #3 in RepeaterTester 'allRepeater'", all.Item(2)); AssertDescription("Separator #2 in RepeaterTester 'allRepeater'", all.Separator(1)); AssertDescription("FooterTemplate in RepeaterTester 'allRepeater'", all.Footer); }
public void TestAlternatingItemTemplate() { RepeaterTester alternating = new RepeaterTester("alternatingRepeater"); AssertFiveThings(alternating, "alternatingLabel"); }
private void AssertFourSeparators(RepeaterTester tester, string separatorLabelId) { Assert.AreEqual(" | ", new LabelTester(separatorLabelId, tester.Separator(0)).Text); Assert.AreEqual(" | ", new LabelTester(separatorLabelId, tester.Separator(1)).Text); Assert.AreEqual(" | ", new LabelTester(separatorLabelId, tester.Separator(2)).Text); Assert.AreEqual(" | ", new LabelTester(separatorLabelId, tester.Separator(3)).Text); }
/// <summary> /// Create a tester for a specific item in a repeater. /// </summary> /// <param name="itemNum">The item number to test (zero-based).</param> /// <param name="container">The repeater tester this item is contained /// within.</param> public RepeaterItemTester(int itemNum, RepeaterTester container) : base(container) { this.container = container; this.itemNum = itemNum; }
/// <summary> /// Create a tester for a specific item in a repeater. /// </summary> /// <param name="separatorNum">The index of the separator to test (zero-based).</param> /// <param name="container">The repeater tester this item is contained /// within.</param> public RepeaterSeparatorTester(int separatorNum, RepeaterTester container) : base(container) { this.container = container; this.separatorNum = separatorNum; }
/// <summary> /// Create a tester for a repeater's HeaderTemplate. /// </summary> /// <param name="container">The repeater tester that contains this HeaderTemplate</param> public RepeaterHeaderTester(RepeaterTester container) : base(container) { this.container = container; }
public void TestNestedRepeater() { RepeaterTester innerRepeater1 = new RepeaterTester("innerRepeater1", repeater1.Item(0)); RepeaterTester innerRepeater2 = new RepeaterTester("innerRepeater1", repeater1.Item(1)); Assert.AreEqual(2, innerRepeater1.ItemCount); Assert.AreEqual(4, innerRepeater2.ItemCount); }
public void TestHeaderTemplate() { RepeaterTester header = new RepeaterTester("headerRepeater", true, false, false); AssertFiveThings(header, "headerLabel"); Assert.AreEqual("header", new LabelTester("nestedHeaderLabel", header.Header).Text); }
public void TestFooterTemplate() { RepeaterTester footer = new RepeaterTester("footerRepeater", false, false, true); AssertFiveThings(footer, "footerLabel"); Assert.AreEqual("footer", new LabelTester("nestedFooterLabel", footer.Footer).Text); }
internal ContainerMustBeItemException(string aspId, RepeaterTester repeater) : base(GetMessage(aspId, repeater)) { }
/// <summary> /// Create a tester for a specific item in a repeater. /// </summary> /// <param name="container">The repeater tester this item is contained /// within.</param> public RepeaterFooterTester(RepeaterTester container) : base(container) { this.container = container; }
/// <summary> /// Create a tester for a specific item in a repeater. /// </summary> /// <param name="separatorNum">The index of the separator to test (zero-based).</param> /// <param name="container">The repeater tester this item is contained /// within.</param> public RepeaterSeparatorTester(int separatorNum, RepeaterTester container) : base(container) { this.container = container; this.separatorNum = separatorNum; }
internal ContainerMustBeItemException(string aspId, RepeaterTester repeater) : base(GetMessage(aspId, repeater)) { }
public void TestSeparatorTemplate() { RepeaterTester separator = new RepeaterTester("separatorRepeater", false, true, false); AssertFiveThings(separator, "separatorLabel"); AssertFourSeparators(separator, "nestedSeparatorLabel"); }
private static string GetMessage(string aspId, RepeaterTester repeater) { return String.Format( "Tester '{0}' has RepeaterTester '{1}' as its container. That isn't allowed. " + "It should be a RepeaterTester.RepeaterTemplateTester. " + "When constructing {0}, pass '{1}.Item(#)', '{1}.Header', '{1}.Footer', " + "or '{1}.GetSeparator(#)' as the container argument.", aspId, repeater.AspId); }
protected override void SetUp() { base.SetUp(); repeater1 = new RepeaterTester("Repeater1", CurrentWebForm); repeater2 = new RepeaterTester("Repeater2", CurrentWebForm); repeater3 = new RepeaterTester("Repeater3", CurrentWebForm); Browser.GetPage(BaseUrl + "/AspTester/RepeaterTestPage.aspx"); }
/// <summary> /// Create a tester for a specific item in a repeater. /// </summary> /// <param name="itemNum">The item number to test (zero-based).</param> /// <param name="container">The repeater tester this item is contained /// within.</param> public RepeaterItemTester(int itemNum, RepeaterTester container) : base(container) { this.container = container; this.itemNum = itemNum; }
private void AssertFiveThings(RepeaterTester tester, string labelId) { Assert.AreEqual(5, tester.ItemCount); Assert.AreEqual("one", new LabelTester(labelId, tester.Item(0)).Text); Assert.AreEqual("two", new LabelTester(labelId, tester.Item(1)).Text); Assert.AreEqual("three", new LabelTester(labelId, tester.Item(2)).Text); Assert.AreEqual("four", new LabelTester(labelId, tester.Item(3)).Text); Assert.AreEqual("five", new LabelTester(labelId, tester.Item(4)).Text); }
/// <summary> /// Create a tester for a specific template in a repeater. /// </summary> /// <param name="container">The repeater tester this item is contained /// within.</param> public RepeaterTemplateTester(RepeaterTester container) : base(null, container) { }
/// <summary> /// Create a tester for a specific template in a repeater. /// </summary> /// <param name="container">The repeater tester this item is contained /// within.</param> public RepeaterTemplateTester(RepeaterTester container) : base(null, container) { }