Welcome to Typemock Answers. Here you can ask and receive answers from other community members. And if you liked or disliked an answer or thread: react with an up- or downvote Enjoy!

Is there AAA syntax for Assign?

+1 vote
Hei,

I want to rewrite some of old code that use natural mocks with RecordExpectations. The code is like this:

using(RecordExpectations recorder = new RecordExpectations())
{
A a = new A(null, null);
recorder.CallOriginal().CheckArguments(new Assign("1"), new Assign("2"));
...
}

So what I am achieving here is mocking just a call to a constructor of A with a call with specific arguments.

But how would this look with AAA? I tried this:

A a = new ("1", "2");
Isolate.Fake.Instance<A>(Member.CallOriginal);
Isolate.SwapNextInstance<A>().With(a);

This does not work: I am getting null reference exception in SwapNextInstance call. But how can I mock a creation of a instance of A with a call to a constructor with specific arguments?
asked Nov 6, 2008 by vagif (5,350 points)

1 Answer

0 votes
Hi

Currently the 'Assign' feature is not supported with AAA syntax. :(
That said, we are planning to bring the AAA API to have the same features
of the natural mocks API.
answered Nov 7, 2008 by ohad (37,080 points)
...