예제 #1
0
        internal static List <ActivityPropertySetting> ParseSettingsEntry(string configEntry)
        {
            var settings = new List <ActivityPropertySetting>();

            var entries = configEntry?.Split(';');

            if (entries == null)
            {
                return(settings);
            }

            foreach (var entry in entries)
            {
                if (string.IsNullOrEmpty(entry))
                {
                    continue;
                }

                var settingsModel = new ActivityPropertySetting();
                var properties    = entry.Split(',');
                foreach (var property in properties)
                {
                    var propertyParts = property.Split(':');
                    settingsModel.SetProperty(propertyParts[0], propertyParts[1]);
                }
                settings.Add(settingsModel);
            }

            return(settings);
        }
        public void PropertyNameMatches()
        {
            var propertySetting = new ActivityPropertySetting();

            propertySetting.SetProperty("Property", "*Save*draft*");

            Assert.IsTrue(propertySetting.PropertyNameMatches("Save as draft"));
            Assert.IsTrue(propertySetting.PropertyNameMatches("Save to Drafts"));
            Assert.IsFalse(propertySetting.PropertyNameMatches("To"));
        }
        public void ActivityNameMatches()
        {
            var propertySetting = new ActivityPropertySetting();

            propertySetting.SetProperty("Activity", "*MailX");

            Assert.IsTrue(propertySetting.ActivityTypeMatches("SendMailX"));
            Assert.IsTrue(propertySetting.ActivityTypeMatches("UiPath.Activities.Mail.Business.ForwardMailX"));
            Assert.IsFalse(propertySetting.ActivityTypeMatches("OutlookApplicationCard"));
        }
        public void PropertyValueMatches()
        {
            var propertySetting = new ActivityPropertySetting();

            propertySetting.SetProperty("Value", "True");

            Assert.IsTrue(propertySetting.ValueMatches("True"));
            Assert.IsTrue(propertySetting.ValueMatches("true"));
            Assert.IsFalse(propertySetting.ValueMatches("False"));

            propertySetting.SetProperty("Value", "S*");
            Assert.IsTrue(propertySetting.ValueMatches("Skip"));
            Assert.IsTrue(propertySetting.ValueMatches("Stop"));
            Assert.IsFalse(propertySetting.ValueMatches("Continue"));
        }