<commit_before>#include "quadrature/quadrature_set.h"

#include <memory>

#include "quadrature/tests/quadrature_point_mock.h"
#include "test_helpers/gmock_wrapper.h"

namespace  {

using namespace bart;

template <typename DimensionWrapper>
class QuadratureSetTest : public ::testing::Test {
 public:
  static constexpr int dim = DimensionWrapper::value;
  quadrature::QuadratureSet<dim> test_set_;
};

TYPED_TEST_CASE(QuadratureSetTest, bart::testing::AllDimensions);

TYPED_TEST(QuadratureSetTest, Constructor) {
  constexpr int dim = this->dim;
  EXPECT_NO_THROW(quadrature::QuadratureSet<dim> test_set);
}

TYPED_TEST(QuadratureSetTest, AddPoint) {
  constexpr int dim = this->dim;
  auto quadrature_point =
      std::make_shared<quadrature::QuadraturePointMock<dim>>();
  auto second_quadrature_point =
      std::make_shared<quadrature::QuadraturePointMock<dim>>();

  EXPECT_EQ(this->test_set_.size(), 0);

  EXPECT_TRUE(this->test_set_.AddPoint(quadrature_point));
  EXPECT_EQ(this->test_set_.size(), 1);

  EXPECT_TRUE(this->test_set_.AddPoint(second_quadrature_point));
  EXPECT_EQ(this->test_set_.size(), 2);

  EXPECT_FALSE(this->test_set_.AddPoint(quadrature_point));
  EXPECT_EQ(this->test_set_.size(), 2);
}

} // namespace<commit_msg>refactored tests to move mock construction to SetUp function<commit_after>#include "quadrature/quadrature_set.h"

#include <memory>

#include "quadrature/tests/quadrature_point_mock.h"
#include "test_helpers/gmock_wrapper.h"

namespace  {

using namespace bart;

template <typename DimensionWrapper>
class QuadratureSetTest : public ::testing::Test {
 public:
  static constexpr int dim = DimensionWrapper::value;

  quadrature::QuadratureSet<dim> test_set_;
  std::shared_ptr<quadrature::QuadraturePointI<dim>> quadrature_point_,
      second_quadrature_point_;

  void SetUp() override {
    quadrature_point_ =
        std::make_shared<quadrature::QuadraturePointMock<dim>>();
    second_quadrature_point_ =
        std::make_shared<quadrature::QuadraturePointMock<dim>>();
    test_set_.AddPoint(quadrature_point_);
    test_set_.AddPoint(second_quadrature_point_);
  }
};

TYPED_TEST_CASE(QuadratureSetTest, bart::testing::AllDimensions);

TYPED_TEST(QuadratureSetTest, Constructor) {
  constexpr int dim = this->dim;
  EXPECT_NO_THROW(quadrature::QuadratureSet<dim> test_set);
}

TYPED_TEST(QuadratureSetTest, AddPoint) {
  constexpr int dim = this->dim;
  quadrature::QuadratureSet<dim> test_set;

  EXPECT_EQ(test_set.size(), 0);

  EXPECT_TRUE(test_set.AddPoint(this->quadrature_point_));
  EXPECT_EQ(test_set.size(), 1);

  EXPECT_TRUE(test_set.AddPoint(this->second_quadrature_point_));
  EXPECT_EQ(test_set.size(), 2);

  EXPECT_FALSE(test_set.AddPoint(this->quadrature_point_));
  EXPECT_EQ(test_set.size(), 2);
}



} // namespace
{'fraction_non_alphanumeric': 0.12415026833631485, 'fraction_numerical': 0.0028622540250447226, 'mean_word_length': 6.745152354570637, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 36, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1876836', 'n_tokens_mistral': 999, 'n_tokens_neox': 1000, 'n_words': 137}