public void LogErrorToFile() { string message = "TEST MESSAGE"; var repo = new FileSystemRepositoryFactory().CreateRepository(); var errorFactory = new ErrorEntityFactory(message); var stringResult = repo.WriteLog(errorFactory); var result = this.DeserializeJsonObject <ErrorLogEntity>(stringResult); Assert.Equal(result.Type, "ERROR"); Assert.Equal(result.Message, message); }
public void LogErrorToConsole() { string message = "TEST MESSAGE"; var repo = new ConsoleRepositoryFactory().CreateRepository(); var errorFactory = new ErrorEntityFactory(message); var stringResult = repo.WriteLog(errorFactory); var result = this.DeserializeJsonObject <ErrorLogEntity>(stringResult); Assert.Equal(result.Type, "ERROR"); Assert.Equal(result.Message, message); Assert.Equal(ConsoleColor.Red, Console.ForegroundColor); }