I am getting following exception:
System.ArgumentException: 'Only constant and single-dimensional array expressions are supported'
While trying to fake some abstact object with additional attribute that takes parameters in constructor.
var foo = A.Fake<SelfComplementaryCustomizableTupleConsumer>(
opt => opt.WithAttributes(
() => new RequiredVariableNameAttribute(requiredVariableName,requiredVariableType)
)
);
Worth mentioning is that if I invoke constructor with no arguments everything is just fine. What is even more instresting for me is that if I substitue variables with constants problem is not appearing either.
Complete code:
string requiredVariableName = "abc";
Type requiredVariableType = typeof(string);
var foo = A.Fake<SelfComplementaryCustomizableTupleConsumer>(
opt => opt.WithAttributes(
() => new RequiredVariableNameAttribute(requiredVariableName,requiredVariableType)
)
);
var requiredVariables = foo.GetRequiredVariables();
Assert.IsTrue(requiredVariables.TryGetValue(requiredVariableName, out Type tmp));