-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRomanNumeralTests.cpp
50 lines (38 loc) · 1.13 KB
/
RomanNumeralTests.cpp
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
#include "RomanNumeral.h"
#include "gtest/gtest.h"
#include<string>
namespace
{
TEST(RomanNumeral, Basic)
{
const int arabToCheck = 100;
const std::string expectedRoman = "C";
RomanNumeral romanNumeral(arabToCheck);
const std::string actualRoman = romanNumeral.get();
EXPECT_EQ(expectedRoman, actualRoman);
}
TEST(RomanNumeral, Add)
{
const int arabToCheck = 1001;
const std::string expectedRoman = "MI";
RomanNumeral romanNumeral(arabToCheck);
const std::string actualRoman = romanNumeral.get();
EXPECT_EQ(expectedRoman, actualRoman);
}
TEST(RomanNumeral, Substract)
{
const int arabToCheck = 90;
const std::string expectedRoman = "XC";
RomanNumeral romanNumeral(arabToCheck);
const std::string actualRoman = romanNumeral.get();
EXPECT_EQ(expectedRoman, actualRoman);
}
TEST(RomanNumeral, SubstractAndAdd)
{
const int arabToCheck = 92;
const std::string expectedRoman = "XCII";
RomanNumeral romanNumeral(arabToCheck);
const std::string actualRoman = romanNumeral.get();
EXPECT_EQ(expectedRoman, actualRoman);
}
} // namespace