コード例 #1
0
        public void AngleToRadians()
        {
            //Arrange
            var angle1           = 4.7623m;
            var expectedRadians1 = 0.0831m;
            var angle2           = 24m;
            var expectedRadians2 = 0.4189m;
            var angle3           = 21.0208m;
            var expectedRadians3 = 0.3669m;
            var angle4           = 81.514m;
            var expectedRadians4 = 1.4227m;

            //Act
            var radians1 = Math.Round(Conversions.AngleToRadians(angle1), 4);
            var radians2 = Math.Round(Conversions.AngleToRadians(angle2), 4);
            var radians3 = Math.Round(Conversions.AngleToRadians(angle3), 4);
            var radians4 = Math.Round(Conversions.AngleToRadians(angle4), 4);

            //Assert
            Assert.AreEqual(expectedRadians1, radians1);
            Assert.AreEqual(expectedRadians2, radians2);
            Assert.AreEqual(expectedRadians3, radians3);
            Assert.AreEqual(expectedRadians4, radians4);
        }