Commits

Mark Heath  committed f1c911b

More unit tests

  • Participants
  • Parent commits 4f15b9a

Comments (0)

Files changed (3)

File SetVersionTask/VersionUtils.cs

             {
                 input = input.Substring(0, commentIndex);
             }
-            // Version\("(?<Version>(?<Major>\d+)\.(?<Minor>\d+)\.(?:(?:(?<Build>\d+)\.(?<Revision>\*|\d+))|(?<Build>\*|\d+)))"\)
             string pattern = @"^\s*\[assembly: (?:(?:AssemblyFile)|(?:AssemblyInformational)|(?:Assembly))Version\(""(?<Version>[0-9\.\*]+)""\)\]";
             Regex regex = new Regex(pattern);
             var m = regex.Match(input);
             }
             return null;
         }
-
-
     }
 }

File SetVersionTaskTests/VersionUpdateRuleTests.cs

             }
         }
 
+        [TestCase("1.2.3.4.5")]
+        [TestCase("......")]
+        [TestCase("1.2.3.4.")]
+        public void RulesMustHaveNoMoreThanFourParts(string rule)
+        {
+            Assert.Throws<ArgumentException>(() => new VersionUpdateRule(rule));
+        }
         
         [TestCase("1.2.3.4", "0.0.0.0")]
         [TestCase("1.2.3.4", "0.0.*")]
             var r = new VersionUpdateRule(rule);
             var updated = r.Update(input);
             Assert.AreEqual(expected, updated);
-        }
-
-
-        [TestCase("1.2.3.4.5")]
-        [TestCase("......")]
-        [TestCase("1.2.3.4.")]
-        public void RulesMustHaveNoMoreThanFourParts(string rule)
-        {
-            Assert.Throws<ArgumentException>(() => new VersionUpdateRule(rule));
-        }
-    
+        }    
     }
 }

File SetVersionTaskTests/VersionUtilsTests.cs

 
         [TestCase("Version(\"11.22.33.44\")")]
         [TestCase("//[assembly: AssemblyVersion(\"1.2.3.4\")]")]
+        [TestCase("[assembly: AssemblyCheeseVersion(\"11.22.33.44\")]")]
+        [TestCase("[assembly: Version(\"11.22.33.44\")]")]
+        [TestCase("[blah: AssemblyVersion(\"11.22.33.44\")]")]
         public void ShouldNotMatch(string input)
         {
             var versionString = VersionUtils.GetVersionStringFromCSharp(input);