public void testResult() { Calculate calc = new Calculate(); Component comp = new Component(); List <Component> list = new List <Component>(); comp.name = "Test"; comp.quantityInStockNow = 500; comp.quantityInProduct = 5; comp.quantityInStockAfter = 0; list.Add(comp); List <Component> list2 = calc.CalcResult(list, 852); foreach (Component c in list2) { Assert.AreEqual(-3760, c.quantityInStockAfter); } }
public ActionResult Result(DataCalculate model) { Log.Log.For(this).Info("Start get controller for Result"); return(View("Result", Calc.CalcResult(t_d.GetComponentForCalculate(model.id), model.valueBox))); }