static void Main(string[] args) { decimal a = 3; decimal b = 4; decimal c = 5; double result; //var result = new TriangleService().CalculateSquare(a, b, c); var triangleService = new TriangleService(); result = triangleService.CalculateSquare(a, b, c); Console.WriteLine("Площадь равна {0}", result); Console.ReadKey(); }
public void CalculateTriangleSquare() { //Arrange - подготовка TriangleService triangleService = new TriangleService(); decimal a = 3; decimal b = 4; decimal c = 5; //Act - выполнение тестируемого действия (вызов тестироемого метода) double result = triangleService.CalculateSquare(a, b, c); //Assert - проверка предположения Assert.AreEqual(6, result); }