ElectricField base Class and Homogene Class with tests

This commit is contained in:
Joachim Rupp
2020-07-10 14:28:52 +02:00
parent a40838df2d
commit 70c23ed59a
11 changed files with 151 additions and 7 deletions
+27
View File
@@ -0,0 +1,27 @@
#include "catch.hpp"
#include "Homogene.h"
SCENARIO("Test the Homogene class", "[Homogene]") {
GIVEN("A homogene electric field mit 5 V/m in z Richtung") {
Homogene electric_field(vec3(5,0,0));
//vec3 value(5,0,0);
//vec3 value = blitz::TinyVector<double, 3>(5,0,0)
WHEN("A value is ordered") {
THEN("Jonas value is returned") {
REQUIRE(electric_field.getValue()[0] == 5);
REQUIRE(electric_field.getValue()[1] == 0);
REQUIRE(electric_field.getValue()[2] == 0);
}
}
WHEN("The value is changed and ordered"){
electric_field.setValue(vec3(2,2,2));
THEN("Changed Value is returned"){
REQUIRE(electric_field.getValue()[0] == 2);
REQUIRE(electric_field.getValue()[1] == 2);
REQUIRE(electric_field.getValue()[2] == 2);
}
}
}
}