Ejemplo n.º 1
0
        public void PrereleasePackages()
        {
            bool globallyPermitted     = PackageVersionsRule.IsPackageValid(UiAutomationNextPackage, "20.4.0-beta.853134", _settings, true);
            bool individuallyPermitted = PackageVersionsRule.IsPackageValid(ComplextScenariosPackage, "1.0.2-beta.852560", _settings, false);

            Assert.IsTrue(globallyPermitted);
            Assert.IsTrue(individuallyPermitted);
        }
Ejemplo n.º 2
0
        public void InvalidConfig()
        {
            const string badSettingsJson = "Name:\"UiPath.UIAutomation.Next.Activities\", Min:\"20.4.0\"";
            bool         success         = PackageVersionsRule.TryParseSettingsJson(badSettingsJson, out Dictionary <string, PackageVersionSetting> settings);

            Assert.IsFalse(success);
            Assert.IsNull(settings);
        }
Ejemplo n.º 3
0
        public void RangeTest()
        {
            bool below  = PackageVersionsRule.IsPackageValid(MailActivitiesPackage, "1.6.0-beta123", _settings, true);
            bool within = PackageVersionsRule.IsPackageValid(MailActivitiesPackage, "1.7.9", _settings, true);
            bool above  = PackageVersionsRule.IsPackageValid(MailActivitiesPackage, "1.6.9", _settings, true);

            Assert.IsFalse(below);
            Assert.IsTrue(within);
            Assert.IsFalse(above);
        }
Ejemplo n.º 4
0
        public void NoPrereleasePackage()
        {
            bool nonPrereleaseVersion = PackageVersionsRule.IsPackageValid(UiAutomationNextPackage, "20.4.0", _settings, true);
            bool prereleaseVersion    = PackageVersionsRule.IsPackageValid(UiAutomationNextPackage, "20.3.0", _settings, false);
            bool individuallyBlocked  = PackageVersionsRule.IsPackageValid(MailActivitiesPackage, "1.7.5-beta123", _settings, true);
            bool globallyBlocked      = PackageVersionsRule.IsPackageValid("UiPath.System.Activities", "20.4.0-beta.864462", _settings, false);

            Assert.IsTrue(nonPrereleaseVersion);
            Assert.IsFalse(prereleaseVersion);
            Assert.IsFalse(individuallyBlocked);
            Assert.IsFalse(globallyBlocked);
        }
Ejemplo n.º 5
0
        public void ExactVersion()
        {
            bool exactVersion = PackageVersionsRule.IsPackageValid(ExcelPackage, "1.4.2", _settings, true);

            Assert.IsTrue(exactVersion);
        }
Ejemplo n.º 6
0
        public void BelowMinVersion()
        {
            bool belowMinVersion = PackageVersionsRule.IsPackageValid(UiAutomationNextPackage, "20.3.0", _settings, true);

            Assert.IsFalse(belowMinVersion);
        }
Ejemplo n.º 7
0
        public void AboveMaxVersion()
        {
            bool aboveMaxVersion = PackageVersionsRule.IsPackageValid(ExcelPackage, "1.5.0", _settings, true);

            Assert.IsFalse(aboveMaxVersion);
        }
Ejemplo n.º 8
0
 public PackageVersionsRuleTests()
 {
     _settingsParsed = PackageVersionsRule.TryParseSettingsJson(SettingsJson, out _settings);
 }
Ejemplo n.º 9
0
 public void UnspecifiedPackage()
 {
     Assert.IsTrue(PackageVersionsRule.IsPackageValid("UiPath.System.Activities", "20.4", _settings, true));
 }
 //Registers the rules with Workflow Analyzer
 public void Initialize(IAnalyzerConfigurationService workflowAnalyzerConfigService)
 {
     workflowAnalyzerConfigService.AddRule(PropertySettingsRule.Get());
     workflowAnalyzerConfigService.AddRule(PackageVersionsRule.Get());
 }