8#include <gtest/gtest.h>
17 class ConstEzFieldTest :
public ::testing::Test {
19 void SetUp()
override { field_.setEz(10.0); }
24 TEST_F(ConstEzFieldTest, GetEzSetEz) {
25 EXPECT_DOUBLE_EQ(field_.getEz(), 10.0);
27 EXPECT_DOUBLE_EQ(field_.getEz(), -3.0);
29 EXPECT_DOUBLE_EQ(field_.getEz(), 0.0);
32 TEST_F(ConstEzFieldTest, EfieldP) {
35 EXPECT_DOUBLE_EQ(E.
getEx(), 0.0);
36 EXPECT_DOUBLE_EQ(E.
getEy(), 0.0);
37 EXPECT_DOUBLE_EQ(E.
getEz(), 10.0);
40 TEST_F(ConstEzFieldTest, EfieldPT) {
42 EVector E = field_.Efield(P, 1.0);
43 EXPECT_DOUBLE_EQ(E.
getEx(), 0.0);
44 EXPECT_DOUBLE_EQ(E.
getEy(), 0.0);
45 EXPECT_DOUBLE_EQ(E.
getEz(), 10.0);
48 TEST_F(ConstEzFieldTest, Scale) {
50 EXPECT_DOUBLE_EQ(field_.getEz(), 20.0);
53 EXPECT_DOUBLE_EQ(E.
getEz(), 20.0);
56 EXPECT_DOUBLE_EQ(field_.getEz(), -10.0);
58 EXPECT_DOUBLE_EQ(E.
getEz(), -10.0);
TEST_F(MonitorTest, GetType)
An electric field vector.
double getEz() const
Get component.
double getEx() const
Get component.
double getEy() const
Get component.