#include "Sample/HardParticle/Sphere.h"

#include "Sample/Material/Vacuum.h"
#include "Sample/Particle/Compound.h"
#include "Sample/Particle/IParticle.h"
#include "Sample/Particle/Particle.h"
#include "Sample/Particle/Rotations.h"
#include "Tests/GTestWrapper/google_test.h"

TEST(Compound, CompoundDefaultConstructor)
{
    std::unique_ptr<Compound> composition(new Compound());
    std::vector<R3> positions;
    positions.emplace_back();
    EXPECT_EQ(0u, composition->nbrComponents());
}

TEST(Compound, CompoundClone)
{
    Compound composition{};
    R3 position = R3(1.0, 1.0, 1.0);
    const Vacuum material;
    Sphere ff(5.);
    Particle particle(material, ff);
    composition.addComponent(particle, position);

    std::unique_ptr<Compound> clone(composition.clone());
    const auto components = clone->components();
    EXPECT_EQ(components.size(), 1u);
    const auto* p_particle = components[0];
    EXPECT_EQ(p_particle->particleRotation(), nullptr);
    EXPECT_EQ(p_particle->particlePosition(), position);
}
