public void TestCustomerOrderWithSQLServerLogger() { IInternetCustomerRead _internetCustomer = new InternetCustomer(); Logger _logger = new SQLServerLogger(); Order o = new Order(_internetCustomer, _logger); Customer cust = o.GetCustomerById(5); o._orderItems = oi; decimal cost = o.CalculateTotal(cust); Assert.AreEqual(8.63m, cost); }
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); }