public void NullThrowsException() { // Arrange string packageId = null; // Act & Assert Assert.Throws <ArgumentNullException>(paramName: "packageId", testCode: () => PackageIdValidator.IsValidPackageIdWithTimeout(packageId)); }
public void NonAlphaNumericUnderscoreDotDashIsInvalid() { // Arrange string packageId = "ILike*Asterisks"; // Act bool isValid = PackageIdValidator.IsValidPackageIdWithTimeout(packageId); // Assert Assert.False(isValid); }
public void UnderscoreDotAndDashSeparatorsAreValid() { // Arrange string packageId = "Nu_Get.Core-IsCool"; // Act bool isValid = PackageIdValidator.IsValidPackageIdWithTimeout(packageId); // Assert Assert.True(isValid); }
public void NumbersAndWordsDotSeparatedAllowd() { // Arrange string packageId = "1.2.3.4.Uno.Dos.Tres.Cuatro"; // Act bool isValid = PackageIdValidator.IsValidPackageIdWithTimeout(packageId); // Assert Assert.True(isValid); }
public void MultipleDotSeparatorsAllowed() { // Arrange string packageId = "I.Like.Writing.Unit.Tests"; // Act bool isValid = PackageIdValidator.IsValidPackageIdWithTimeout(packageId); // Assert Assert.True(isValid); }
public void AlphaNumericIsValid() { // Arrange string packageId = "42This1Is4You"; // Act bool isValid = PackageIdValidator.IsValidPackageIdWithTimeout(packageId); // Assert Assert.True(isValid); }
public void IsValidPackageId_PackageIdWithTwoUnderscores_Success() { // Arrange string packageId = "Hello__World"; // Act bool isValid = PackageIdValidator.IsValidPackageIdWithTimeout(packageId); // Assert Assert.True(isValid); }
public void DotToolsIsNotAllowed() { // Arrange string packageId = ".tools"; // Act bool isValid = PackageIdValidator.IsValidPackageIdWithTimeout(packageId); // Assert Assert.False(isValid); }
public void EmptyIsNotValid() { // Arrange string packageId = ""; // Act bool isValid = PackageIdValidator.IsValidPackageIdWithTimeout(packageId); // Assert Assert.False(isValid); }
public void EndingWithSeparatorsNotAllowed() { // Arrange string packageId = "StartWithSeparator."; // Act bool isValid = PackageIdValidator.IsValidPackageIdWithTimeout(packageId); // Assert Assert.False(isValid); }
public void ConsecutiveSeparatorsNotAllowed() { // Arrange string packageId = "I_.Like.-Separators"; // Act bool isValid = PackageIdValidator.IsValidPackageIdWithTimeout(packageId); // Assert Assert.False(isValid); }