Example #1
0
        private static void SetupShims()
        {
            ShimLayoutPlans.GetByLayoutPlanIDInt32User = (i, user) =>
            {
                var plans = new EntitiesCommunicator.LayoutPlans();
                plans.BlastID  = 1;
                plans.LayoutID = 2;
                return(plans);
            };

            ShimCommunicator.AllInstances.UserSessionGet = communicator =>
            {
                var session = CreateEcnSession();
                return(session);
            };

            ShimMessageTriggers.AllInstances.MasterGet = triggers =>
            {
                var master = new ecn.communicator.MasterPages.Communicator();
                return(master);
            };

            ShimMessageTriggers.AllInstances.SetNoopControlStatusBoolean = (_, __) => { };

            ShimBlast.GetByBlastIDInt32UserBoolean = (i, user, arg3) =>
            {
                var blast = new EntitiesCommunicator.BlastLayout();
                blast.LayoutID      = 1;
                blast.EmailFromName = SampleEmailFromName;
                blast.EmailFrom     = SampleEmail;
                blast.EmailSubject  = SampleEmailSubject;
                return(blast);
            };

            ShimTriggerPlans.GetByRefTriggerIDInt32User = (_, __) =>
            {
                var plan = new EntitiesCommunicator.TriggerPlans();
                plan.BlastID = 1;
                return(plan);
            };

            ShimLayout.GetByLayoutIDInt32UserBoolean = (_, __, ___) =>
            {
                var layout = new EntitiesCommunicator.Layout();
                return(layout);
            };

            ShimCampaignItem.GetByBlastIDInt32UserBoolean = (i, user, arg3) =>
            {
                var campaignItem = new EntitiesCommunicator.CampaignItem();
                return(campaignItem);
            };
        }
        private void SetFakesForSaveMethod()
        {
            _isCampaignItemSuppressionDeleted = false;
            _isBlastsFromCampaignItemCreated  = false;
            _savedCampaignItem                = null;
            _deletedCampaignItemBlastIDs      = new List <int>();
            _savedCampaignItemSuppressionList = new List <CommunicatorEntities.CampaignItemSuppression>();
            _savedCampaignItemBlastList       = new List <CommunicatorEntities.CampaignItemBlast>();
            QueryString.Clear();
            QueryString.Add(PrePopLayoutIDKey, "1");

            ShimCampaignItem.GetByCampaignItemID_NoAccessCheckInt32Boolean = (cid, b) => GetCampaignItem();
            ShimgroupExplorer.AllInstances.getSelectedGroups    = (g) => GetGroupList();
            ShimgroupExplorer.AllInstances.getSuppressionGroups = (g) => GetGroupList();

            // Save and Delete Fakes
            ShimCampaignItemBlastRefBlast.DeleteInt32UserBoolean = (cbId, user, b) =>
            { _deletedCampaignItemBlastIDs.Add(cbId); };
            ShimCampaignItem.SaveCampaignItemUser = (ci, user) =>
            {
                _savedCampaignItem = ci;
                return(1);
            };
            ShimCampaignItemBlast.SaveInt32ListOfCampaignItemBlastUser = (cid, lBlast, user) =>
            {
                _savedCampaignItemBlastList.AddRange(lBlast);
            };
            ShimCampaignItemSuppression.Delete_NoAccessCheckInt32UserBoolean = (csupId, user, b) =>
            { _isCampaignItemSuppressionDeleted = true; };
            ShimCampaignItemSuppression.SaveCampaignItemSuppressionUser = (csup, user) =>
            {
                _savedCampaignItemSuppressionList.Add(csup);
                return(1);
            };
            ShimBlast.CreateBlastsFromCampaignItemInt32UserBoolean = (cid, user, b) => { _isBlastsFromCampaignItemCreated = true; };
        }