Beispiel #1
0
        public void LocalizedValidation_Uses_CurrentUICultureLocalization()
        {
            var bar = new OnlyLocalizedForLithuaniaBar();

            using (SwitchUICulture(CultureInfo.CreateSpecificCulture("lt-LT")))
            {
                runner.IsValid(bar);
                ErrorSummary summary = runner.GetErrorSummary(bar);

                Assert.IsNotNull(summary);
                Assert.AreEqual("lt-Bar_BazNonEmpty", summary.ErrorMessages[0]);
                Assert.AreEqual("lt-Bar_Baz", summary.InvalidProperties[0]);
            }
        }
		public void LocalizedValidation_Uses_CurrentUICultureLocalization()
		{
			var bar = new OnlyLocalizedForLithuaniaBar();
			using (SwitchUICulture(CultureInfo.CreateSpecificCulture("lt-LT")))
			{
				runner.IsValid(bar);
				ErrorSummary summary = runner.GetErrorSummary(bar);

				Assert.IsNotNull(summary);
				Assert.AreEqual("lt-Bar_BazNonEmpty", summary.ErrorMessages[0]);
				Assert.AreEqual("lt-Bar_Baz", summary.InvalidProperties[0]);
			}
		}