public void ModTitleConstructor_WhenTitleIsTooLong_ThrowsArgumentException() { var exception = Assert.Throws <ArgumentOutOfRangeException>(() => new ModTitle( Language: LanguageTestData.EnglishWithoutId, Title: TestDataHelpers.GetRandomizedUnicodeCharacterString(ModTitle.TitleLength + 1))); Assert.Equal($"Title must not exceed {ModTitle.TitleLength.ToString()} characters. (Parameter 'Title')", exception.Message); }
public static String GenerateRandomizedModTitleString() { var random = new Random(); return(TestDataHelpers.GetRandomizedUnicodeCharacterString(random.Next(1, ModTitle.TitleLength))); }