public void ValidateRequestedType_WhenTargetInterfaceContainsAWritableNoProperty_ShouldNotThrow() { ConcreteTypeGenerator.ValidateRequestedType(typeof(NoSetter)); }
public void ValidateRequestedType_WhenTargetInterfaceContainsAMethod_ShouldThrow() { Action x = () => ConcreteTypeGenerator.ValidateRequestedType(typeof(WithMethod)); x.Should().Throw <ConfigMappingException>().WithMessage("requested type may not have methods"); }
public void ValidateRequestedType_WhenTargetInterfaceContainsANonReadableProperty_ShouldThrow() { Action x = () => ConcreteTypeGenerator.ValidateRequestedType(typeof(NoGetter)); x.Should().Throw <ConfigMappingException>().WithMessage("write-only properties are not supported"); }
public void ValidateRequestedType_WhenTargetIsNotAnInterface_ShouldThrow() { Action x = () => ConcreteTypeGenerator.ValidateRequestedType(typeof(object)); x.Should().Throw <ConfigMappingException>().WithMessage("requested type is not an interface"); }