title: Is it right to call and use this as a stub or mock?
body: <p>I'm using handwritten fakes for a demo app but I'm not sure I'm using the mock appropriately. Here's my code below:</p>
  
  <pre><code>[Fact]
      public void TransferFund_WithInsufficientAccountBalance_ThrowsException()
      {
          IBankAccountRepository stubRepository = new FakeBankAccountRepository();
          var service = new BankAccountService(stubRepository);
  
          const int senderAccountNo = 1, receiverAccountNo = 2;
          const decimal amountToTransfer = 400;
  
          Assert.Throws&lt;Exception&gt;(() =&gt; service.TransferFund(senderAccountNo, receiverAccountNo, amountToTransfer));
      }
  
      [Fact]
      public void TransferFund_WithSufficientAccountBalance_UpdatesAccounts()
      {
          var mockRepository = new FakeBankAccountRepository();
          var service = new BankAccountService(mockRepository);
          const int senderAccountNo = 1, receiverAccountNo = 2;
          const decimal amountToTransfer = 100;
  
          service.TransferFund(senderAccountNo, receiverAccountNo, amountToTransfer);
  
          mockRepository.Verify();
      }
  </code></pre>
  
  <p>Test double:</p>
  
  <pre><code>public class FakeBankAccountRepository : IBankAccountRepository
  {
      private List&lt;BankAccount&gt; _list = new List&lt;BankAccount&gt;
      {
          new BankAccount(1, 200),
          new BankAccount(2, 400)
      };
  
      private int _updateCalled;
  
      public void Update(BankAccount bankAccount)
      {
          var account = _list.First(a =&gt; a.AccountNo == bankAccount.AccountNo);
          account.Balance = bankAccount.Balance;
          _updateCalled++;
      }
  
      public void Add(BankAccount bankAccount)
      {
          if (_list.FirstOrDefault(a =&gt; a.AccountNo == bankAccount.AccountNo) != null)
              throw new Exception("Account exist");
  
          _list.Add(bankAccount);
      }
  
      public BankAccount Find(int accountNo)
      {
          return _list.FirstOrDefault(a =&gt; a.AccountNo == accountNo);
      }
  
      public void Verify()
      {
          if (_updateCalled != 2)
          {
              throw new Xunit.Sdk.AssertException("Update called: " + _updateCalled);
          }
      }
  }
  </code></pre>
  
  <p>the second test instantiates the fake and refers to it as mock, then it calls the verify method. Is this approach right or wrong?</p>