public void InputFilterAttributesOnAnExistingStepShouldBeMergedAndUpdate()
        {
            var context    = new XrmFakedContext();
            var orgService = context.GetOrganizationService();

            ExistingPluginStep.FilteringAttributes = "one,two,three,four";
            context.Initialize(new List <Entity>()
            {
                ExistingContactPluginType,
                UpdateSdkMessage,
                UpdateContactMessageFilter,
                ExistingPluginStep
            });

            UnitTestPluginStep.FilteringAttributes = new[] { "one", "two" };
            UnitTestPluginStep.Register(orgService, ExistingContactPluginType.ToEntityReference(),
                                        UpdateSdkMessage.ToEntityReference(), UpdateContactMessageFilter.ToEntityReference());

            var registeredStep =
                (from e in context.CreateQuery <SdkMessageProcessingStep>()
                 where e.Name == UnitTestPluginStep.Name
                 select e).ToList();

            Assert.AreEqual(1, registeredStep.Count);
            Assert.AreEqual("one,two", registeredStep[0].FilteringAttributes);
        }
        public void RegisterNonExistentStepCreatesNewStep()
        {
            var context    = new XrmFakedContext();
            var orgService = context.GetOrganizationService();

            context.Initialize(new List <Entity>()
            {
                ExistingContactPluginType,
                UpdateSdkMessage,
                UpdateContactMessageFilter
            });

            UnitTestPluginStep.Register(orgService, ExistingContactPluginType.ToEntityReference(),
                                        UpdateSdkMessage.ToEntityReference(), UpdateContactMessageFilter.ToEntityReference());

            var registeredStep =
                (from e in context.CreateQuery <SdkMessageProcessingStep>()
                 where e.Name == UnitTestPluginStep.Name
                 select e).ToList();

            Assert.AreEqual(1, registeredStep.Count);
            Assert.IsNotNull(registeredStep[0].Id);
        }