#define DOCTEST_CONFIG_NO_MULTITHREADING
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include "doctest.h"
#include <vector>
#include "histogram_internal.h"
using namespace std;

TEST_CASE("distinct positive numbers") {
    double min = 0;
    double max = 0;
    FindMinMax({ 1, 2 }, min, max);
    CHECK(min == 1);
    CHECK(max == 2);
}


TEST_CASE("empty vector") {
    double min = 0;
    double max = 0;
    FindMinMax({ }, min, max);
    CHECK(min != 0);
    CHECK(max != 0);
}

TEST_CASE("one element") {
    double min = 0;
    double max = 0;
    FindMinMax({ 1 }, min, max);
    CHECK(min == 1);
    CHECK(max == 1);
}

TEST_CASE("negative elements") {
    double min = 0;
    double max = 0;
    FindMinMax({ -81, 2 }, min, max);
    CHECK(min == -81);
    CHECK(max == 2);
}

TEST_CASE("simular elements") {
    double min = 0;
    double max = 0;
    FindMinMax({ 23, 23, 23 }, min, max);
    CHECK(min == 23);
    CHECK(max == 23);
}