public void GetsOverridenMessageTemplateIfMessageOverrideIsSet() { ValidatorAttribute attribute = new MockValidatorAttribute(false); attribute.MessageTemplate = "overriden"; Assert.AreEqual("overriden", attribute.GetMessageTemplate()); }
public void RequestForMessageTemplateWhenOnlyResourceNameIsSetThrows() { ValidatorAttribute attribute = new MockValidatorAttribute(false); attribute.MessageTemplateResourceType = typeof(TestResources); attribute.GetMessageTemplate(); }
public void GetOverridenMessageTemplateFromResourceIfBothResourceNameAndTypeAreSet() { ValidatorAttribute attribute = new MockValidatorAttribute(false); attribute.MessageTemplateResourceName = "overriden"; attribute.MessageTemplateResourceType = typeof(TestResources); Assert.AreEqual("overriden from resource", attribute.GetMessageTemplate()); }
public void GetsNullMessageTemplateIfNoOverridesAreSet() { ValidatorAttribute attribute = new MockValidatorAttribute(false); Assert.AreEqual(null, attribute.GetMessageTemplate()); }