mikhailemv

Untitled

Nov 26th, 2021
651
360 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using NUnit.Framework;
  3.  
  4. namespace Manipulation
  5. {
  6.     public class TriangleTask
  7.     {
  8.         public static double GetABAngle(double a, double b, double c)
  9.         {
  10.             if (a <= 0 || b <= 0 || c < 0)
  11.                 return double.NaN;
  12.             return (c != 0) ? Math.Acos((a * a + b * b - c * c) / (2 * a * b)) : 0;
  13.         }
  14.     }
  15.  
  16.     [TestFixture]
  17.     public class TriangleTask_Tests
  18.     {
  19.         [TestCase(3, 4, 5, Math.PI / 2)]
  20.         [TestCase(1, 1, 1, Math.PI / 3)]
  21.         [TestCase(1, 2, 2, 1.31811607)]
  22.         [TestCase(1, 1, 0, double.NaN)]
  23.         public void TestGetABAngle(double a, double b, double c, double expectedAngle)
  24.         {
  25.             //Assert.Fail("Not implemented yet");
  26.         }
  27.     }
  28. }
RAW Paste Data