Beispiel #1
0
        public void ShouldReturnErrorMessageWhenNoValidCurrency()
        {
            // arrange
            var textToTest = "how much is nope?";
            var currencies = new Dictionary <string, string> {
                { "curr", "Z" }
            };
            var rule = new MuchQuestionParsingRule();

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

            // assert
            result.ShouldBe(Program.ERROR_MESSAGE);
        }
Beispiel #2
0
        public void ShouldReturnCorrectMessageWhenMultipleValidCurrency()
        {
            // arrange
            var textToTest = "how much is pish tegj glob glob?";
            var currencies = new Dictionary <string, string> {
                { "pish", "X" }, { "tegj", "L" }, { "glob", "I" }
            };
            var rule     = new MuchQuestionParsingRule();
            var expected = "pish tegj glob glob is 42";

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

            // assert
            result.ShouldBe(expected);
        }
Beispiel #3
0
        public void ShouldReturnCorrectMessageWhenValidCurrency()
        {
            // arrange
            var textToTest = "how much is curr?";
            var currencies = new Dictionary <string, string> {
                { "curr", "X" }
            };
            var rule     = new MuchQuestionParsingRule();
            var expected = "curr is 10";

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

            // assert
            result.ShouldBe(expected);
        }