예제 #1
0
 public void ShouldReturnTrueForValidNugetPackageIds()
 {
     // http://nuget.codeplex.com/wikipage?title=Package%20Id%20Specification&IsNewlyCreatedPage=true
     string[] stringsToTest = { "hello", "i.am.a.valid.id", "nuget-core_is.cool", "123.456.789", "newsletters" };
     foreach (var s in stringsToTest)
     {
         Assert.IsTrue(PackageConstraintExtensions.IsValidNugetPackageId(s));
     }
 }
예제 #2
0
 public void ShouldReturnFalseForInvalidNugetPackageIds()
 {
     // http://nuget.codeplex.com/wikipage?title=Package%20Id%20Specification&IsNewlyCreatedPage=true
     string[] stringsToTest = { "hello._there", "i.am.not.valid.", "_neitherami", "bad..id", "", " " };
     foreach (var s in stringsToTest)
     {
         Assert.IsFalse(PackageConstraintExtensions.IsValidNugetPackageId(s));
     }
 }