public void ProcessEntityIncludeInExceptions()
        {
            bool          ignoreStatus = false;
            string        entityName   = "myEntity";
            List <string> exceptions   = new List <string>()
            {
                "someentity1", entityName, "entity with tpyo inname"
            };

            Entity entity = new Entity()
            {
                LogicalName = entityName
            };

            entity.Attributes.Add(EntityStatusProcessor.StatusFields.ElementAt(0), new OptionSetValue(2));
            entity.Attributes.Add(EntityStatusProcessor.StatusFields.ElementAt(1), new OptionSetValue(4));

            EntityWrapper entityWrapper = new EntityWrapper(entity);

            EntityStatusProcessor processor = new EntityStatusProcessor(ignoreStatus, exceptions);

            processor.ProcessEntity(entityWrapper, (int)PassType.SetRecordStatus, (int)PassType.SetRecordStatus);

            Assert.AreEqual(OperationType.Ignore, entityWrapper.OperationType);
        }
        public void ProcessEntityRemovedOnOtherPasses()
        {
            bool          ignoreStatus = false;
            string        entityName   = "myEntity";
            List <string> exceptions   = new List <string>()
            {
                "someentity1", entityName, "entity with tpyo inname"
            };

            Entity entity = new Entity()
            {
                LogicalName = entityName
            };

            entity.Attributes.Add(EntityStatusProcessor.StatusFields.ElementAt(0), new OptionSetValue(2));
            entity.Attributes.Add(EntityStatusProcessor.StatusFields.ElementAt(1), new OptionSetValue(4));

            EntityWrapper entityWrapper = new EntityWrapper(entity);

            EntityStatusProcessor processor = new EntityStatusProcessor(ignoreStatus, exceptions);

            processor.ProcessEntity(entityWrapper, (int)PassType.SetRecordStatus + 1, (int)PassType.SetRecordStatus);

            Assert.IsFalse(entity.Contains(EntityStatusProcessor.StatusFields.ElementAt(0)));
            Assert.IsFalse(entity.Contains(EntityStatusProcessor.StatusFields.ElementAt(1)));
        }
Пример #3
0
        public void ProcessEntity()
        {
            EntityWrapper entity        = new EntityWrapper(new Entity());
            int           passNumber    = 1;
            int           maxPassNumber = 3;

            FluentActions.Invoking(() => systemUnderTest.ProcessEntity(entity, passNumber, maxPassNumber))
            .Should()
            .NotThrow();
        }