EvgeniyGlazirin / oop

0 stars 0 forks source link

Замечания по ProcessVector #4

Closed alexey-malov closed 6 years ago

alexey-malov commented 6 years ago
alexey-malov commented 6 years ago
TEST_CASE("found minimul number in vector was right")
{
    std::vector<double> testVector = { 2, -2, 11.1 };
    const double minElementOfVector = *std::min_element(testVector.begin(), testVector.end());
    CHECK(-2 == minElementOfVector);
}
alexey-malov commented 6 years ago
TEST_CASE("process for empty vector is change nothing")
{
    std::vector<double> testVector = { };
    CHECK(VectorsAreEqual(testVector, { }));
}
alexey-malov commented 6 years ago
alexey-malov commented 6 years ago
    std::transform(vec.begin(), vec.end(), vec.begin(), [=](double number) { return number = number * minElementOfVector; });
alexey-malov commented 6 years ago
alexey-malov commented 6 years ago