private RomanToArabicConverter CreateRomanToArabicConverter() { IRomanNumeralValidator romanNumeralValidator = new RomanNumeralValidator(); IValueGatherer valueGatherer = new ValueGatherer(); return(new RomanToArabicConverter(romanNumeralValidator, valueGatherer)); }
public void CorrectlyGathersOne() { ValueGatherer valueGatherer = new ValueGatherer(); valueGatherer.Add(RomanDigit.I); int result = valueGatherer.GetValue(); Assert.AreEqual(1, result); }
public void CorrectlyGathersOneHundredSixty() { ValueGatherer valueGatherer = new ValueGatherer(); valueGatherer.Add(RomanDigit.C); valueGatherer.Add(RomanDigit.L); valueGatherer.Add(RomanDigit.X); int result = valueGatherer.GetValue(); Assert.AreEqual(160, result); }
public void CorrectlyGathersTwoThousandNineteen() { ValueGatherer valueGatherer = new ValueGatherer(); valueGatherer.Add(RomanDigit.M); valueGatherer.Add(RomanDigit.M); valueGatherer.Add(RomanDigit.X); valueGatherer.Add(RomanDigit.I); valueGatherer.Add(RomanDigit.X); int result = valueGatherer.GetValue(); Assert.AreEqual(2019, result); }
public void CorrectlyGathersOneThousandNineHundredNinety() { ValueGatherer valueGatherer = new ValueGatherer(); valueGatherer.Add(RomanDigit.M); valueGatherer.Add(RomanDigit.C); valueGatherer.Add(RomanDigit.M); valueGatherer.Add(RomanDigit.X); valueGatherer.Add(RomanDigit.C); int result = valueGatherer.GetValue(); Assert.AreEqual(1990, result); }
public void CorrectlyGathersOneThousandSixtySix() { ValueGatherer valueGatherer = new ValueGatherer(); valueGatherer.Add(RomanDigit.M); valueGatherer.Add(RomanDigit.L); valueGatherer.Add(RomanDigit.X); valueGatherer.Add(RomanDigit.V); valueGatherer.Add(RomanDigit.I); int result = valueGatherer.GetValue(); Assert.AreEqual(1066, result); }
public void CorrectlyGathersFourHundredTwentyOne() { ValueGatherer valueGatherer = new ValueGatherer(); valueGatherer.Add(RomanDigit.C); valueGatherer.Add(RomanDigit.D); valueGatherer.Add(RomanDigit.X); valueGatherer.Add(RomanDigit.X); valueGatherer.Add(RomanDigit.I); int result = valueGatherer.GetValue(); Assert.AreEqual(421, result); }
public void CorrectlyGathersTwoHundredSeven() { ValueGatherer valueGatherer = new ValueGatherer(); valueGatherer.Add(RomanDigit.C); valueGatherer.Add(RomanDigit.C); valueGatherer.Add(RomanDigit.V); valueGatherer.Add(RomanDigit.I); valueGatherer.Add(RomanDigit.I); int result = valueGatherer.GetValue(); Assert.AreEqual(207, result); }
public void CorrectlyGathersOneThousandNineHundredFiftyFour() { ValueGatherer valueGatherer = new ValueGatherer(); valueGatherer.Add(RomanDigit.M); valueGatherer.Add(RomanDigit.C); valueGatherer.Add(RomanDigit.M); valueGatherer.Add(RomanDigit.L); valueGatherer.Add(RomanDigit.I); valueGatherer.Add(RomanDigit.V); int result = valueGatherer.GetValue(); Assert.AreEqual(1954, result); }
public void CorrectlyGathersTwoHundredFortySix() { ValueGatherer valueGatherer = new ValueGatherer(); valueGatherer.Add(RomanDigit.C); valueGatherer.Add(RomanDigit.C); valueGatherer.Add(RomanDigit.X); valueGatherer.Add(RomanDigit.L); valueGatherer.Add(RomanDigit.V); valueGatherer.Add(RomanDigit.I); int result = valueGatherer.GetValue(); Assert.AreEqual(246, result); }