public void GetDefaultResourceType_should_return_null_if_defaultResourceType_and_metadataConventionsAttribute_has_no_type() { // arrange LocalizationConventions.DefaultResourceType = null; Type containerType = typeof(DummyContainerWithEmptyAttribute); // act var type = LocalizationConventions.GetDefaultResourceType(containerType); // assert Assert.Null(type); }
public void GetDefaultResourceType_should_return_type_from_attributeMetadataConventions() { // arrange LocalizationConventions.DefaultResourceType = typeof(TestResource); Type containerType = typeof(DummyContainerWithAttributeAndResourceType); // act var type = LocalizationConventions.GetDefaultResourceType(containerType); // assert Assert.NotNull(type); Assert.Equal(type, typeof(TestResource2)); }
public void GetDefaultResourceType_should_return_null_if_convensions_is_not_acivated() { // arrange LocalizationConventions.DefaultResourceType = typeof(TestResource); LocalizationConventions.Enabled = false; Type containerType = typeof(DummyContainer); // act var type = LocalizationConventions.GetDefaultResourceType(containerType); // assert Assert.Null(type); }
public void GetDefaultResourceType_should_return_defaultResourceType_if_convensions_is_acivated() { // arrange LocalizationConventions.DefaultResourceType = typeof(TestResource); Type containerType = typeof(DummyContainer); // act var type = LocalizationConventions.GetDefaultResourceType(containerType); // assert Assert.NotNull(type); Assert.Equal(type, typeof(TestResource)); }
public void GetDefaultResourceType_should_return_defaultResourceType_if_metadataConventionsAttribute_has_no_type() { // arrange LocalizationConventions.DefaultResourceType = typeof(TestResource); LocalizationConventions.Enabled = true; Type containerType = typeof(DummyContainerWithEmptyAttribute); // act var type = LocalizationConventions.GetDefaultResourceType(containerType); // assert Assert.NotNull(type); Assert.Equal(type, typeof(TestResource)); }