示例#1
0
        public void Should_ReturnValidationErrors_When_ValidationIsUnsuccessful(string invalidRomanNumeral)
        {
            var romanNumeralsConverterMock    = MockRepository.GenerateMock <IRomanToArabicConverter>();
            var romanToArabicConverterManager = new RomanToArabicConverterManager(romanNumeralsConverterMock, _romanNumeralValidator);

            romanToArabicConverterManager.TryConvertingRomanToArabic(invalidRomanNumeral);

            romanNumeralsConverterMock.AssertWasNotCalled(c => c.ConvertToArabic(invalidRomanNumeral));
        }
示例#2
0
        public void Should_ConvertRomanNumeralToArabic_When_ValidationIsSuccessful(string validRomanNumeral) //is the name good? Would the name like Should_CallConvertToArabic_When... be good?
        {
            var romanNumeralsConverterMock    = MockRepository.GenerateMock <IRomanToArabicConverter>();
            var romanToArabicConverterManager = new RomanToArabicConverterManager(romanNumeralsConverterMock, _romanNumeralValidator);

            romanToArabicConverterManager.TryConvertingRomanToArabic(validRomanNumeral);

            romanNumeralsConverterMock.AssertWasCalled(c => c.ConvertToArabic(validRomanNumeral));
        }