public void AddControlToBody_WithOtherControl_AddsControlToBodyControl() { // arrange var updatePanel = new UpdatePanel(); var control = new UserControl(); var bodyControl = new UserControl(); var page = new SubtextMasterPage(); // act page.AddControlToBody("Other", control, updatePanel, bodyControl); // assert Assert.AreEqual(control, bodyControl.Controls[0]); }
public void AddControlToBody_WithComments_AddsControlToUpdatePanel() { // arrange var updatePanel = new UpdatePanel(); var control = new UserControl {Visible = false}; var bodyControl = new UserControl(); var page = new SubtextMasterPage(); // act page.AddControlToBody("Comments", control, updatePanel, bodyControl); // assert Assert.AreEqual(control, updatePanel.ContentTemplateContainer.Controls[0]); Assert.IsTrue(control.Visible); }
public void AddControlToBody_WithPostComment_AddsControlToUpdatePanelAndUpdatePanelToCenterBodyControl() { // arrange var updatePanel = new UpdatePanel(); var postCommentControl = new PostComment(); var bodyControl = new UserControl(); var page = new SubtextMasterPage(); // act page.AddControlToBody("PostComment", postCommentControl, updatePanel, bodyControl); // assert Assert.AreEqual(postCommentControl, updatePanel.ContentTemplateContainer.Controls[0]); Assert.AreEqual(updatePanel, bodyControl.Controls[0]); Assert.IsTrue(postCommentControl.Visible); }