Question: I've created a mock item for my logger so that I can verify what calls are being made to it; like so:

```
  mock_log.Setup(l => l.InfoFormat(It.IsAny<string>(), It.IsAny<object[]>()));
  mock_log.Verify(m => m.InfoFormat("1 file(s) found that match criteria."), Times.Exactly(1));

```

I've debugged the code and i KNOW that these logs are defiantly being hit in the code so these should be logged. This is the code that logs that message 

```
  _log.InfoFormat("{0} file(s) found that match criteria.", files.Count);

```

and there is only 1 file that gets passed down.

So why when I verify the one call it fails?
 Any suggestions.

Answer: 
Found out it's because the string incapsulation doesn't get put through. Change the verify to 

```
 mock_log.Verify(m => m.InfoFormat("{0} file(s) found on Ftp server.", 4), Times.Exactly(1));

```
In the mock setup you are telling the logger that second parameter is an array, but then you are passing in a count at run time. I suspect that's going to be the problem. Try changing to:

`It.IsAny<object>()`

Another thought, the test you are applying in .Verify looks a little odd. I'm not sure what the Times.Exactly(1) is meant to be doing, if the mock is trying to run verify the resulting format string, you probably just want to pass in 1?