public void ShouldNotInsertLogToDatabase() { //Arrange var logToFile = false; var logToConsole = false; var logToDatabase = true; var expectedRowsAffected = 0; //Act SQLServerLogger sqlServerLogger = new SQLServerLogger(); var command = $"INSERT INTO LOG VALUES('{Constants.TestingMessageLog}', {LogType.Message})"; var rowsAffected = sqlServerLogger.WriteLogInDatabase(command); //Assert Assert.AreEqual(expectedRowsAffected, rowsAffected); }
private void LogToDatabase(string message, LogType logType) { var command = $"INSERT INTO LOG VALUES('{message}', {logType})"; sqlServerLogger.WriteLogInDatabase(command); }