Beispiel #1
0
        public void ShouldReturnEmptyWhenValidCurrencyAndNumeral()
        {
            // arrange
            var textToTest = "test is V";
            var currencies = new Dictionary <string, string>();
            var rule       = new CurrencyAssignmentParsingRule();

            // act
            var result = rule.Process(textToTest, currencies, null);

            // assert
            result.ShouldBe(string.Empty);
            currencies.ShouldContainKeyAndValue("test", "V");
        }
Beispiel #2
0
        public void ShouldReturnErrorMessageWhenNoValidNumeral()
        {
            // arrange
            var textToTest = "test is Z";
            var currencies = new Dictionary <string, string> {
                { "test", "X" }
            };
            var rule = new CurrencyAssignmentParsingRule();

            // act
            var result = rule.Process(textToTest, currencies, null);

            // assert
            result.ShouldBe(Program.ERROR_MESSAGE);
        }