mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-10-16 02:53:57 +00:00
Refactor C++ version of the Gilded Rose kata
* Make it possible to build and run tests in CLion
and Visual Studio 2019 out of the box
* Provide four types of initial test using different test frameworks:
* Catch2 test framework
* Traditional unit testing using Catch2
* Approval test using Catch2
* Google Test test framework
* Traditional unit testing using Google Test
* Approval test using Google Test
* The different types of initial test are located in separate folders
in the test folder.
* Remove scripts to build and run tests and replace
with instructions in the cpp README.md
* Use C++17
* Use CMake => 3.13
This commit is contained in:
1 parent
16dd174765
commit
1836cca836
30 files changed
+20786
-287
No files matched your search
@@ -0,0 +1,29 @@
|
||||
#define APPROVALS_CATCH
|
||||
#include "ApprovalTests.hpp"
|
||||
#include "GildedRose.h"
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const Item& obj)
|
||||
{
|
||||
return os
|
||||
<< "name: " << obj.name
|
||||
<< ", sellIn: " << obj.sellIn
|
||||
<< ", quality: " << obj.quality;
|
||||
}
|
||||
|
||||
TEST_CASE("GildedRoseApprovalTests", "VerifyCombinations")
|
||||
{
|
||||
std::vector<string> names { "Foo" };
|
||||
std::vector<int> sellIns { 1 };
|
||||
std::vector<int> qualities { 1 };
|
||||
|
||||
auto f = [](string name, int sellIn, int quality) {
|
||||
vector<Item> items = {Item(name, sellIn, quality)};
|
||||
GildedRose app(items);
|
||||
app.updateQuality();
|
||||
return items[0];
|
||||
};
|
||||
|
||||
ApprovalTests::CombinationApprovals::verifyAllCombinations(
|
||||
f,
|
||||
names, sellIns, qualities);
|
||||
}
|
||||
Reference in new issue
Block a user