Esempio n. 1
0
        public void LocalizedValidation_ThrowsArgumentException_When_ResourceTypeNotSet()
        {
            var foo = new ResourceTypeNotSet();

            using (SwitchUICulture(CultureInfo.CreateSpecificCulture("en-US")))
            {
                try
                {
                    runner.IsValid(foo);

                    Assert.Fail("Should have gotten exception");
                }
                catch (ArgumentException ex)
                {
                    Assert.AreEqual(
                        "You have set ErrorMessageKey and/or FriendlyNameKey but have not specified the ResourceType to use for lookup.",
                        ex.Message);
                }
            }
        }
		public void LocalizedValidation_ThrowsArgumentException_When_ResourceTypeNotSet()
		{
			var foo = new ResourceTypeNotSet();

			using (SwitchUICulture(CultureInfo.CreateSpecificCulture("en-US")))
			{
				try
				{
					runner.IsValid(foo);

					Assert.Fail("Should have gotten exception");
				}
				catch (ArgumentException ex)
				{
					Assert.AreEqual(
							"You have set ErrorMessageKey and/or FriendlyNameKey but have not specified the ResourceType to use for lookup.",
							ex.Message);
				}
			}
		}