45 Container marketPrices(RandomArrayInt, RandomArrayInt +
sizeof(RandomArrayInt) /
sizeof(
int));
46 const auto maxBeneficeIndexes = MaxDistance<IT>(marketPrices.begin(), marketPrices.end());
47 EXPECT_EQ(4, maxBeneficeIndexes.first);
48 EXPECT_EQ(9, maxBeneficeIndexes.second);
53 Container sortedArray(SortedArrayInt, SortedArrayInt +
sizeof(SortedArrayInt) /
sizeof(
int));
54 const auto indexes = MaxDistance<IT>(sortedArray.begin(), sortedArray.end());
55 EXPECT_EQ(0, indexes.first);
56 EXPECT_EQ(static_cast<int>(sortedArray.size()) - 1, indexes.second);
61 Container insufficientArray = Container(1, 2);
62 const auto indexes = MaxDistance<IT>(insufficientArray.begin(), insufficientArray.end());
63 EXPECT_EQ(-1, indexes.first);
64 EXPECT_EQ(-1, indexes.second);
69 Container twoElementArray = Container(2, 2);
70 const auto indexes = MaxDistance<IT>(twoElementArray.begin(), twoElementArray.end());
71 EXPECT_EQ(0, indexes.first);
72 EXPECT_EQ(1, indexes.second);
77 Container sameElementArray = Container(10, 2);
78 const auto indexes = MaxDistance<IT>(sameElementArray.begin(), sameElementArray.end());
79 EXPECT_EQ(0, indexes.first);
80 EXPECT_EQ(1, indexes.second);
86 MaxDistance<std::string::const_iterator, std::minus<char>>(RandomStr.begin(), RandomStr.end());
87 EXPECT_EQ(1, indexes.first);
88 EXPECT_EQ(6, indexes.second);