示例#1
0
        private void InitCommonForTest_CreateButton_Click(int layoutPlaneId, commEntities.LayoutPlans layoutPlans, commEntities.BlastAbstract blastAbstract, commEntities.TriggerPlans triggerPlan, string noopRadioValue, string hfSelectedLayoutNOOPReply, TimeSpan triggerTimeSpan = default(TimeSpan), ECNException saveECNException = null, int updateLayoutCampaignValue = 10, ECNException triggerPlanSaveException = null, int updateTriggerMessageValue = -1, bool activeOrSentResult = false, string eventTypeSelectedItem = "subscribe")
        {
            var criteriaDropDownList = new DropDownList();

            criteriaDropDownList.Items.Add(new ListItem()
            {
                Value = CriteriaValue, Selected = true
            });
            var noopRadioLst = new RadioButtonList();

            noopRadioLst.Items.Add(noopRadioValue);
            noopRadioLst.SelectedIndex = 0;
            var hfSelectedLayoutNOOPReplay = new HiddenField()
            {
                Value = hfSelectedLayoutNOOPReply
            };
            var eventTypeDropDown = new DropDownList();

            eventTypeDropDown.Items.Add(eventTypeSelectedItem);
            eventTypeDropDown.SelectedIndex = 0;
            ShimMessageTriggers.AllInstances.LayoutPlanIDGet = (s) => layoutPlaneId;
            ShimMessageTriggers.AllInstances.UpdateLayoutCampaignBlastInt32 = (m, b, i) => updateLayoutCampaignValue;
            _shimMessageTriggers.UpdateTriggerMessageBlastInt32             = (b, id) => updateTriggerMessageValue;
            ShimLayoutPlans.GetByLayoutPlanIDInt32User = (id, user) => layoutPlans;
            ShimLayoutPlans.SaveLayoutPlansUser        = (l, user) =>
            {
                _layoutPlanSaveMethodCallCount++;
                if (saveECNException != null)
                {
                    throw saveECNException;
                }
                return(0);
            };
            ShimBlast.GetByBlastIDInt32UserBoolean             = (id, user, b) => blastAbstract;
            ShimBlast.GetByCampaignItemBlastIDInt32UserBoolean = (c, u, b) => blastAbstract;
            ShimBlast.ActiveOrSentInt32Int32            = (bId, cId) => activeOrSentResult;
            ShimTriggerPlans.GetByRefTriggerIDInt32User = (i, u) => triggerPlan;
            ShimTriggerPlans.SaveTriggerPlansUser       = (t, u) =>
            {
                _triggerPlanSaveMethodCallCount++;
                if (triggerPlanSaveException != null)
                {
                    throw triggerPlanSaveException;
                }
                return(0);
            };
            _messageTriggersPrivateObject.SetField("_criteria", BindingFlags.Instance | BindingFlags.NonPublic, criteriaDropDownList);
            _messageTriggersPrivateObject.SetField("_layoutName", BindingFlags.Instance | BindingFlags.NonPublic, new TextBox()
            {
                Text = LayoutName
            });
            _messageTriggersPrivateObject.SetField("NOOP_RadioList", BindingFlags.Instance | BindingFlags.NonPublic, noopRadioLst);
            _messageTriggersPrivateObject.SetField("hfSelectedLayoutNOOPReply", BindingFlags.Instance | BindingFlags.NonPublic, hfSelectedLayoutNOOPReplay);
            _messageTriggersPrivateObject.SetField("NOOP_Period", BindingFlags.Instance | BindingFlags.NonPublic, new TextBox()
            {
                Text = triggerTimeSpan.Days.ToString()
            });
            _messageTriggersPrivateObject.SetField("NOOP_txtHours", BindingFlags.Instance | BindingFlags.NonPublic, new TextBox()
            {
                Text = triggerTimeSpan.Hours.ToString()
            });
            _messageTriggersPrivateObject.SetField("NOOP_txtMinutes", BindingFlags.Instance | BindingFlags.NonPublic, new TextBox()
            {
                Text = triggerTimeSpan.Minutes.ToString()
            });
            _messageTriggersPrivateObject.SetField("EventType", BindingFlags.Instance | BindingFlags.NonPublic, eventTypeDropDown);
        }
示例#2
0
 private void InitTest_CreateButton_Click(string createBtnText, int userId, int layoutPlaneId, commEntities.LayoutPlans layoutPlans, commEntities.BlastAbstract blastAbstract, commEntities.TriggerPlans triggerPlan, string noopRadioValue, string hfSelectedLayoutNOOPReply, TimeSpan layoutTimeSpan = default(TimeSpan), TimeSpan triggerTimeSpan = default(TimeSpan), ECNException saveECNException = null, int updateLayoutCampaignValue = 10, ECNException triggerPlanSaveException = null, int updateTriggerMessageValue = -1, bool activeOrSentResult = false, string eventTypeSelectedItem = "subscribe")
 {
     InitMainForTest_CreateButton_Click(createBtnText: createBtnText, userId: userId, layoutTimeSpan: layoutTimeSpan);
     InitCommonForTest_CreateButton_Click(layoutPlaneId: layoutPlaneId, layoutPlans: layoutPlans, blastAbstract: blastAbstract, triggerPlan: triggerPlan, noopRadioValue: noopRadioValue, hfSelectedLayoutNOOPReply: hfSelectedLayoutNOOPReply, triggerTimeSpan: triggerTimeSpan, saveECNException: saveECNException, updateLayoutCampaignValue: updateLayoutCampaignValue, triggerPlanSaveException: triggerPlanSaveException, updateTriggerMessageValue: updateTriggerMessageValue, activeOrSentResult: activeOrSentResult, eventTypeSelectedItem: eventTypeSelectedItem);
 }