public void ModConstructor_WhenNameIsTooLong_ThrowsArgumentException() { var exception = Assert.Throws <ArgumentOutOfRangeException>(() => new Mod( Name: TestDataHelpers.GetRandomCharacterStringFromSet(Mod.ValidModNameCharacters, Mod.NameLength + 1), Titles: ModTitleTestData.TestModTitles, Releases: ReleaseTestData.TestModReleases)); Assert.Equal($"Name must not exceed {Mod.NameLength.ToString()} characters. (Parameter 'Name')", exception.Message); }
public static String GenerateRandomizedReleaseDownloadUrlTokenTooLong() { var random = new Random(); return(TestDataHelpers.GetRandomCharacterStringFromSet(ReleaseDownloadUrl.ValidReleaseTokenCharacters, ReleaseDownloadUrl.ReleaseTokenLength + random.Next(1, 100))); }
public static String GenerateValidRandomizedReleaseDownloadUrlToken() { return(TestDataHelpers.GetRandomCharacterStringFromSet(ReleaseDownloadUrl.ValidReleaseTokenCharacters, ReleaseDownloadUrl.ReleaseTokenLength)); }
public void LanguageConstructor_WhenLanguageTagIsTooLong_ThrowsArgumentException() { var exception = Assert.Throws <ArgumentOutOfRangeException>(() => new Language( EnglishName: "English", LanguageTag: TestDataHelpers.GetRandomCharacterStringFromSet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-", Language.LanguageTagLength + 1), IsDefault: false)); Assert.Equal($"LanguageTag must not exceed {Language.LanguageTagLength.ToString()} characters. (Parameter 'LanguageTag')", exception.Message); }
public static String GenerateRandomizedModNameTooLong() { var random = new Random(); return(TestDataHelpers.GetRandomCharacterStringFromSet(Mod.ValidModNameCharacters, Mod.NameLength + random.Next(1, 100)).Trim()); }
public static String GenerateValidRandomizedSha1String() { return(TestDataHelpers.GetRandomCharacterStringFromSet(Release.ValidSha1Characters, Release.Sha1Length)); }