mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-10-15 02:25:40 +00:00
add more explicit approval test to cpp catch2 version
This commit is contained in:
1 parent
f42247354b
commit
661b131832
2 files changed
+13
-1
No files matched your search
@@ -11,6 +11,7 @@ std::ostream& operator<<(std::ostream& os, const Item& obj)
|
||||
<< ", quality: " << obj.quality;
|
||||
}
|
||||
|
||||
// This is a normal unit test using Catch2
|
||||
TEST_CASE("UpdateQuality") {
|
||||
|
||||
vector<Item> items;
|
||||
@@ -19,3 +20,13 @@ TEST_CASE("UpdateQuality") {
|
||||
app.updateQuality();
|
||||
REQUIRE("fixme" == app.items[0].name);
|
||||
}
|
||||
|
||||
// This is an Approval test using https://github.com/approvals/approvaltests.cpp
|
||||
TEST_CASE("UpdateQualityApprovalTest") {
|
||||
vector<Item> items;
|
||||
items.push_back(Item("foo", 0, 0));
|
||||
GildedRose app(items);
|
||||
app.updateQuality();
|
||||
auto item = app.items[0];
|
||||
ApprovalTests::Approvals::verify(item);
|
||||
}
|
||||
Reference in new issue
Block a user