// GET api/values public IEnumerable <string> Get() { return(new string[] { _sampleLogic.AddMessage(1, 2), _sampleLogic.SubtractMessage(5, 3), _sampleLogic.MultiplyMessage(99, 99), _sampleLogic.DivideMessage(100, 10) }); }
public void SampleLogic_AddMessage() { int first = 1, second = 2; int returnVal = 3; _mockCalculator.Setup(c => c.Add(first, second)).Returns(returnVal); var result = _sampleLogic.AddMessage(1, 2); Assert.NotNull(result); Assert.Equal($"{first} + {second} = {returnVal}", result); }
public ActionResult Index() { ViewBag.Title = "Home Page"; StringBuilder sb = new StringBuilder(); sb.AppendLine(_sampleLogic.AddMessage(1, 2)); sb.AppendLine(_sampleLogic.SubtractMessage(10, 7)); sb.AppendLine(_sampleLogic.MultiplyMessage(10000, 5)); sb.AppendLine(_sampleLogic.DivideMessage(2000, 2)); foreach (string model in _sampleLogic.LoadSampleModel()) { sb.AppendLine(model); } return(Content(sb.ToString())); }