News for hackers. Stuff that matters.
Re:Stop Using Mocks by latch on Wednesday March 23, 2011 @08:19PM (#2362148)
The test that you picked is specifically there to test that call. Did you not see:

  Any.CallTo(store).WithReturnType<User>().Returns(user);
Also, two of the tests have seen been updated to truly leverage FakeItEasy's stubbing capabilities:

  [Test]
  public void ReturnsNullIfThePasswordsDontMatch()
  {
    var store = A.Fake<IDataStore>();
    var encryption = A.Fake<IEncryption>();

    A.CallTo(() => encryption.CheckPassword(null, null)).WithAnyArguments().Returns(false);
    var user = new UserRepository(store, encryption).FindByCredentials(null, null);
   
    Assert.IsNull(user)     
  }
There's no setup/expectation on the store - it'll just returned a canned (default new user) response.

There are no comments on this comment yet.