public void CalculatePi_IsAccuracte() { string calculated = service.CalculatePi(16); // 3.1415926535897932 double actual = Convert.ToDouble(calculated); // 3.1415926535897931 (rounding bug?) double expected = Math.PI; // 3.1415926535897931 Assert.Equal(expected, actual); }
public IActionResult CalculatePi(int digits) { return(Ok(_mathService.CalculatePi(digits))); }