@@ -15,10 +15,10 @@ TEST(router_test, nonsense)
1515
1616 router::response response = router.post (" /wibble" , request);
1717
18- ASSERT_EQ (response.status , boost::beast::http::status::bad_request);
19- ASSERT_EQ (response.body [" error" ].as_string (), " Request to invalid route /wibble." );
18+ EXPECT_EQ (response.status , boost::beast::http::status::bad_request);
19+ EXPECT_EQ (response.body [" error" ].as_string (), " Request to invalid route /wibble." );
2020
21- ASSERT_FALSE (repository.has_table (" really a real table" ));
21+ EXPECT_FALSE (repository.has_table (" really a real table" ));
2222}
2323
2424TEST (router_test, create_table)
@@ -29,8 +29,8 @@ TEST(router_test, create_table)
2929
3030 router::response response = router.post (" /table" , request);
3131
32- ASSERT_EQ (response.status , boost::beast::http::status::ok);
33- ASSERT_TRUE (repository.has_table (" really a real table" ));
32+ EXPECT_EQ (response.status , boost::beast::http::status::ok);
33+ EXPECT_TRUE (repository.has_table (" really a real table" ));
3434}
3535
3636TEST (router_test, fail_to_create_table_with_empty_name)
@@ -41,8 +41,8 @@ TEST(router_test, fail_to_create_table_with_empty_name)
4141
4242 router::response response = router.post (" /table" , request);
4343
44- ASSERT_EQ (response.status , boost::beast::http::status::bad_request);
45- ASSERT_EQ (response.body [" error" ].as_string (), " Table requires name of length greater than 0." );
44+ EXPECT_EQ (response.status , boost::beast::http::status::bad_request);
45+ EXPECT_EQ (response.body [" error" ].as_string (), " Table requires name of length greater than 0." );
4646}
4747
4848TEST (router_test, fail_to_create_duplicate_table)
@@ -55,8 +55,8 @@ TEST(router_test, fail_to_create_duplicate_table)
5555
5656 router::response response = router.post (" /table" , request);
5757
58- ASSERT_EQ (response.status , boost::beast::http::status::bad_request);
59- ASSERT_EQ (response.body [" error" ].as_string (), " A table with the name \" table name\" already exists." );
58+ EXPECT_EQ (response.status , boost::beast::http::status::bad_request);
59+ EXPECT_EQ (response.body [" error" ].as_string (), " A table with the name \" table name\" already exists." );
6060}
6161
6262TEST (router_test, read_table)
@@ -69,9 +69,9 @@ TEST(router_test, read_table)
6969
7070 router::response response = router.get (" /table?name=really a real table" );
7171
72- ASSERT_EQ (response.status , boost::beast::http::status::ok);
73- ASSERT_EQ (response.body [" name" ], " really a real table" );
74- ASSERT_EQ (response.body [" dependencies" ].as_array ().size (), 0 );
72+ EXPECT_EQ (response.status , boost::beast::http::status::ok);
73+ EXPECT_EQ (response.body [" name" ], " really a real table" );
74+ EXPECT_EQ (response.body [" dependencies" ].as_array ().size (), 0 );
7575}
7676
7777TEST (router_test, fail_to_read_unknown_table)
@@ -84,7 +84,7 @@ TEST(router_test, fail_to_read_unknown_table)
8484
8585 router::response response = router.get (" /table?name=not really a real table" );
8686
87- ASSERT_EQ (response.status , boost::beast::http::status::not_found);
87+ EXPECT_EQ (response.status , boost::beast::http::status::not_found);
8888}
8989
9090TEST (router_test, fail_to_read_unknown_parameter)
@@ -97,7 +97,7 @@ TEST(router_test, fail_to_read_unknown_parameter)
9797
9898 router::response response = router.get (" /table?lame=really a real table" );
9999
100- ASSERT_EQ (response.status , boost::beast::http::status::not_found);
100+ EXPECT_EQ (response.status , boost::beast::http::status::not_found);
101101}
102102
103103TEST (router_test, read_tables)
@@ -118,17 +118,17 @@ TEST(router_test, read_tables)
118118
119119 router::response response = router.get (" /tables" );
120120
121- ASSERT_EQ (response.status , boost::beast::http::status::ok);
121+ EXPECT_EQ (response.status , boost::beast::http::status::ok);
122122
123123 boost::json::array tables = response.body [" tables" ].as_array ();
124124
125- ASSERT_EQ (tables.size (), 2 );
126- ASSERT_EQ (tables[0 ].as_object ()[" name" ], " first table" );
125+ EXPECT_EQ (tables.size (), 2 );
126+ EXPECT_EQ (tables[0 ].as_object ()[" name" ], " first table" );
127127
128128 boost::json::object second_table = tables[1 ].as_object ();
129129
130- ASSERT_EQ (second_table[" name" ], " second table" );
131- ASSERT_EQ (second_table[" dependencies" ].as_array ()[0 ], " first table" );
130+ EXPECT_EQ (second_table[" name" ], " second table" );
131+ EXPECT_EQ (second_table[" dependencies" ].as_array ()[0 ], " first table" );
132132}
133133
134134TEST (router_test, fail_to_create_table_with_invalid_dependency)
@@ -147,11 +147,11 @@ TEST(router_test, fail_to_create_table_with_invalid_dependency)
147147
148148 router::response response = router.post (" /table" , second_request);
149149
150- ASSERT_EQ (response.status , boost::beast::http::status::bad_request);
151- ASSERT_EQ (response.body [" error" ], " Dependency \" not a table\" is not a table." );
150+ EXPECT_EQ (response.status , boost::beast::http::status::bad_request);
151+ EXPECT_EQ (response.body [" error" ], " Dependency \" not a table\" is not a table." );
152152
153153 boost::json::array tables = router.get (" /tables" ).body [" tables" ].as_array ();
154154
155- ASSERT_EQ (tables.size (), 1 );
156- ASSERT_EQ (tables[0 ].as_object ()[" name" ], " first table" );
155+ EXPECT_EQ (tables.size (), 1 );
156+ EXPECT_EQ (tables[0 ].as_object ()[" name" ], " first table" );
157157}
0 commit comments