chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
How do I get around this error message?

*** Faking behavior on struct System.Data.SqlTypes.SqlString is not supported in the following cases:
1. Faking behavior on more than one struct of the same type.
2. Faking behavior on more than one method on the same struct.

Here is my code
var format = Isolate.Fake.Instance<SqlString>(Members.ReturnRecursiveFakes);
Isolate.WhenCalled(() => format.IsNull).WillReturn(true);
asked by keithbeller (1.1k points)

2 Answers

+1 vote
Hi,

Does it happen when executing multiple tests or just a single test? Is the test being executed is decorated with [Isolated] attribute?

We've just fixed a similar issue, you can find the fixed version here.
answered by Elisha (12k points)
+1 vote
By the way, the default fake type is a recursive fake. So this code:
var format = Isolate.Fake.Instance<SqlString>(Members.ReturnRecursiveFakes);

Is equivalent to:
var format = Isolate.Fake.Instance<SqlString>();
answered by Elisha (12k points)
...