Skip to content
This repository was archived by the owner on Jul 29, 2025. It is now read-only.

Commit 8ec9971

Browse files
committed
Step 5 - Red
1 parent 5e83b4e commit 8ec9971

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Test-C-String-Calculator-Kata/Test-C-String-Calculator-Kata.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,16 @@ namespace TestCStringCalculatorKata
3939
{
4040
Assert::AreEqual(3, add("//;\n1;2"));
4141
}
42+
43+
TEST_METHOD(TestMethodNegativeNumbers)
44+
{
45+
try {
46+
add("1,4,-1");
47+
Assert::Fail(L"Expected exception not thrown");
48+
}
49+
catch (const std::exception& ex) {
50+
Assert::AreEqual("negatives not allowed: -1", ex.what());
51+
}
52+
}
4253
};
4354
}

0 commit comments

Comments
 (0)