コード例 #1
0
        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);
        }
コード例 #2
0
        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();
        }