TEST(Angle, DualDivisionOperator){ Angle a = M_PI * Angle::rad; const Angle * const temp = &a; a /= 2.0; EXPECT_EQ(temp,&a); ASSERT_DOUBLE_EQ(a.get_angle(),(M_PI/2)); }
TEST(Angle, DualAddOperator){ Angle a = (M_PI/4) * Angle::rad; Angle b = (M_PI/4) * Angle::rad; const Angle * const temp = &a; EXPECT_EQ(temp, &(a += b)); ASSERT_DOUBLE_EQ(a.get_angle(),(M_PI/2)); }
TEST(Angle, DualMultiplicationOperator){ Angle a = (M_PI/4) * Angle::rad; const Angle * const temp = &a; a *= 4.0; EXPECT_EQ(temp,&a); ASSERT_DOUBLE_EQ(a.get_angle(),M_PI); }
TEST(Angle, DualSubstractionOperator){ Angle a = (2 * M_PI) * Angle::rad; Angle b = M_PI * Angle::rad; const Angle * const temp = &a; EXPECT_EQ(temp, &(a -= b)); ASSERT_DOUBLE_EQ(a.get_angle(),M_PI); }
TEST(Angle, SingleAddOperator){ Angle a = (M_PI/2) * Angle::rad; Angle b = (M_PI/2) * Angle::rad; Angle c = a + b; ASSERT_DOUBLE_EQ(c.get_angle(),(M_PI)); }
TEST(Angle, ConversionRadians_Degrees){ Angle a = M_PI * Angle::rad; Angle b = 180.0 * Angle::deg; ASSERT_DOUBLE_EQ(a.get_angle(),b.get_angle()); }
TEST(Angle, ConstructorValue){ Angle a; a = M_PI * Angle::rad; ASSERT_DOUBLE_EQ(a.get_angle(),M_PI); }
TEST(Angle, DefaultConstructor){ Angle a; ASSERT_DOUBLE_EQ(a.get_angle(),0.0); }
TEST(Angle, SingleDivisionOperator){ Angle a = (M_PI*2) * Angle::rad; a = a / 2.0; ASSERT_DOUBLE_EQ(a.get_angle(),M_PI); }
TEST(Angle, SingleMultiplicationOperator){ Angle a = M_PI * Angle::rad; a = a * 2.0; ASSERT_DOUBLE_EQ(a.get_angle(),(M_PI * 2)); }
TEST(Angle, SingleSubstractionOperator){ Angle a = M_PI * Angle::rad; Angle b = (M_PI/2) * Angle::rad; Angle c = a - b; ASSERT_DOUBLE_EQ(c.get_angle(),(M_PI/2)); }