예제 #1
0
파일: Program.cs 프로젝트: UShandruk/Pub
        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();
        }
예제 #2
0
파일: UnitTest1.cs 프로젝트: UShandruk/Pub
        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);
        }