public void UpdateCommunicationDefinitionTest() { // Create campaign. Campaign campaign; Template template; CreateTestCampaign(1, out campaign, out template); Assert.IsNull(campaign.CommunicationDefinitionId); // Update. campaign.CommunicationDefinitionId = _settingsQuery.GetDefinitions(UserType.Member)[1].Id; _campaignsCommand.UpdateCampaign(campaign); // Get them. AssertCampaign(campaign, template); }
public void CommunicationDefinitionTest() { // Create campaign. var campaign = new Campaign { Name = string.Format(CampaignNameFormat, 0), CreatedBy = Guid.NewGuid(), CommunicationDefinitionId = _settingsQuery.GetDefinitions(UserType.Member)[1].Id }; _campaignsCommand.CreateCampaign(campaign); var template = new Template { Subject = string.Format(TemplateSubjectFormat, 0), Body = string.Format(TemplateBodyFormat, 0) }; _campaignsCommand.CreateTemplate(campaign.Id, template); AssertCampaign(campaign, template); }
public ActionResult New() { // Show a new campaign with the default communication category set. var campaign = new Campaign { CommunicationCategoryId = _settingsQuery.GetCategory("Campaign").Id, }; return(View(new CampaignSummaryModel { Campaign = campaign, CreatedBy = CurrentRegisteredUser, IsReadOnly = false, CommunicationDefinitions = _settingsQuery.GetDefinitions(), CommunicationCategories = _settingsQuery.GetCategories() })); }