2

How to assert that no calls to an object have been made using FakeItEasy?

I tried:

A.CallTo(() => _myObj).MustNotHaveHappened();

That does not work though, it throws the following exception:

System.ArgumentException : The specified expression is not a method call or property getter.

How to?

D.R.
  • 20,268
  • 21
  • 102
  • 205

1 Answers1

2

Use the mechanism described in Specify a call to configure any method or property and just pass the fake to A.CallTo:

A.CallTo(_myObj).MustNotHaveHappened();
Blair Conrad
  • 233,004
  • 25
  • 132
  • 111
D.R.
  • 20,268
  • 21
  • 102
  • 205