public void CalculationManager_Log_Valid_Calculation() { CalculationManager calcManager = new CalculationManager(); Calculation calculation = new Calculation() { OperationName = null, OperatorA = 1, OperatorB = 1, Result = 1 }; Assert.AreEqual(0, calcManager.LogCalculation(calculation)); }
public JsonResult LogOperation(CalculationModel calculation) { int result = -1; CalculationManager calcManager = new CalculationManager(); if (calculation != null) { calculation.CreateDT = DateTime.UtcNow; result = calcManager.LogCalculation(calculation.GetCalculation()); } return new JsonResult { Data = result }; }
public void CalculationManager_Calculation_Null() { CalculationManager calcManager = new CalculationManager(); Assert.AreEqual(-1, calcManager.LogCalculation(null)); }