public void LogFile() { var tmpLogFile = Path.GetTempFileName(); using (var sw = new StreamWriter(tmpLogFile)) { sw.Write("<fakelog time=\"goodtime-file\" log=\"my log\"></fakelog>"); } Console.WriteLine(tmpLogFile); var parser = new XMLLogParser(); parser.SetConfig(logConfig); parser.SetRegistry(logRegistry); logRegistry.AddLog("goodtime-file", "my log").Returns(logEntry); parser.Parse(tmpLogFile); logRegistry.Received().AddLog("goodtime-file", "my log"); logRegistry.DidNotReceive().AddValueToLog(logEntry, Arg.Any <LogAttribute>(), Arg.Any <object>()); }