ElectricField base Class and Homogene Class with tests
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user