EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TestMaterial.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TestMaterial.cpp
1 #include <gtest/gtest.h>
2 
3 #include <Material.h>
4 
5 namespace genfit {
6 
7  class MaterialTests : public ::testing::Test {
8  protected:
9  };
10 
11  TEST_F (MaterialTests, Constructor01) {
12  Material myMaterial;
13  EXPECT_FLOAT_EQ(0, myMaterial.density);
14  EXPECT_FLOAT_EQ(0, myMaterial.Z);
15  EXPECT_FLOAT_EQ(0, myMaterial.A);
16  EXPECT_FLOAT_EQ(0, myMaterial.radiationLength);
17  EXPECT_FLOAT_EQ(0, myMaterial.mEE);
18  }
19 
20  TEST_F (MaterialTests, Constructor02) {
21  Material myMaterial(1, 2, 3, 4, 5);
22  EXPECT_FLOAT_EQ(1, myMaterial.density);
23  EXPECT_FLOAT_EQ(2, myMaterial.Z);
24  EXPECT_FLOAT_EQ(3, myMaterial.A);
25  EXPECT_FLOAT_EQ(4, myMaterial.radiationLength);
26  EXPECT_FLOAT_EQ(5, myMaterial.mEE);
27  }
28 
29  TEST_F (MaterialTests, ComparisonOperators) {
30  Material myMaterial01(0, 0, 0, 0, 0);
31  Material myMaterial02(1, 2, 3, 4, 5);
32  Material myMaterial03(1, 2, 3, 4, 5);
33 
34  EXPECT_FALSE(myMaterial01 == myMaterial02);
35  EXPECT_TRUE(myMaterial02 == myMaterial02);
36  EXPECT_TRUE(myMaterial02 == myMaterial03);
37 
38  EXPECT_TRUE(myMaterial01 != myMaterial02);
39  EXPECT_FALSE(myMaterial02 != myMaterial02);
40  EXPECT_FALSE(myMaterial02 != myMaterial03);
41  }
42 
43 }