public void TestExternalApi() { ExternalApi ExtApi = new ExternalApi(); int res = ExtApi.GetValue(10); Assert.IsTrue(res == 40); }
// GET api/values/5 public string GetValue(int currentValue) { CalculateValue CalcVal = new CalculateValue(); currentValue = CalcVal.Calc(currentValue); ExternalApi ExtApi = new ExternalApi(); currentValue = ExtApi.GetValue(currentValue); Value vl = new Value(); vl.value = currentValue; repo.Create(vl); repo.Save(); //db.Values.Add(vl); //db.SaveChanges(); return(currentValue.ToString()); }