Exemple #1
0
        public void LocalizedValidation_IsOk_WhenMessagesExists()
        {
            var description = new CorrectlyLocalized();

            runner.IsValid(description);
            ErrorSummary summary = runner.GetErrorSummary(description);

            Assert.IsNotNull(summary);
            Assert.AreEqual(Messages.CorrectlyLocalized_DescriptionValidateNonEmpty, summary.ErrorMessages[0]);
            Assert.AreEqual(Messages.CorrectlyLocalized_Description, summary.InvalidProperties[0]);
        }
Exemple #2
0
        public void LocalizedValidation_Uses_DefaultCulture_When_NoLocalIsAvailable()
        {
            var description = new CorrectlyLocalized();

            using (SwitchUICulture(CultureInfo.CreateSpecificCulture("ru-RU")))
            {
                runner.IsValid(description);
                ErrorSummary summary = runner.GetErrorSummary(description);

                Assert.IsNotNull(summary);
                Assert.AreEqual(Messages.CorrectlyLocalized_DescriptionValidateNonEmpty, summary.ErrorMessages[0]);
                Assert.AreEqual(Messages.CorrectlyLocalized_Description, summary.InvalidProperties[0]);
            }
        }
		public void LocalizedValidation_Uses_DefaultCulture_When_NoLocalIsAvailable()
		{
			var description = new CorrectlyLocalized();

			using (SwitchUICulture(CultureInfo.CreateSpecificCulture("ru-RU")))
			{

				runner.IsValid(description);
				ErrorSummary summary = runner.GetErrorSummary(description);

				Assert.IsNotNull(summary);
				Assert.AreEqual(Messages.CorrectlyLocalized_DescriptionValidateNonEmpty, summary.ErrorMessages[0]);
				Assert.AreEqual(Messages.CorrectlyLocalized_Description, summary.InvalidProperties[0]);
			}

		}
		public void LocalizedValidation_IsOk_WhenMessagesExists()
		{
			var description = new CorrectlyLocalized();

			runner.IsValid(description);
			ErrorSummary summary = runner.GetErrorSummary(description);

			Assert.IsNotNull(summary);
			Assert.AreEqual(Messages.CorrectlyLocalized_DescriptionValidateNonEmpty, summary.ErrorMessages[0]);
			Assert.AreEqual(Messages.CorrectlyLocalized_Description, summary.InvalidProperties[0]);
		}