mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Remove obsolete comparison operator tests
This commit is contained in:
@@ -50,330 +50,6 @@ TEST(File, stringsConstructorShouldStoreGivenStrings) {
|
||||
EXPECT_EQ("constraint", file.GetConstraint());
|
||||
}
|
||||
|
||||
TEST(File, equalityShouldBeCaseInsensitiveOnName) {
|
||||
File file1("name", "display", "condition");
|
||||
File file2("name", "display", "condition");
|
||||
|
||||
EXPECT_TRUE(file1 == file2);
|
||||
|
||||
file1 = File("name", "display", "condition");
|
||||
file2 = File("Name", "display", "condition");
|
||||
|
||||
EXPECT_TRUE(file1 == file2);
|
||||
|
||||
file1 = File("name1", "display", "condition");
|
||||
file2 = File("name2", "display", "condition");
|
||||
|
||||
EXPECT_FALSE(file1 == file2);
|
||||
}
|
||||
|
||||
TEST(File, equalityShouldBeCaseSensitiveOnDisplayAndConditionAndConstraint) {
|
||||
File file1("name", "display", "condition");
|
||||
File file2("name", "display", "condition");
|
||||
|
||||
EXPECT_TRUE(file1 == file2);
|
||||
|
||||
file1 = File("name", "display", "condition");
|
||||
file2 = File("name", "Display", "condition");
|
||||
|
||||
EXPECT_FALSE(file1 == file2);
|
||||
|
||||
file1 = File("name", "display", "condition");
|
||||
file2 = File("name", "display", "Condition");
|
||||
|
||||
EXPECT_FALSE(file1 == file2);
|
||||
|
||||
file1 = File("name", "display", "condition", {}, "constraint");
|
||||
file2 = File("name", "display", "condition", {}, "Constraint");
|
||||
|
||||
EXPECT_FALSE(file1 == file2);
|
||||
|
||||
file1 = File("name", "display1", "condition");
|
||||
file2 = File("name", "display2", "condition");
|
||||
|
||||
EXPECT_FALSE(file1 == file2);
|
||||
|
||||
file1 = File("name", "display", "condition1");
|
||||
file2 = File("name", "display", "condition2");
|
||||
|
||||
EXPECT_FALSE(file1 == file2);
|
||||
|
||||
file1 = File("name", "display", "condition", {}, "constraint1");
|
||||
file2 = File("name", "display", "condition", {}, "constraint2");
|
||||
|
||||
EXPECT_FALSE(file1 == file2);
|
||||
}
|
||||
|
||||
TEST(File, equalityShouldCompareTheDetailVectors) {
|
||||
File file1("", "", "", {MessageContent("text", "en")});
|
||||
File file2("", "", "", {MessageContent("text", "en")});
|
||||
|
||||
EXPECT_TRUE(file1 == file2);
|
||||
|
||||
file1 = File("", "", "", {MessageContent("text", "en")});
|
||||
file2 = File("", "", "", {MessageContent("Text", "en")});
|
||||
|
||||
EXPECT_FALSE(file1 == file2);
|
||||
|
||||
file1 = File("", "", "", {MessageContent("text", "en")});
|
||||
file2 = File("", "", "", {MessageContent("text", "En")});
|
||||
|
||||
EXPECT_FALSE(file1 == file2);
|
||||
|
||||
file1 = File(
|
||||
"", "", "", {MessageContent("text", "en"), MessageContent("text", "en")});
|
||||
file2 = File("", "", "", {MessageContent("text", "en")});
|
||||
|
||||
EXPECT_FALSE(file1 == file2);
|
||||
}
|
||||
|
||||
TEST(File, inequalityShouldBeTheInverseOfEquality) {
|
||||
File file1("name", "display", "condition", {MessageContent("text", "en")});
|
||||
File file2("name", "display", "condition", {MessageContent("text", "en")});
|
||||
|
||||
EXPECT_FALSE(file1 != file2);
|
||||
|
||||
file1 = File("name", "display", "condition");
|
||||
file2 = File("name", "Display", "condition");
|
||||
|
||||
EXPECT_TRUE(file1 != file2);
|
||||
|
||||
file1 = File("name", "display", "condition");
|
||||
file2 = File("name", "display", "Condition");
|
||||
|
||||
EXPECT_TRUE(file1 != file2);
|
||||
|
||||
file1 = File("name", "display", "condition", {}, "constraint");
|
||||
file2 = File("name", "display", "condition", {}, "Constraint");
|
||||
|
||||
EXPECT_TRUE(file1 != file2);
|
||||
|
||||
file1 = File("name", "display1", "condition");
|
||||
file2 = File("name", "display2", "condition");
|
||||
|
||||
EXPECT_TRUE(file1 != file2);
|
||||
|
||||
file1 = File("name", "display", "condition1");
|
||||
file2 = File("name", "display", "condition2");
|
||||
|
||||
EXPECT_TRUE(file1 != file2);
|
||||
|
||||
file1 = File("", "", "", {MessageContent("text", "en")});
|
||||
file2 = File("", "", "", {MessageContent("Text", "en")});
|
||||
|
||||
EXPECT_TRUE(file1 != file2);
|
||||
|
||||
file1 = File("name", "display", "condition", {}, "constraint1");
|
||||
file2 = File("name", "display", "condition", {}, "constraint2");
|
||||
|
||||
EXPECT_TRUE(file1 != file2);
|
||||
}
|
||||
|
||||
TEST(File,
|
||||
lessThanOperatorShouldUseCaseInsensitiveLexicographicalComparisonForName) {
|
||||
File file1("name", "display", "condition");
|
||||
File file2("name", "display", "condition");
|
||||
|
||||
EXPECT_FALSE(file1 < file2);
|
||||
EXPECT_FALSE(file2 < file1);
|
||||
|
||||
file1 = File("name", "display", "condition");
|
||||
file2 = File("Name", "display", "condition");
|
||||
|
||||
EXPECT_FALSE(file1 < file2);
|
||||
EXPECT_FALSE(file2 < file1);
|
||||
|
||||
file1 = File("name1");
|
||||
file2 = File("name2");
|
||||
|
||||
EXPECT_TRUE(file1 < file2);
|
||||
EXPECT_FALSE(file2 < file1);
|
||||
}
|
||||
|
||||
TEST(
|
||||
File,
|
||||
lessThanOperatorShouldUseCaseSensitiveLexicographicalComparisonForDisplayAndConditionAndConstraint) {
|
||||
File file1("name", "display", "condition");
|
||||
File file2("name", "display", "condition");
|
||||
|
||||
EXPECT_FALSE(file1 < file2);
|
||||
EXPECT_FALSE(file2 < file1);
|
||||
|
||||
file1 = File("name", "display", "condition");
|
||||
file2 = File("name", "Display", "condition");
|
||||
|
||||
EXPECT_TRUE(file2 < file1);
|
||||
EXPECT_FALSE(file1 < file2);
|
||||
|
||||
file1 = File("name", "display", "condition");
|
||||
file2 = File("name", "display", "Condition");
|
||||
|
||||
EXPECT_TRUE(file2 < file1);
|
||||
EXPECT_FALSE(file1 < file2);
|
||||
|
||||
file1 = File("name", "display", "condition", {}, "constraint");
|
||||
file2 = File("name", "display", "condition", {}, "Constraint");
|
||||
|
||||
EXPECT_TRUE(file2 < file1);
|
||||
EXPECT_FALSE(file1 < file2);
|
||||
|
||||
file1 = File("name", "display1");
|
||||
file2 = File("name", "display2");
|
||||
|
||||
EXPECT_TRUE(file1 < file2);
|
||||
EXPECT_FALSE(file2 < file1);
|
||||
|
||||
file1 = File("name", "display", "condition1");
|
||||
file2 = File("name", "display", "condition2");
|
||||
|
||||
EXPECT_TRUE(file1 < file2);
|
||||
EXPECT_FALSE(file2 < file1);
|
||||
|
||||
file1 = File("name", "display", "condition", {}, "constraint1");
|
||||
file2 = File("name", "display", "condition", {}, "constraint2");
|
||||
|
||||
EXPECT_TRUE(file1 < file2);
|
||||
EXPECT_FALSE(file2 < file1);
|
||||
}
|
||||
|
||||
TEST(File, lessThanOperatorShouldCompareTheDetailVectors) {
|
||||
File file1("", "", "", {MessageContent("text", "en")});
|
||||
File file2("", "", "", {MessageContent("text", "en")});
|
||||
|
||||
EXPECT_FALSE(file1 < file2);
|
||||
|
||||
file1 = File("", "", "", {MessageContent("text", "en")});
|
||||
file2 = File("", "", "", {MessageContent("Text", "en")});
|
||||
|
||||
EXPECT_FALSE(file1 < file2);
|
||||
|
||||
file1 = File("", "", "", {MessageContent("text", "en")});
|
||||
file2 = File("", "", "", {MessageContent("text", "En")});
|
||||
|
||||
EXPECT_FALSE(file1 < file2);
|
||||
|
||||
file1 = File(
|
||||
"", "", "", {MessageContent("text", "en"), MessageContent("text", "en")});
|
||||
file2 = File("", "", "", {MessageContent("text", "en")});
|
||||
|
||||
EXPECT_FALSE(file1 < file2);
|
||||
}
|
||||
|
||||
TEST(File, shouldAllowComparisonUsingGreaterThanOperator) {
|
||||
File file1("name", "display", "condition", {MessageContent("text", "en")});
|
||||
File file2("name", "display", "condition", {MessageContent("text", "en")});
|
||||
|
||||
EXPECT_FALSE(file1 > file2);
|
||||
EXPECT_FALSE(file2 > file1);
|
||||
|
||||
file1 = File("name", "display", "condition");
|
||||
file2 = File("name", "Display", "condition");
|
||||
|
||||
EXPECT_FALSE(file2 > file1);
|
||||
EXPECT_TRUE(file1 > file2);
|
||||
|
||||
file1 = File("name", "display", "condition");
|
||||
file2 = File("name", "display", "Condition");
|
||||
|
||||
EXPECT_FALSE(file2 > file1);
|
||||
EXPECT_TRUE(file1 > file2);
|
||||
|
||||
file1 = File("name", "display1");
|
||||
file2 = File("name", "display2");
|
||||
|
||||
EXPECT_FALSE(file1 > file2);
|
||||
EXPECT_TRUE(file2 > file1);
|
||||
|
||||
file1 = File("name", "display", "condition1");
|
||||
file2 = File("name", "display", "condition2");
|
||||
|
||||
EXPECT_FALSE(file1 > file2);
|
||||
EXPECT_TRUE(file2 > file1);
|
||||
|
||||
file1 = File("", "", "", {MessageContent("text", "en")});
|
||||
file2 = File("", "", "", {MessageContent("Text", "en")});
|
||||
|
||||
EXPECT_TRUE(file1 > file2);
|
||||
}
|
||||
|
||||
TEST(
|
||||
File,
|
||||
lessThanOrEqualToOperatorShouldReturnTrueIfFirstFileIsNotGreaterThanSecondFile) {
|
||||
File file1("name", "display", "condition", {MessageContent("text", "en")});
|
||||
File file2("name", "display", "condition", {MessageContent("text", "en")});
|
||||
|
||||
EXPECT_TRUE(file1 <= file2);
|
||||
EXPECT_TRUE(file2 <= file1);
|
||||
|
||||
file1 = File("name", "display", "condition");
|
||||
file2 = File("name", "Display", "condition");
|
||||
|
||||
EXPECT_TRUE(file2 <= file1);
|
||||
EXPECT_FALSE(file1 <= file2);
|
||||
|
||||
file1 = File("name", "display", "condition");
|
||||
file2 = File("name", "display", "Condition");
|
||||
|
||||
EXPECT_TRUE(file2 <= file1);
|
||||
EXPECT_FALSE(file1 <= file2);
|
||||
|
||||
file1 = File("name", "display1");
|
||||
file2 = File("name", "display2");
|
||||
|
||||
EXPECT_TRUE(file1 <= file2);
|
||||
EXPECT_FALSE(file2 <= file1);
|
||||
|
||||
file1 = File("name", "display", "condition1");
|
||||
file2 = File("name", "display", "condition2");
|
||||
|
||||
EXPECT_TRUE(file1 <= file2);
|
||||
EXPECT_FALSE(file2 <= file1);
|
||||
|
||||
file1 = File("", "", "", {MessageContent("text", "en")});
|
||||
file2 = File("", "", "", {MessageContent("Text", "en")});
|
||||
|
||||
EXPECT_FALSE(file1 <= file2);
|
||||
}
|
||||
|
||||
TEST(
|
||||
File,
|
||||
greaterThanOrEqualToOperatorShouldReturnTrueIfFirstFileIsNotLessThanSecondFile) {
|
||||
File file1("name", "display", "condition", {MessageContent("text", "en")});
|
||||
File file2("name", "display", "condition", {MessageContent("text", "en")});
|
||||
|
||||
EXPECT_TRUE(file1 >= file2);
|
||||
EXPECT_TRUE(file2 >= file1);
|
||||
|
||||
file1 = File("name", "display", "condition");
|
||||
file2 = File("name", "Display", "condition");
|
||||
|
||||
EXPECT_FALSE(file2 >= file1);
|
||||
EXPECT_TRUE(file1 >= file2);
|
||||
|
||||
file1 = File("name", "display", "condition");
|
||||
file2 = File("name", "display", "Condition");
|
||||
|
||||
EXPECT_FALSE(file2 >= file1);
|
||||
EXPECT_TRUE(file1 >= file2);
|
||||
|
||||
file1 = File("name", "display1");
|
||||
file2 = File("name", "display2");
|
||||
|
||||
EXPECT_FALSE(file1 >= file2);
|
||||
EXPECT_TRUE(file2 >= file1);
|
||||
|
||||
file1 = File("name", "display", "condition1");
|
||||
file2 = File("name", "display", "condition2");
|
||||
|
||||
EXPECT_FALSE(file1 >= file2);
|
||||
EXPECT_TRUE(file2 >= file1);
|
||||
|
||||
file1 = File("", "", "", {MessageContent("text", "en")});
|
||||
file2 = File("", "", "", {MessageContent("Text", "en")});
|
||||
|
||||
EXPECT_TRUE(file1 >= file2);
|
||||
}
|
||||
|
||||
TEST(File, getDisplayNameShouldReturnDisplayString) {
|
||||
File file("name", "display");
|
||||
|
||||
|
||||
@@ -74,7 +74,6 @@ TEST(Filename, orderingShouldBeWeakAndCaseInsensitivelyLexicographical) {
|
||||
filename2 = Filename("name2");
|
||||
|
||||
EXPECT_EQ(std::weak_ordering::less, filename1 <=> filename2);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,301 +53,6 @@ TEST(Group, allArgsConstructorShouldStoreGivenValues) {
|
||||
EXPECT_EQ("test", group.GetDescription());
|
||||
EXPECT_EQ(std::vector<std::string>({"other_group"}), group.GetAfterGroups());
|
||||
}
|
||||
|
||||
TEST(Group, equalityShouldBeCaseSensitiveOnNameAndDescription) {
|
||||
Group group1("name", {}, "description");
|
||||
Group group2("name", {}, "description");
|
||||
|
||||
EXPECT_TRUE(group1 == group2);
|
||||
|
||||
group1 = Group("name");
|
||||
group2 = Group("Name");
|
||||
|
||||
EXPECT_FALSE(group1 == group2);
|
||||
|
||||
group1 = Group("name", {}, "description");
|
||||
group2 = Group("name", {}, "Description");
|
||||
|
||||
EXPECT_FALSE(group1 == group2);
|
||||
|
||||
group1 = Group("name1");
|
||||
group2 = Group("name2");
|
||||
|
||||
EXPECT_FALSE(group1 == group2);
|
||||
|
||||
group1 = Group("name", {}, "description1");
|
||||
group2 = Group("name", {}, "description2");
|
||||
|
||||
EXPECT_FALSE(group1 == group2);
|
||||
}
|
||||
|
||||
TEST(Group, equalityShouldRequireEqualAfterGroups) {
|
||||
Group group1("name", {}, "description");
|
||||
Group group2("name", {}, "description");
|
||||
|
||||
EXPECT_TRUE(group1 == group2);
|
||||
|
||||
group1 = Group("name", {}, "description");
|
||||
group2 = Group("name", {"after1"}, "Description");
|
||||
|
||||
EXPECT_FALSE(group1 == group2);
|
||||
}
|
||||
|
||||
TEST(Group, inequalityShouldBeTheInverseOfEquality) {
|
||||
Group group1("name", {}, "description");
|
||||
Group group2("name", {}, "description");
|
||||
|
||||
EXPECT_FALSE(group1 != group2);
|
||||
|
||||
group1 = Group("name");
|
||||
group2 = Group("Name");
|
||||
|
||||
EXPECT_TRUE(group1 != group2);
|
||||
|
||||
group1 = Group("name", {}, "description");
|
||||
group2 = Group("name", {}, "Description");
|
||||
|
||||
EXPECT_TRUE(group1 != group2);
|
||||
|
||||
group1 = Group("name1");
|
||||
group2 = Group("name2");
|
||||
|
||||
EXPECT_TRUE(group1 != group2);
|
||||
|
||||
group1 = Group("name", {}, "description1");
|
||||
group2 = Group("name", {}, "description2");
|
||||
|
||||
EXPECT_TRUE(group1 != group2);
|
||||
|
||||
group1 = Group("name", {}, "description");
|
||||
group2 = Group("name", {"after1"}, "Description");
|
||||
|
||||
EXPECT_TRUE(group1 != group2);
|
||||
}
|
||||
|
||||
TEST(Group,
|
||||
lessThanOperatorShouldUseCaseSensitiveLexicographicalComparisonForNames) {
|
||||
Group group1("name", {}, "description");
|
||||
Group group2("name", {}, "description");
|
||||
|
||||
EXPECT_FALSE(group1 < group2);
|
||||
EXPECT_FALSE(group2 < group1);
|
||||
|
||||
group1 = Group("Name", {}, "description");
|
||||
group2 = Group("name", {}, "description");
|
||||
|
||||
EXPECT_TRUE(group1 < group2);
|
||||
EXPECT_FALSE(group2 < group1);
|
||||
|
||||
group1 = Group("name1", {}, "description");
|
||||
group2 = Group("name2", {}, "description");
|
||||
|
||||
EXPECT_TRUE(group1 < group2);
|
||||
EXPECT_FALSE(group2 < group1);
|
||||
}
|
||||
|
||||
TEST(
|
||||
Group,
|
||||
lessThanOperatorShouldUseCaseSensitiveLexicographicalComparisonForDescriptions) {
|
||||
Group group1("name", {}, "description");
|
||||
Group group2("name", {}, "description");
|
||||
|
||||
EXPECT_FALSE(group1 < group2);
|
||||
EXPECT_FALSE(group2 < group1);
|
||||
|
||||
group1 = Group("name", {}, "Description");
|
||||
group2 = Group("name", {}, "description");
|
||||
|
||||
EXPECT_TRUE(group1 < group2);
|
||||
EXPECT_FALSE(group2 < group1);
|
||||
|
||||
group1 = Group("name", {}, "description1");
|
||||
group2 = Group("name", {}, "description2");
|
||||
|
||||
EXPECT_TRUE(group1 < group2);
|
||||
EXPECT_FALSE(group2 < group1);
|
||||
}
|
||||
|
||||
TEST(Group, lessThanOperatorShouldCompareAfterGroups) {
|
||||
Group group1("name", {}, "description");
|
||||
Group group2("name", {}, "description");
|
||||
|
||||
EXPECT_FALSE(group1 < group2);
|
||||
EXPECT_FALSE(group2 < group1);
|
||||
|
||||
group1 = Group("name", {}, "description");
|
||||
group2 = Group("name", {"group"}, "description");
|
||||
|
||||
EXPECT_TRUE(group1 < group2);
|
||||
EXPECT_FALSE(group2 < group1);
|
||||
|
||||
group1 = Group("name", {"Group"}, "description");
|
||||
group2 = Group("name", {"group"}, "description");
|
||||
|
||||
EXPECT_TRUE(group1 < group2);
|
||||
EXPECT_FALSE(group2 < group1);
|
||||
|
||||
group1 = Group("name", {"group1"}, "description");
|
||||
group2 = Group("name", {"group2"}, "description");
|
||||
|
||||
EXPECT_TRUE(group1 < group2);
|
||||
EXPECT_FALSE(group2 < group1);
|
||||
}
|
||||
|
||||
TEST(Group,
|
||||
greaterThanOperatorShouldReturnTrueIfTheSecondGroupIsLessThanTheFirst) {
|
||||
Group group1("name", {}, "description");
|
||||
Group group2("name", {}, "description");
|
||||
|
||||
EXPECT_FALSE(group1 > group2);
|
||||
EXPECT_FALSE(group2 > group1);
|
||||
|
||||
group1 = Group("Name", {}, "description");
|
||||
group2 = Group("name", {}, "description");
|
||||
|
||||
EXPECT_FALSE(group1 > group2);
|
||||
EXPECT_TRUE(group2 > group1);
|
||||
|
||||
group1 = Group("name1", {}, "description");
|
||||
group2 = Group("name2", {}, "description");
|
||||
|
||||
EXPECT_FALSE(group1 > group2);
|
||||
EXPECT_TRUE(group2 > group1);
|
||||
|
||||
group1 = Group("name", {}, "Description");
|
||||
group2 = Group("name", {}, "description");
|
||||
|
||||
EXPECT_FALSE(group1 > group2);
|
||||
EXPECT_TRUE(group2 > group1);
|
||||
|
||||
group1 = Group("name", {}, "description1");
|
||||
group2 = Group("name", {}, "description2");
|
||||
|
||||
EXPECT_FALSE(group1 > group2);
|
||||
EXPECT_TRUE(group2 > group1);
|
||||
|
||||
group1 = Group("name", {}, "description");
|
||||
group2 = Group("name", {"group"}, "description");
|
||||
|
||||
EXPECT_FALSE(group1 > group2);
|
||||
EXPECT_TRUE(group2 > group1);
|
||||
|
||||
group1 = Group("name", {"Group"}, "description");
|
||||
group2 = Group("name", {"group"}, "description");
|
||||
|
||||
EXPECT_FALSE(group1 > group2);
|
||||
EXPECT_TRUE(group2 > group1);
|
||||
|
||||
group1 = Group("name", {"group1"}, "description");
|
||||
group2 = Group("name", {"group2"}, "description");
|
||||
|
||||
EXPECT_FALSE(group1 > group2);
|
||||
EXPECT_TRUE(group2 > group1);
|
||||
}
|
||||
|
||||
TEST(
|
||||
Group,
|
||||
lessThanOrEqualToOperatorShouldReturnTrueIfTheFirstGroupIsNotGreaterThanTheSecond) {
|
||||
Group group1("name", {}, "description");
|
||||
Group group2("name", {}, "description");
|
||||
|
||||
EXPECT_TRUE(group1 <= group2);
|
||||
EXPECT_TRUE(group2 <= group1);
|
||||
|
||||
group1 = Group("Name", {}, "description");
|
||||
group2 = Group("name", {}, "description");
|
||||
|
||||
EXPECT_TRUE(group1 <= group2);
|
||||
EXPECT_FALSE(group2 <= group1);
|
||||
|
||||
group1 = Group("name1", {}, "description");
|
||||
group2 = Group("name2", {}, "description");
|
||||
|
||||
EXPECT_TRUE(group1 <= group2);
|
||||
EXPECT_FALSE(group2 <= group1);
|
||||
|
||||
group1 = Group("name", {}, "Description");
|
||||
group2 = Group("name", {}, "description");
|
||||
|
||||
EXPECT_TRUE(group1 <= group2);
|
||||
EXPECT_FALSE(group2 <= group1);
|
||||
|
||||
group1 = Group("name", {}, "description1");
|
||||
group2 = Group("name", {}, "description2");
|
||||
|
||||
EXPECT_TRUE(group1 <= group2);
|
||||
EXPECT_FALSE(group2 <= group1);
|
||||
|
||||
group1 = Group("name", {}, "description");
|
||||
group2 = Group("name", {"group"}, "description");
|
||||
|
||||
EXPECT_TRUE(group1 <= group2);
|
||||
EXPECT_FALSE(group2 <= group1);
|
||||
|
||||
group1 = Group("name", {"Group"}, "description");
|
||||
group2 = Group("name", {"group"}, "description");
|
||||
|
||||
EXPECT_TRUE(group1 <= group2);
|
||||
EXPECT_FALSE(group2 <= group1);
|
||||
|
||||
group1 = Group("name", {"group1"}, "description");
|
||||
group2 = Group("name", {"group2"}, "description");
|
||||
|
||||
EXPECT_TRUE(group1 <= group2);
|
||||
EXPECT_FALSE(group2 <= group1);
|
||||
}
|
||||
|
||||
TEST(
|
||||
Group,
|
||||
greaterThanOrEqualToOperatorShouldReturnTrueIfTheFirstGroupIsNotLessThanTheSecond) {
|
||||
Group group1("name", {}, "description");
|
||||
Group group2("name", {}, "description");
|
||||
|
||||
EXPECT_TRUE(group1 >= group2);
|
||||
EXPECT_TRUE(group2 >= group1);
|
||||
|
||||
group1 = Group("Name", {}, "description");
|
||||
group2 = Group("name", {}, "description");
|
||||
|
||||
EXPECT_FALSE(group1 >= group2);
|
||||
EXPECT_TRUE(group2 >= group1);
|
||||
|
||||
group1 = Group("name1", {}, "description");
|
||||
group2 = Group("name2", {}, "description");
|
||||
|
||||
EXPECT_FALSE(group1 >= group2);
|
||||
EXPECT_TRUE(group2 >= group1);
|
||||
|
||||
group1 = Group("name", {}, "Description");
|
||||
group2 = Group("name", {}, "description");
|
||||
|
||||
EXPECT_FALSE(group1 >= group2);
|
||||
EXPECT_TRUE(group2 >= group1);
|
||||
|
||||
group1 = Group("name", {}, "description1");
|
||||
group2 = Group("name", {}, "description2");
|
||||
|
||||
EXPECT_FALSE(group1 >= group2);
|
||||
EXPECT_TRUE(group2 >= group1);
|
||||
|
||||
group1 = Group("name", {}, "description");
|
||||
group2 = Group("name", {"group"}, "description");
|
||||
|
||||
EXPECT_FALSE(group1 >= group2);
|
||||
EXPECT_TRUE(group2 >= group1);
|
||||
|
||||
group1 = Group("name", {"Group"}, "description");
|
||||
group2 = Group("name", {"group"}, "description");
|
||||
|
||||
EXPECT_FALSE(group1 >= group2);
|
||||
EXPECT_TRUE(group2 >= group1);
|
||||
|
||||
group1 = Group("name", {"group1"}, "description");
|
||||
group2 = Group("name", {"group2"}, "description");
|
||||
|
||||
EXPECT_FALSE(group1 >= group2);
|
||||
EXPECT_TRUE(group2 >= group1);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -43,195 +43,6 @@ TEST(Location, stringsConstructorShouldStoreGivenStrings) {
|
||||
EXPECT_EQ("http://www.example.com", location.GetURL());
|
||||
EXPECT_EQ("example", location.GetName());
|
||||
}
|
||||
|
||||
TEST(Location, equalityShouldBeCaseSensitiveOnUrlAndName) {
|
||||
Location location1("http://www.example.com", "example");
|
||||
Location location2("http://www.example.com", "example");
|
||||
|
||||
EXPECT_TRUE(location1 == location2);
|
||||
|
||||
location1 = Location("http://www.example.com", "example");
|
||||
location2 = Location("HTTP://WWW.EXAMPLE.COM", "example");
|
||||
|
||||
EXPECT_FALSE(location1 == location2);
|
||||
|
||||
location1 = Location("http://www.example.com", "example");
|
||||
location2 = Location("http://www.example.com", "Example");
|
||||
|
||||
EXPECT_FALSE(location1 == location2);
|
||||
|
||||
location1 = Location("http://www.example1.com", "example");
|
||||
location2 = Location("http://www.example2.com", "example");
|
||||
|
||||
EXPECT_FALSE(location1 == location2);
|
||||
|
||||
location1 = Location("http://www.example.com", "example1");
|
||||
location2 = Location("http://www.example.com", "example2");
|
||||
|
||||
EXPECT_FALSE(location1 == location2);
|
||||
}
|
||||
|
||||
TEST(Location, inequalityShouldBeTheInverseOfEquality) {
|
||||
Location location1("http://www.example.com", "example");
|
||||
Location location2("http://www.example.com", "example");
|
||||
|
||||
EXPECT_FALSE(location1 != location2);
|
||||
|
||||
location1 = Location("http://www.example.com", "example");
|
||||
location2 = Location("HTTP://WWW.EXAMPLE.COM", "example");
|
||||
|
||||
EXPECT_TRUE(location1 != location2);
|
||||
|
||||
location1 = Location("http://www.example.com", "example");
|
||||
location2 = Location("http://www.example.com", "Example");
|
||||
|
||||
EXPECT_TRUE(location1 != location2);
|
||||
|
||||
location1 = Location("http://www.example1.com", "example");
|
||||
location2 = Location("http://www.example2.com", "example");
|
||||
|
||||
EXPECT_TRUE(location1 != location2);
|
||||
|
||||
location1 = Location("http://www.example.com", "example1");
|
||||
location2 = Location("http://www.example.com", "example2");
|
||||
|
||||
EXPECT_TRUE(location1 != location2);
|
||||
}
|
||||
|
||||
TEST(
|
||||
Location,
|
||||
lessThanOperatorShouldUseCaseSensitiveLexicographicalComparisonForNameAndUrl) {
|
||||
Location location1("http://www.example.com", "example");
|
||||
Location location2("http://www.example.com", "example");
|
||||
|
||||
EXPECT_FALSE(location1 < location2);
|
||||
EXPECT_FALSE(location2 < location1);
|
||||
|
||||
location1 = Location("http://www.example.com");
|
||||
location2 = Location("HTTP://WWW.EXAMPLE.COM");
|
||||
|
||||
EXPECT_FALSE(location1 < location2);
|
||||
EXPECT_TRUE(location2 < location1);
|
||||
|
||||
location1 = Location("http://www.example.com", "example");
|
||||
location2 = Location("http://www.example.com", "Example");
|
||||
|
||||
EXPECT_FALSE(location1 < location2);
|
||||
EXPECT_TRUE(location2 < location1);
|
||||
|
||||
location1 = Location("http://www.example1.com");
|
||||
location2 = Location("http://www.example2.com");
|
||||
|
||||
EXPECT_TRUE(location1 < location2);
|
||||
EXPECT_FALSE(location2 < location1);
|
||||
|
||||
location1 = Location("http://www.example.com", "example1");
|
||||
location2 = Location("http://www.example.com", "example2");
|
||||
|
||||
EXPECT_FALSE(location2 < location1);
|
||||
EXPECT_TRUE(location1 < location2);
|
||||
}
|
||||
|
||||
TEST(Location,
|
||||
greaterThanOperatorShouldReturnTrueIfTheSecondLocationIsLessThanTheFirst) {
|
||||
Location location1("http://www.example.com", "example");
|
||||
Location location2("http://www.example.com", "example");
|
||||
|
||||
EXPECT_FALSE(location1 > location2);
|
||||
EXPECT_FALSE(location2 > location1);
|
||||
|
||||
location1 = Location("http://www.example.com");
|
||||
location2 = Location("HTTP://WWW.EXAMPLE.COM");
|
||||
|
||||
EXPECT_TRUE(location1 > location2);
|
||||
EXPECT_FALSE(location2 > location1);
|
||||
|
||||
location1 = Location("http://www.example.com", "example");
|
||||
location2 = Location("http://www.example.com", "Example");
|
||||
|
||||
EXPECT_TRUE(location1 > location2);
|
||||
EXPECT_FALSE(location2 > location1);
|
||||
|
||||
location1 = Location("http://www.example1.com");
|
||||
location2 = Location("http://www.example2.com");
|
||||
|
||||
EXPECT_FALSE(location1 > location2);
|
||||
EXPECT_TRUE(location2 > location1);
|
||||
|
||||
location1 = Location("http://www.example.com", "example1");
|
||||
location2 = Location("http://www.example.com", "example2");
|
||||
|
||||
EXPECT_TRUE(location2 > location1);
|
||||
EXPECT_FALSE(location1 > location2);
|
||||
}
|
||||
|
||||
TEST(
|
||||
Location,
|
||||
lessThanOrEqualOperatorShouldReturnTrueIfTheFirstLocationIsNotGreaterThanTheSecond) {
|
||||
Location location1("http://www.example.com", "example");
|
||||
Location location2("http://www.example.com", "example");
|
||||
|
||||
EXPECT_TRUE(location1 <= location2);
|
||||
EXPECT_TRUE(location2 <= location1);
|
||||
|
||||
location1 = Location("http://www.example.com");
|
||||
location2 = Location("HTTP://WWW.EXAMPLE.COM");
|
||||
|
||||
EXPECT_FALSE(location1 <= location2);
|
||||
EXPECT_TRUE(location2 <= location1);
|
||||
|
||||
location1 = Location("http://www.example.com", "example");
|
||||
location2 = Location("http://www.example.com", "Example");
|
||||
|
||||
EXPECT_FALSE(location1 <= location2);
|
||||
EXPECT_TRUE(location2 <= location1);
|
||||
|
||||
location1 = Location("http://www.example1.com");
|
||||
location2 = Location("http://www.example2.com");
|
||||
|
||||
EXPECT_TRUE(location1 <= location2);
|
||||
EXPECT_FALSE(location2 <= location1);
|
||||
|
||||
location1 = Location("http://www.example.com", "example1");
|
||||
location2 = Location("http://www.example.com", "example2");
|
||||
|
||||
EXPECT_FALSE(location2 <= location1);
|
||||
EXPECT_TRUE(location1 <= location2);
|
||||
}
|
||||
|
||||
TEST(
|
||||
Location,
|
||||
greaterThanOrEqualToOperatorShouldReturnTrueIfTheFirstLocationIsNotLessThanTheSecond) {
|
||||
Location location1("http://www.example.com", "example");
|
||||
Location location2("http://www.example.com", "example");
|
||||
|
||||
EXPECT_TRUE(location1 >= location2);
|
||||
EXPECT_TRUE(location2 >= location1);
|
||||
|
||||
location1 = Location("http://www.example.com");
|
||||
location2 = Location("HTTP://WWW.EXAMPLE.COM");
|
||||
|
||||
EXPECT_TRUE(location1 >= location2);
|
||||
EXPECT_FALSE(location2 >= location1);
|
||||
|
||||
location1 = Location("http://www.example.com", "example");
|
||||
location2 = Location("http://www.example.com", "Example");
|
||||
|
||||
EXPECT_TRUE(location1 >= location2);
|
||||
EXPECT_FALSE(location2 >= location1);
|
||||
|
||||
location1 = Location("http://www.example1.com");
|
||||
location2 = Location("http://www.example2.com");
|
||||
|
||||
EXPECT_FALSE(location1 >= location2);
|
||||
EXPECT_TRUE(location2 >= location1);
|
||||
|
||||
location1 = Location("http://www.example.com", "example1");
|
||||
location2 = Location("http://www.example.com", "example2");
|
||||
|
||||
EXPECT_TRUE(location2 >= location1);
|
||||
EXPECT_FALSE(location1 >= location2);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -46,197 +46,6 @@ TEST(MessageContent, contentConstructorShouldStoreGivenStringAndLanguage) {
|
||||
EXPECT_EQ(french, content.GetLanguage());
|
||||
}
|
||||
|
||||
TEST(MessageContent,
|
||||
equalityShouldRequireCaseSensitiveEqualityOnTextAndLanguage) {
|
||||
MessageContent content1("content", "fr");
|
||||
MessageContent content2("content", "fr");
|
||||
|
||||
EXPECT_TRUE(content1 == content2);
|
||||
|
||||
content1 = MessageContent("content", "fr");
|
||||
content2 = MessageContent("Content", "fr");
|
||||
|
||||
EXPECT_FALSE(content1 == content2);
|
||||
|
||||
content1 = MessageContent("content", "fr");
|
||||
content2 = MessageContent("content", "Fr");
|
||||
|
||||
EXPECT_FALSE(content1 == content2);
|
||||
|
||||
content1 = MessageContent("content1", "fr");
|
||||
content2 = MessageContent("content2", "fr");
|
||||
|
||||
EXPECT_FALSE(content1 == content2);
|
||||
|
||||
content1 = MessageContent("content", "fr");
|
||||
content2 = MessageContent("content", "de");
|
||||
|
||||
EXPECT_FALSE(content1 == content2);
|
||||
}
|
||||
|
||||
TEST(MessageContent, inequalityShouldBeTheInverseOfEquality) {
|
||||
MessageContent content1("content", "fr");
|
||||
MessageContent content2("content", "fr");
|
||||
|
||||
EXPECT_FALSE(content1 != content2);
|
||||
|
||||
content1 = MessageContent("content", "fr");
|
||||
content2 = MessageContent("Content", "fr");
|
||||
|
||||
EXPECT_TRUE(content1 != content2);
|
||||
|
||||
content1 = MessageContent("content", "fr");
|
||||
content2 = MessageContent("content", "Fr");
|
||||
|
||||
EXPECT_TRUE(content1 != content2);
|
||||
|
||||
content1 = MessageContent("content1", "fr");
|
||||
content2 = MessageContent("content2", "fr");
|
||||
|
||||
EXPECT_TRUE(content1 != content2);
|
||||
|
||||
content1 = MessageContent("content", "fr");
|
||||
content2 = MessageContent("content", "de");
|
||||
|
||||
EXPECT_TRUE(content1 != content2);
|
||||
}
|
||||
|
||||
TEST(
|
||||
MessageContent,
|
||||
lessThanOperatorShouldUseCaseSensitiveLexicographicalComparisonForTextAndLanguage) {
|
||||
MessageContent content1("content", "fr");
|
||||
MessageContent content2("content", "fr");
|
||||
|
||||
EXPECT_FALSE(content1 < content2);
|
||||
EXPECT_FALSE(content2 < content1);
|
||||
|
||||
content1 = MessageContent("content", "fr");
|
||||
content2 = MessageContent("Content", "fr");
|
||||
|
||||
EXPECT_FALSE(content1 < content2);
|
||||
EXPECT_TRUE(content2 < content1);
|
||||
|
||||
content1 = MessageContent("content", "fr");
|
||||
content2 = MessageContent("content", "Fr");
|
||||
|
||||
EXPECT_TRUE(content2 < content1);
|
||||
EXPECT_FALSE(content1 < content2);
|
||||
|
||||
content1 = MessageContent("content1", "fr");
|
||||
content2 = MessageContent("content2", "fr");
|
||||
|
||||
EXPECT_TRUE(content1 < content2);
|
||||
EXPECT_FALSE(content2 < content1);
|
||||
|
||||
content1 = MessageContent("content", "fr");
|
||||
content2 = MessageContent("content", "de");
|
||||
|
||||
EXPECT_TRUE(content2 < content1);
|
||||
EXPECT_FALSE(content1 < content2);
|
||||
}
|
||||
|
||||
TEST(
|
||||
MessageContent,
|
||||
greaterThanOperatorShouldReturnTrueIfTheSecondMessageContentIsLessThanTheFirst) {
|
||||
MessageContent content1("content", "fr");
|
||||
MessageContent content2("content", "fr");
|
||||
|
||||
EXPECT_FALSE(content1 > content2);
|
||||
EXPECT_FALSE(content2 > content1);
|
||||
|
||||
content1 = MessageContent("content", "fr");
|
||||
content2 = MessageContent("Content", "fr");
|
||||
|
||||
EXPECT_TRUE(content1 > content2);
|
||||
EXPECT_FALSE(content2 > content1);
|
||||
|
||||
content1 = MessageContent("content", "fr");
|
||||
content2 = MessageContent("content", "Fr");
|
||||
|
||||
EXPECT_FALSE(content2 > content1);
|
||||
EXPECT_TRUE(content1 > content2);
|
||||
|
||||
content1 = MessageContent("content1", "fr");
|
||||
content2 = MessageContent("content2", "fr");
|
||||
|
||||
EXPECT_FALSE(content1 > content2);
|
||||
EXPECT_TRUE(content2 > content1);
|
||||
|
||||
content1 = MessageContent("content", "fr");
|
||||
content2 = MessageContent("content", "de");
|
||||
|
||||
EXPECT_FALSE(content2 > content1);
|
||||
EXPECT_TRUE(content1 > content2);
|
||||
}
|
||||
|
||||
TEST(
|
||||
MessageContent,
|
||||
lessThanOrEqualOperatorShouldReturnTrueIfTheFirstMessageContentIsNotGreaterThanTheSecond) {
|
||||
MessageContent content1("content", "fr");
|
||||
MessageContent content2("content", "fr");
|
||||
|
||||
EXPECT_TRUE(content1 <= content2);
|
||||
EXPECT_TRUE(content2 <= content1);
|
||||
|
||||
content1 = MessageContent("content", "fr");
|
||||
content2 = MessageContent("Content", "fr");
|
||||
|
||||
EXPECT_FALSE(content1 <= content2);
|
||||
EXPECT_TRUE(content2 <= content1);
|
||||
|
||||
content1 = MessageContent("content", "fr");
|
||||
content2 = MessageContent("content", "Fr");
|
||||
|
||||
EXPECT_TRUE(content2 <= content1);
|
||||
EXPECT_FALSE(content1 <= content2);
|
||||
|
||||
content1 = MessageContent("content1", "fr");
|
||||
content2 = MessageContent("content2", "fr");
|
||||
|
||||
EXPECT_TRUE(content1 <= content2);
|
||||
EXPECT_FALSE(content2 <= content1);
|
||||
|
||||
content1 = MessageContent("content", "fr");
|
||||
content2 = MessageContent("content", "de");
|
||||
|
||||
EXPECT_TRUE(content2 <= content1);
|
||||
EXPECT_FALSE(content1 <= content2);
|
||||
}
|
||||
|
||||
TEST(
|
||||
MessageContent,
|
||||
greaterThanOrEqualToOperatorShouldReturnTrueIfTheFirstMessageContentIsNotLessThanTheSecond) {
|
||||
MessageContent content1("content", "fr");
|
||||
MessageContent content2("content", "fr");
|
||||
|
||||
EXPECT_TRUE(content1 >= content2);
|
||||
EXPECT_TRUE(content2 >= content1);
|
||||
|
||||
content1 = MessageContent("content", "fr");
|
||||
content2 = MessageContent("Content", "fr");
|
||||
|
||||
EXPECT_TRUE(content1 >= content2);
|
||||
EXPECT_FALSE(content2 >= content1);
|
||||
|
||||
content1 = MessageContent("content", "fr");
|
||||
content2 = MessageContent("content", "Fr");
|
||||
|
||||
EXPECT_FALSE(content2 >= content1);
|
||||
EXPECT_TRUE(content1 >= content2);
|
||||
|
||||
content1 = MessageContent("content1", "fr");
|
||||
content2 = MessageContent("content2", "fr");
|
||||
|
||||
EXPECT_FALSE(content1 >= content2);
|
||||
EXPECT_TRUE(content2 >= content1);
|
||||
|
||||
content1 = MessageContent("content", "fr");
|
||||
content2 = MessageContent("content", "de");
|
||||
|
||||
EXPECT_FALSE(content2 >= content1);
|
||||
EXPECT_TRUE(content1 >= content2);
|
||||
}
|
||||
|
||||
TEST(SelectMessageContent, shouldReturnANulloptIfTheVectorIsEmpty) {
|
||||
auto content = SelectMessageContent(std::vector<MessageContent>(), "fr");
|
||||
|
||||
|
||||
@@ -74,272 +74,6 @@ TEST_F(
|
||||
EXPECT_THROW(Message(MessageType::error, contents, "condition1"),
|
||||
std::invalid_argument);
|
||||
}
|
||||
|
||||
TEST_F(MessageTest, equalityShouldRequireEqualMessageTypes) {
|
||||
Message message1(MessageType::say, "content");
|
||||
Message message2(MessageType::say, "content");
|
||||
|
||||
EXPECT_TRUE(message1 == message2);
|
||||
|
||||
message1 = Message(MessageType::say, "content");
|
||||
message2 = Message(MessageType::warn, "content");
|
||||
|
||||
EXPECT_FALSE(message1 == message2);
|
||||
}
|
||||
|
||||
TEST_F(MessageTest, equalityShouldRequireCaseSensitiveEqualityOnCondition) {
|
||||
Message message1(MessageType::say, "content", "condition");
|
||||
Message message2(MessageType::say, "content", "condition");
|
||||
|
||||
EXPECT_TRUE(message1 == message2);
|
||||
|
||||
message1 = Message(MessageType::say, "content", "condition");
|
||||
message2 = Message(MessageType::say, "content", "Condition");
|
||||
|
||||
EXPECT_FALSE(message1 == message2);
|
||||
|
||||
message1 = Message(MessageType::say, "content", "condition1");
|
||||
message2 = Message(MessageType::say, "content", "condition2");
|
||||
|
||||
EXPECT_FALSE(message1 == message2);
|
||||
}
|
||||
|
||||
TEST_F(MessageTest, equalityShouldRequireEqualContent) {
|
||||
Message message1(MessageType::say, "content");
|
||||
Message message2(MessageType::say, "content");
|
||||
|
||||
EXPECT_TRUE(message1 == message2);
|
||||
|
||||
message1 = Message(MessageType::say, "content1");
|
||||
message2 = Message(MessageType::say, "content2");
|
||||
|
||||
EXPECT_FALSE(message1 == message2);
|
||||
}
|
||||
|
||||
TEST_F(MessageTest, inequalityShouldBeTheInverseOfEquality) {
|
||||
Message message1(MessageType::say, "content");
|
||||
Message message2(MessageType::say, "content");
|
||||
|
||||
EXPECT_FALSE(message1 != message2);
|
||||
|
||||
message1 = Message(MessageType::say, "content");
|
||||
message2 = Message(MessageType::warn, "content");
|
||||
|
||||
EXPECT_TRUE(message1 != message2);
|
||||
|
||||
message1 = Message(MessageType::say, "content", "condition");
|
||||
message2 = Message(MessageType::say, "content", "condition");
|
||||
|
||||
EXPECT_FALSE(message1 != message2);
|
||||
|
||||
message1 = Message(MessageType::say, "content", "condition");
|
||||
message2 = Message(MessageType::say, "content", "Condition");
|
||||
|
||||
EXPECT_TRUE(message1 != message2);
|
||||
|
||||
message1 = Message(MessageType::say, "content", "condition1");
|
||||
message2 = Message(MessageType::say, "content", "condition2");
|
||||
|
||||
EXPECT_TRUE(message1 != message2);
|
||||
|
||||
message1 = Message(MessageType::say, "content");
|
||||
message2 = Message(MessageType::say, "content");
|
||||
|
||||
EXPECT_FALSE(message1 != message2);
|
||||
|
||||
message1 = Message(MessageType::say, "content1");
|
||||
message2 = Message(MessageType::say, "content2");
|
||||
|
||||
EXPECT_TRUE(message1 != message2);
|
||||
}
|
||||
|
||||
TEST_F(MessageTest, lessThanOperatorShouldCompareMessageTypes) {
|
||||
Message message1(MessageType::say, "content");
|
||||
Message message2(MessageType::say, "content");
|
||||
|
||||
EXPECT_FALSE(message1 < message2);
|
||||
EXPECT_FALSE(message2 < message1);
|
||||
|
||||
message1 = Message(MessageType::say, "content");
|
||||
message2 = Message(MessageType::warn, "content");
|
||||
|
||||
EXPECT_TRUE(message1 < message2);
|
||||
EXPECT_FALSE(message2 < message1);
|
||||
}
|
||||
|
||||
TEST_F(MessageTest, lessThanOperatorShouldCompareContent) {
|
||||
Message message1(MessageType::say, "content");
|
||||
Message message2(MessageType::say, "content");
|
||||
|
||||
EXPECT_FALSE(message1 < message2);
|
||||
EXPECT_FALSE(message2 < message1);
|
||||
|
||||
message1 = Message(MessageType::say, "content1");
|
||||
message2 = Message(MessageType::say, "content2");
|
||||
|
||||
EXPECT_TRUE(message1 < message2);
|
||||
EXPECT_FALSE(message2 < message1);
|
||||
}
|
||||
|
||||
TEST_F(
|
||||
MessageTest,
|
||||
lessThanOperatorShouldUseCaseSensitiveLexicographicalComparisonForConditions) {
|
||||
Message message1(MessageType::say, "content", "condition");
|
||||
Message message2(MessageType::say, "content", "condition");
|
||||
|
||||
EXPECT_FALSE(message1 < message2);
|
||||
EXPECT_FALSE(message2 < message1);
|
||||
|
||||
message1 = Message(MessageType::say, "content", "condition");
|
||||
message2 = Message(MessageType::say, "content", "Condition");
|
||||
|
||||
EXPECT_TRUE(message2 < message1);
|
||||
EXPECT_FALSE(message1 < message2);
|
||||
|
||||
message1 = Message(MessageType::say, "content", "condition1");
|
||||
message2 = Message(MessageType::say, "content", "condition2");
|
||||
|
||||
EXPECT_TRUE(message1 < message2);
|
||||
EXPECT_FALSE(message2 < message1);
|
||||
}
|
||||
|
||||
TEST_F(
|
||||
MessageTest,
|
||||
greaterThanOperatorShouldReturnTrueIfTheSecondMessageIsLessThanTheFirst) {
|
||||
Message message1(MessageType::say, "content");
|
||||
Message message2(MessageType::say, "content");
|
||||
|
||||
EXPECT_FALSE(message1 > message2);
|
||||
EXPECT_FALSE(message2 > message1);
|
||||
|
||||
message1 = Message(MessageType::say, "content");
|
||||
message2 = Message(MessageType::warn, "content");
|
||||
|
||||
EXPECT_FALSE(message1 > message2);
|
||||
EXPECT_TRUE(message2 > message1);
|
||||
|
||||
message1 = Message(MessageType::say, "content");
|
||||
message2 = Message(MessageType::say, "content");
|
||||
|
||||
EXPECT_FALSE(message1 > message2);
|
||||
EXPECT_FALSE(message2 > message1);
|
||||
|
||||
message1 = Message(MessageType::say, "content1");
|
||||
message2 = Message(MessageType::say, "content2");
|
||||
|
||||
EXPECT_FALSE(message1 > message2);
|
||||
EXPECT_TRUE(message2 > message1);
|
||||
|
||||
message1 = Message(MessageType::say, "content", "condition");
|
||||
message2 = Message(MessageType::say, "content", "condition");
|
||||
|
||||
EXPECT_FALSE(message1 > message2);
|
||||
EXPECT_FALSE(message2 > message1);
|
||||
|
||||
message1 = Message(MessageType::say, "content", "condition");
|
||||
message2 = Message(MessageType::say, "content", "Condition");
|
||||
|
||||
EXPECT_FALSE(message2 > message1);
|
||||
EXPECT_TRUE(message1 > message2);
|
||||
|
||||
message1 = Message(MessageType::say, "content", "condition1");
|
||||
message2 = Message(MessageType::say, "content", "condition2");
|
||||
|
||||
EXPECT_FALSE(message1 > message2);
|
||||
EXPECT_TRUE(message2 > message1);
|
||||
}
|
||||
|
||||
TEST_F(
|
||||
MessageTest,
|
||||
lessThanOrEqualOperatorShouldReturnTrueIfTheFirstMessageIsNotGreaterThanTheSecond) {
|
||||
Message message1(MessageType::say, "content");
|
||||
Message message2(MessageType::say, "content");
|
||||
|
||||
EXPECT_TRUE(message1 <= message2);
|
||||
EXPECT_TRUE(message2 <= message1);
|
||||
|
||||
message1 = Message(MessageType::say, "content");
|
||||
message2 = Message(MessageType::warn, "content");
|
||||
|
||||
EXPECT_TRUE(message1 <= message2);
|
||||
EXPECT_FALSE(message2 <= message1);
|
||||
|
||||
message1 = Message(MessageType::say, "content");
|
||||
message2 = Message(MessageType::say, "content");
|
||||
|
||||
EXPECT_TRUE(message1 <= message2);
|
||||
EXPECT_TRUE(message2 <= message1);
|
||||
|
||||
message1 = Message(MessageType::say, "content1");
|
||||
message2 = Message(MessageType::say, "content2");
|
||||
|
||||
EXPECT_TRUE(message1 <= message2);
|
||||
EXPECT_FALSE(message2 <= message1);
|
||||
|
||||
message1 = Message(MessageType::say, "content", "condition");
|
||||
message2 = Message(MessageType::say, "content", "condition");
|
||||
|
||||
EXPECT_TRUE(message1 <= message2);
|
||||
EXPECT_TRUE(message2 <= message1);
|
||||
|
||||
message1 = Message(MessageType::say, "content", "condition");
|
||||
message2 = Message(MessageType::say, "content", "Condition");
|
||||
|
||||
EXPECT_TRUE(message2 <= message1);
|
||||
EXPECT_FALSE(message1 <= message2);
|
||||
|
||||
message1 = Message(MessageType::say, "content", "condition1");
|
||||
message2 = Message(MessageType::say, "content", "condition2");
|
||||
|
||||
EXPECT_TRUE(message1 <= message2);
|
||||
EXPECT_FALSE(message2 <= message1);
|
||||
}
|
||||
|
||||
TEST_F(
|
||||
MessageTest,
|
||||
greaterThanOrEqualToOperatorShouldReturnTrueIfTheFirstMessageIsNotLessThanTheSecond) {
|
||||
Message message1(MessageType::say, "content");
|
||||
Message message2(MessageType::say, "content");
|
||||
|
||||
EXPECT_TRUE(message1 >= message2);
|
||||
EXPECT_TRUE(message2 >= message1);
|
||||
|
||||
message1 = Message(MessageType::say, "content");
|
||||
message2 = Message(MessageType::warn, "content");
|
||||
|
||||
EXPECT_FALSE(message1 >= message2);
|
||||
EXPECT_TRUE(message2 >= message1);
|
||||
|
||||
message1 = Message(MessageType::say, "content");
|
||||
message2 = Message(MessageType::say, "content");
|
||||
|
||||
EXPECT_TRUE(message1 >= message2);
|
||||
EXPECT_TRUE(message2 >= message1);
|
||||
|
||||
message1 = Message(MessageType::say, "content1");
|
||||
message2 = Message(MessageType::say, "content2");
|
||||
|
||||
EXPECT_FALSE(message1 >= message2);
|
||||
EXPECT_TRUE(message2 >= message1);
|
||||
|
||||
message1 = Message(MessageType::say, "content", "condition");
|
||||
message2 = Message(MessageType::say, "content", "condition");
|
||||
|
||||
EXPECT_TRUE(message1 >= message2);
|
||||
EXPECT_TRUE(message2 >= message1);
|
||||
|
||||
message1 = Message(MessageType::say, "content", "condition");
|
||||
message2 = Message(MessageType::say, "content", "Condition");
|
||||
|
||||
EXPECT_FALSE(message2 >= message1);
|
||||
EXPECT_TRUE(message1 >= message2);
|
||||
|
||||
message1 = Message(MessageType::say, "content", "condition1");
|
||||
message2 = Message(MessageType::say, "content", "condition2");
|
||||
|
||||
EXPECT_FALSE(message1 >= message2);
|
||||
EXPECT_TRUE(message2 >= message1);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -60,254 +60,6 @@ TEST_F(PluginCleaningDataTest, contentConstructorShouldStoreAllGivenData) {
|
||||
EXPECT_EQ("cleaner", info.GetCleaningUtility());
|
||||
EXPECT_EQ(info_, info.GetDetail());
|
||||
}
|
||||
|
||||
TEST_F(PluginCleaningDataTest, equalityShouldCheckEqualityOfAllFields) {
|
||||
PluginCleaningData info1(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
PluginCleaningData info2(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
EXPECT_TRUE(info1 == info2);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x87654321, "cleaner", info_, 2, 10, 30);
|
||||
EXPECT_FALSE(info1 == info2);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "Cleaner", info_, 2, 10, 30);
|
||||
EXPECT_FALSE(info1 == info2);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner1", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "cleaner2", info_, 2, 10, 30);
|
||||
EXPECT_FALSE(info1 == info2);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(
|
||||
0x12345678, "cleaner", std::vector<MessageContent>(), 2, 10, 30);
|
||||
EXPECT_FALSE(info1 == info2);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "cleaner", info_, 4, 10, 30);
|
||||
EXPECT_FALSE(info1 == info2);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 20, 30);
|
||||
EXPECT_FALSE(info1 == info2);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 60);
|
||||
EXPECT_FALSE(info1 == info2);
|
||||
}
|
||||
|
||||
TEST_F(PluginCleaningDataTest, inequalityShouldBeTheInverseOfEquality) {
|
||||
PluginCleaningData info1(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
PluginCleaningData info2(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
EXPECT_FALSE(info1 != info2);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x87654321, "cleaner", info_, 2, 10, 30);
|
||||
EXPECT_TRUE(info1 != info2);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "Cleaner", info_, 2, 10, 30);
|
||||
EXPECT_TRUE(info1 != info2);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner1", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "cleaner2", info_, 2, 10, 30);
|
||||
EXPECT_TRUE(info1 != info2);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(
|
||||
0x12345678, "cleaner", std::vector<MessageContent>(), 2, 10, 30);
|
||||
EXPECT_TRUE(info1 != info2);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "cleaner", info_, 4, 10, 30);
|
||||
EXPECT_TRUE(info1 != info2);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 20, 30);
|
||||
EXPECT_TRUE(info1 != info2);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 60);
|
||||
EXPECT_TRUE(info1 != info2);
|
||||
}
|
||||
|
||||
TEST_F(PluginCleaningDataTest, lessThanOperatorShouldCompareAllFields) {
|
||||
PluginCleaningData info1(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
PluginCleaningData info2(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
EXPECT_FALSE(info1 < info2);
|
||||
EXPECT_FALSE(info2 < info1);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x87654321, "cleaner", info_, 2, 10, 30);
|
||||
EXPECT_TRUE(info1 < info2);
|
||||
EXPECT_FALSE(info2 < info1);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "Cleaner", info_, 2, 10, 30);
|
||||
EXPECT_TRUE(info2 < info1);
|
||||
EXPECT_FALSE(info1 < info2);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner1", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "cleaner2", info_, 2, 10, 30);
|
||||
EXPECT_TRUE(info1 < info2);
|
||||
EXPECT_FALSE(info2 < info1);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(
|
||||
0x12345678, "cleaner", std::vector<MessageContent>(), 2, 10, 30);
|
||||
EXPECT_TRUE(info2 < info1);
|
||||
EXPECT_FALSE(info1 < info2);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "cleaner", info_, 4, 10, 30);
|
||||
EXPECT_TRUE(info1 < info2);
|
||||
EXPECT_FALSE(info2 < info1);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 20, 30);
|
||||
EXPECT_TRUE(info1 < info2);
|
||||
EXPECT_FALSE(info2 < info1);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 60);
|
||||
EXPECT_TRUE(info1 < info2);
|
||||
EXPECT_FALSE(info2 < info1);
|
||||
}
|
||||
|
||||
TEST_F(
|
||||
PluginCleaningDataTest,
|
||||
greaterThanOperatorShouldReturnTrueIfTheSecondPluginCleaningDataIsLessThanTheFirst) {
|
||||
PluginCleaningData info1(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
PluginCleaningData info2(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
EXPECT_FALSE(info1 > info2);
|
||||
EXPECT_FALSE(info2 > info1);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x87654321, "cleaner", info_, 2, 10, 30);
|
||||
EXPECT_FALSE(info1 > info2);
|
||||
EXPECT_TRUE(info2 > info1);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "Cleaner", info_, 2, 10, 30);
|
||||
EXPECT_FALSE(info2 > info1);
|
||||
EXPECT_TRUE(info1 > info2);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner1", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "cleaner2", info_, 2, 10, 30);
|
||||
EXPECT_FALSE(info1 > info2);
|
||||
EXPECT_TRUE(info2 > info1);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(
|
||||
0x12345678, "cleaner", std::vector<MessageContent>(), 2, 10, 30);
|
||||
EXPECT_FALSE(info2 > info1);
|
||||
EXPECT_TRUE(info1 > info2);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "cleaner", info_, 4, 10, 30);
|
||||
EXPECT_FALSE(info1 > info2);
|
||||
EXPECT_TRUE(info2 > info1);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 20, 30);
|
||||
EXPECT_FALSE(info1 > info2);
|
||||
EXPECT_TRUE(info2 > info1);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 60);
|
||||
EXPECT_FALSE(info1 > info2);
|
||||
EXPECT_TRUE(info2 > info1);
|
||||
}
|
||||
|
||||
TEST_F(
|
||||
PluginCleaningDataTest,
|
||||
lessThanOrEqualOperatorShouldReturnTrueIfTheFirstPluginCleaningDataIsNotGreaterThanTheSecond) {
|
||||
PluginCleaningData info1(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
PluginCleaningData info2(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
EXPECT_TRUE(info1 <= info2);
|
||||
EXPECT_TRUE(info2 <= info1);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x87654321, "cleaner", info_, 2, 10, 30);
|
||||
EXPECT_TRUE(info1 < info2);
|
||||
EXPECT_FALSE(info2 < info1);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "Cleaner", info_, 2, 10, 30);
|
||||
EXPECT_TRUE(info2 < info1);
|
||||
EXPECT_FALSE(info1 < info2);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner1", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "cleaner2", info_, 2, 10, 30);
|
||||
EXPECT_TRUE(info1 < info2);
|
||||
EXPECT_FALSE(info2 < info1);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(
|
||||
0x12345678, "cleaner", std::vector<MessageContent>(), 2, 10, 30);
|
||||
EXPECT_TRUE(info2 < info1);
|
||||
EXPECT_FALSE(info1 < info2);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "cleaner", info_, 4, 10, 30);
|
||||
EXPECT_TRUE(info1 < info2);
|
||||
EXPECT_FALSE(info2 < info1);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 20, 30);
|
||||
EXPECT_TRUE(info1 < info2);
|
||||
EXPECT_FALSE(info2 < info1);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 60);
|
||||
EXPECT_TRUE(info1 < info2);
|
||||
EXPECT_FALSE(info2 < info1);
|
||||
}
|
||||
|
||||
TEST_F(
|
||||
PluginCleaningDataTest,
|
||||
greaterThanOrEqualToOperatorShouldReturnTrueIfTheFirstPluginCleaningDataIsNotLessThanTheSecond) {
|
||||
PluginCleaningData info1(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
PluginCleaningData info2(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
EXPECT_TRUE(info1 >= info2);
|
||||
EXPECT_TRUE(info2 >= info1);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x87654321, "cleaner", info_, 2, 10, 30);
|
||||
EXPECT_FALSE(info1 > info2);
|
||||
EXPECT_TRUE(info2 > info1);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "Cleaner", info_, 2, 10, 30);
|
||||
EXPECT_FALSE(info2 > info1);
|
||||
EXPECT_TRUE(info1 > info2);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner1", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "cleaner2", info_, 2, 10, 30);
|
||||
EXPECT_FALSE(info1 > info2);
|
||||
EXPECT_TRUE(info2 > info1);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(
|
||||
0x12345678, "cleaner", std::vector<MessageContent>(), 2, 10, 30);
|
||||
EXPECT_FALSE(info2 > info1);
|
||||
EXPECT_TRUE(info1 > info2);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "cleaner", info_, 4, 10, 30);
|
||||
EXPECT_FALSE(info1 > info2);
|
||||
EXPECT_TRUE(info2 > info1);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 20, 30);
|
||||
EXPECT_FALSE(info1 > info2);
|
||||
EXPECT_TRUE(info2 > info1);
|
||||
|
||||
info1 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 30);
|
||||
info2 = PluginCleaningData(0x12345678, "cleaner", info_, 2, 10, 60);
|
||||
EXPECT_FALSE(info1 > info2);
|
||||
EXPECT_TRUE(info2 > info1);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -80,242 +80,6 @@ TEST(Tag, orderingShouldMakeAdditionsLessThanRemovals) {
|
||||
|
||||
EXPECT_EQ(std::weak_ordering::less, tag1 <=> tag2);
|
||||
}
|
||||
|
||||
TEST(Tag, equalityShouldBeCaseSensitiveOnNameAndCondition) {
|
||||
Tag tag1("name", true, "condition");
|
||||
Tag tag2("name", true, "condition");
|
||||
|
||||
EXPECT_TRUE(tag1 == tag2);
|
||||
|
||||
tag1 = Tag("name");
|
||||
tag2 = Tag("Name");
|
||||
|
||||
EXPECT_FALSE(tag1 == tag2);
|
||||
|
||||
tag1 = Tag("name", true, "condition");
|
||||
tag2 = Tag("name", true, "Condition");
|
||||
|
||||
EXPECT_FALSE(tag1 == tag2);
|
||||
|
||||
tag1 = Tag("name1");
|
||||
tag2 = Tag("name2");
|
||||
|
||||
EXPECT_FALSE(tag1 == tag2);
|
||||
|
||||
tag1 = Tag("name", true, "condition1");
|
||||
tag2 = Tag("name", true, "condition2");
|
||||
|
||||
EXPECT_FALSE(tag1 == tag2);
|
||||
}
|
||||
|
||||
TEST(Tag, equalityShouldRequireEqualAdditionStates) {
|
||||
Tag tag1("name", true, "condition");
|
||||
Tag tag2("name", true, "condition");
|
||||
|
||||
EXPECT_TRUE(tag1 == tag2);
|
||||
|
||||
tag1 = Tag("name", true);
|
||||
tag2 = Tag("name", false);
|
||||
|
||||
EXPECT_FALSE(tag1 == tag2);
|
||||
}
|
||||
|
||||
TEST(Tag, inequalityShouldBeTheInverseOfEquality) {
|
||||
Tag tag1("name", true, "condition");
|
||||
Tag tag2("name", true, "condition");
|
||||
|
||||
EXPECT_FALSE(tag1 != tag2);
|
||||
|
||||
tag1 = Tag("name");
|
||||
tag2 = Tag("Name");
|
||||
|
||||
EXPECT_TRUE(tag1 != tag2);
|
||||
|
||||
tag1 = Tag("name", true, "condition");
|
||||
tag2 = Tag("name", true, "Condition");
|
||||
|
||||
EXPECT_TRUE(tag1 != tag2);
|
||||
|
||||
tag1 = Tag("name1");
|
||||
tag2 = Tag("name2");
|
||||
|
||||
EXPECT_TRUE(tag1 != tag2);
|
||||
|
||||
tag1 = Tag("name", true, "condition1");
|
||||
tag2 = Tag("name", true, "condition2");
|
||||
|
||||
EXPECT_TRUE(tag1 != tag2);
|
||||
|
||||
tag1 = Tag("name", true, "condition");
|
||||
tag2 = Tag("name", true, "condition");
|
||||
|
||||
EXPECT_FALSE(tag1 != tag2);
|
||||
|
||||
tag1 = Tag("name", true);
|
||||
tag2 = Tag("name", false);
|
||||
|
||||
EXPECT_TRUE(tag1 != tag2);
|
||||
}
|
||||
|
||||
TEST(
|
||||
Tag,
|
||||
lessThanOperatorShouldUseCaseSensitiveLexicographicalComparisonForNameAndCondition) {
|
||||
Tag tag1("name", true, "condition");
|
||||
Tag tag2("name", true, "condition");
|
||||
|
||||
EXPECT_FALSE(tag1 < tag2);
|
||||
EXPECT_FALSE(tag2 < tag1);
|
||||
|
||||
tag1 = Tag("name");
|
||||
tag2 = Tag("Name");
|
||||
|
||||
EXPECT_FALSE(tag1 < tag2);
|
||||
EXPECT_TRUE(tag2 < tag1);
|
||||
|
||||
tag1 = Tag("name", true, "condition");
|
||||
tag2 = Tag("name", true, "Condition");
|
||||
|
||||
EXPECT_FALSE(tag1 < tag2);
|
||||
EXPECT_TRUE(tag2 < tag1);
|
||||
|
||||
tag1 = Tag("name1");
|
||||
tag2 = Tag("name2");
|
||||
|
||||
EXPECT_TRUE(tag1 < tag2);
|
||||
EXPECT_FALSE(tag2 < tag1);
|
||||
|
||||
tag1 = Tag("name", true, "condition1");
|
||||
tag2 = Tag("name", true, "condition2");
|
||||
|
||||
EXPECT_TRUE(tag1 < tag2);
|
||||
EXPECT_FALSE(tag2 < tag1);
|
||||
}
|
||||
|
||||
TEST(Tag, lessThanOperatorShouldTreatTagAdditionsAsBeingLessThanRemovals) {
|
||||
Tag tag1("name", true);
|
||||
Tag tag2("name", false);
|
||||
|
||||
EXPECT_TRUE(tag1 < tag2);
|
||||
EXPECT_FALSE(tag2 < tag1);
|
||||
}
|
||||
|
||||
TEST(Tag, greaterThanOperatorShouldReturnTrueIfTheSecondTagIsLessThanTheFirst) {
|
||||
Tag tag1("name", true, "condition");
|
||||
Tag tag2("name", true, "condition");
|
||||
|
||||
EXPECT_FALSE(tag1 > tag2);
|
||||
EXPECT_FALSE(tag2 > tag1);
|
||||
|
||||
tag1 = Tag("name");
|
||||
tag2 = Tag("Name");
|
||||
|
||||
EXPECT_TRUE(tag1 > tag2);
|
||||
EXPECT_FALSE(tag2 > tag1);
|
||||
|
||||
tag1 = Tag("name", true, "condition");
|
||||
tag2 = Tag("name", true, "Condition");
|
||||
|
||||
EXPECT_TRUE(tag1 > tag2);
|
||||
EXPECT_FALSE(tag2 > tag1);
|
||||
|
||||
tag1 = Tag("name1");
|
||||
tag2 = Tag("name2");
|
||||
|
||||
EXPECT_FALSE(tag1 > tag2);
|
||||
EXPECT_TRUE(tag2 > tag1);
|
||||
|
||||
tag1 = Tag("name", true, "condition1");
|
||||
tag2 = Tag("name", true, "condition2");
|
||||
|
||||
EXPECT_FALSE(tag1 > tag2);
|
||||
EXPECT_TRUE(tag2 > tag1);
|
||||
|
||||
tag1 = Tag("name", true);
|
||||
tag2 = Tag("name", false);
|
||||
|
||||
EXPECT_FALSE(tag1 > tag2);
|
||||
EXPECT_TRUE(tag2 > tag1);
|
||||
}
|
||||
|
||||
TEST(
|
||||
Tag,
|
||||
lessThanOrEqualOperatorShouldReturnTrueIfTheFirstTagIsNotGreaterThanTheSecond) {
|
||||
Tag tag1("name", true, "condition");
|
||||
Tag tag2("name", true, "condition");
|
||||
|
||||
EXPECT_TRUE(tag1 <= tag2);
|
||||
EXPECT_TRUE(tag2 <= tag1);
|
||||
|
||||
tag1 = Tag("name");
|
||||
tag2 = Tag("Name");
|
||||
|
||||
EXPECT_FALSE(tag1 <= tag2);
|
||||
EXPECT_TRUE(tag2 <= tag1);
|
||||
|
||||
tag1 = Tag("name", true, "condition");
|
||||
tag2 = Tag("name", true, "Condition");
|
||||
|
||||
EXPECT_FALSE(tag1 <= tag2);
|
||||
EXPECT_TRUE(tag2 <= tag1);
|
||||
|
||||
tag1 = Tag("name1");
|
||||
tag2 = Tag("name2");
|
||||
|
||||
EXPECT_TRUE(tag1 <= tag2);
|
||||
EXPECT_FALSE(tag2 <= tag1);
|
||||
|
||||
tag1 = Tag("name", true, "condition1");
|
||||
tag2 = Tag("name", true, "condition2");
|
||||
|
||||
EXPECT_TRUE(tag1 <= tag2);
|
||||
EXPECT_FALSE(tag2 <= tag1);
|
||||
|
||||
tag1 = Tag("name", true);
|
||||
tag2 = Tag("name", false);
|
||||
|
||||
EXPECT_TRUE(tag1 <= tag2);
|
||||
EXPECT_FALSE(tag2 <= tag1);
|
||||
}
|
||||
|
||||
TEST(
|
||||
Tag,
|
||||
greaterThanOrEqualToOperatorShouldReturnTrueIfTheFirstTagIsNotLessThanTheSecond) {
|
||||
Tag tag1("name", true, "condition");
|
||||
Tag tag2("name", true, "condition");
|
||||
|
||||
EXPECT_TRUE(tag1 >= tag2);
|
||||
EXPECT_TRUE(tag2 >= tag1);
|
||||
|
||||
tag1 = Tag("name");
|
||||
tag2 = Tag("Name");
|
||||
|
||||
EXPECT_TRUE(tag1 >= tag2);
|
||||
EXPECT_FALSE(tag2 >= tag1);
|
||||
|
||||
tag1 = Tag("name", true, "condition");
|
||||
tag2 = Tag("name", true, "Condition");
|
||||
|
||||
EXPECT_TRUE(tag1 >= tag2);
|
||||
EXPECT_FALSE(tag2 >= tag1);
|
||||
|
||||
tag1 = Tag("name1");
|
||||
tag2 = Tag("name2");
|
||||
|
||||
EXPECT_FALSE(tag1 >= tag2);
|
||||
EXPECT_TRUE(tag2 >= tag1);
|
||||
|
||||
tag1 = Tag("name", true, "condition1");
|
||||
tag2 = Tag("name", true, "condition2");
|
||||
|
||||
EXPECT_FALSE(tag1 >= tag2);
|
||||
EXPECT_TRUE(tag2 >= tag1);
|
||||
|
||||
tag1 = Tag("name", true);
|
||||
tag2 = Tag("name", false);
|
||||
|
||||
EXPECT_FALSE(tag1 >= tag2);
|
||||
EXPECT_TRUE(tag2 >= tag1);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user