public DefaultLocalizationValidationAttributeAdapter(ForEvolveMvcDefaultLocalizationAdapterOptions options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } SupportedAttributes = options.SupportedAttributes; }
public void Should_guard_against_null_options() { // Arrange ForEvolveMvcDefaultLocalizationAdapterOptions options = null; // Act & Assert Assert.Throws <ArgumentNullException>(() => new DefaultLocalizationValidationAttributeAdapter(options)); }
public void Should_set_SupportedAttributes() { // Arrange var supportedAttributes = new string[] { "asdf", "sdfg" }; var options = new ForEvolveMvcDefaultLocalizationAdapterOptions(supportedAttributes); // Act var adapter = new DefaultLocalizationValidationAttributeAdapter(options); // Assert Assert.Equal(adapter.SupportedAttributes, supportedAttributes); }
public DefaultLocalizationValidationAttributeAdapterTest() { Options = new ForEvolveMvcDefaultLocalizationAdapterOptions(); AdapterUnderTest = new DefaultLocalizationValidationAttributeAdapter(Options); }