/// <summary> /// Save email config settings /// </summary> /// <param name="collection">Collection of config settings</param> /// <returns>listing of config settings</returns> public ActionResult SaveEmail(FormCollection collection) { if (collection != null) { string emailLogon = collection["emailLogon"]; string emailPassword = collection["emailPassword"]; string host = collection["host"]; string portString = collection["port"]; int port; FeedConfiguration mailSettingsConfig = new FeedConfiguration(this.HttpContext); SmtpSection smtpSection = new SmtpSection(); smtpSection.Network.UserName = emailLogon; smtpSection.Network.Password = emailPassword; smtpSection.Network.Host = host; if (int.TryParse(portString, out port) == true) { smtpSection.Network.Port = port; } this.FeedConfiguration.SmtpSection = smtpSection; } return this.Index(); }
/// <summary> /// Initializes a new instance of the <see cref="DashboardBaseController" /> class. /// Builds model for web app that most/all /// controllers use. /// </summary> public DashboardBaseController() { this.feedConfiguration = new FeedConfiguration(this.HttpContext); this.feedMgr = new DashboardMgr(this.HttpContext); this.issueMgr = new IssueMgr(this.HttpContext); this.feedModel = new DashboardModel(); this.issueModel = new DashboardIssueModel(); }
public void DashboardHttpConstructorTest_Success() { // arrange FeedConfiguration dashboardConfiguration = new FeedConfiguration(null); Uri getUri = new Uri(dashboardConfiguration.DefaultUri); // act DashboardHttp target = new DashboardHttp(getUri); // assert Assert.IsNotNull(target); }
public void RequestGETTest() { // arrange HttpContextBase context = null; FeedConfiguration dashboardConfiguration = new FeedConfiguration(context); Uri getUri = new Uri(@"http://www.microsoft.com"); DashboardHttp target = new DashboardHttp(getUri); string actual = string.Empty; // act actual = target.GetRequest(); // assert Assert.IsNotNull(actual); }