public void GetCultureInfo_EmptyString_ThrowsCultureNotFoundException(bool withBrackets) { //Arrange var culture = string.Empty; //Act //Assert Assert.ThrowsException <CultureNotFoundException>(() => CultureInfoUtil.GetCultureInfo(culture, false)); }
public void GetCultureInfo_StringIsNotValidCulture_ThrowsCultureNotFoundException(bool withBrackets) { //Arrange var culture = withBrackets ? "(llllll)" : "llllll"; //Act //Assert Assert.ThrowsException <CultureNotFoundException>(() => CultureInfoUtil.GetCultureInfo(culture, false)); }
public void GetCultureInfo_NullString_ThrowsArgumentNullException(bool withBrackets) { //Arrange string culture = null; //Act //Assert Assert.ThrowsException <ArgumentNullException>(() => CultureInfoUtil.GetCultureInfo(culture, false)); }
public void GetCultureInfo_ValidCultureWithBracketsNotMatchingCall_ThrowsCultureNotFoundException() { //Arrange var culture = new CultureInfo("de-DE"); var cultureString = $"({culture.Name})"; //Act //Assert Assert.ThrowsException <CultureNotFoundException>(() => CultureInfoUtil.GetCultureInfo(cultureString, false)); }
public void GetCultureInfo_ValidCultureWithoutBracketsNotMatchingCall_ReturnsCorrespondingCultureInfo() { //Arrange var culture = new CultureInfo("de-DE"); var cultureString = culture.Name; //Act var returnCulture = CultureInfoUtil.GetCultureInfo(cultureString, true); //Assert Assert.AreEqual(culture, returnCulture); }