I’m using reflection to get a custom attribute, and then I want to validate the type passed into the constructor, so I tried this:
var autoMapAttribute = dtoType.GetCustomAttribute<AutoMapAttribute>();
autoMapAttribute?.SourceType.Should()
BeOfType<IbiSiliconProductStepping>();
It fails saying the type is System.RuntimeType
. If I instead change the check to:
Be(typeof(IbiSiliconProductStepping));
then it succeeds. I’m confused why the first one doesn’t work.