-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsolution_tests.cpp
More file actions
54 lines (42 loc) · 1.28 KB
/
solution_tests.cpp
File metadata and controls
54 lines (42 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "catch.hpp"
#include "solution.hpp"
#include <string>
using namespace csce;
/*
SCENARIO("Perfect matching validation") {
GIVEN("A graph") {
edge_set g;
std::string f = "./problems/graph.txt";
GIVEN("and a set of edges that are a perfect matching in said graph") {
edge_set edgeset;
edgeset.add(edge(vertex(0), vertex(6)));
edgeset.add(edge(vertex(1), vertex(7)));
edgeset.add(edge(vertex(2), vertex(5)));
edgeset.add(edge(vertex(3), vertex(8)));
edgeset.add(edge(vertex(4), vertex(9)));
edgeset.add(edge(vertex(0), vertex(6)));
edgeset.add(edge(vertex(1), vertex(7)));
solution graphProblem(g, f);
WHEN("checked") {
bool isSolution = graphProblem.isSolution(edgeset);
THEN("it is at least one of the perfect matches for the graph") {
REQUIRE(isSolution == true);
}
}
}
GIVEN("and a set of edges that are not a perfect matching in said graph") {
edge_set edgeset;
edgeset.add(edge(vertex(1), vertex(2)));
edgeset.add(edge(vertex(3), vertex(4)));
edgeset.add(edge(vertex(2), vertex(3)));
solution graphProblem(g, f);
WHEN("checked") {
bool isSolution = graphProblem.isSolution(edgeset);
THEN("it is not a perfect matching for the graph") {
REQUIRE(isSolution == false);
}
}
}
}
}
*/