Exemplo n.º 1
0
        public void Convert_False_ConvertedToNo()
        {
            var    languageConverter = new CSharpNaturalLanguageConverter();
            string actual            = languageConverter.Convert(() => false);

            Assert.AreEqual("No", actual);
        }
Exemplo n.º 2
0
        public void Convert_SingleLetterVariables_FirstLetterCapitalized()
        {
            var    languageConverter = new CSharpNaturalLanguageConverter();
            var    a      = false;
            string actual = languageConverter.Convert(() => a);

            Assert.AreEqual("A", actual);
        }
Exemplo n.º 3
0
        public void Convert_ConstantsInOperators_StillConvertToNaturalLanguage()
        {
            var    languageConverter = new CSharpNaturalLanguageConverter();
            bool   yes    = false;
            string actual = languageConverter.Convert(() => yes && false && true);

            Assert.AreEqual("Yes and No and Yes", actual);
        }
Exemplo n.º 4
0
        public void Convert_OperatorsAndVariables_RecurseIndefinetely()
        {
            var    languageConverter = new CSharpNaturalLanguageConverter();
            var    cat    = false;
            string actual = languageConverter.Convert(() => cat && cat && cat && cat);

            Assert.AreEqual("Cat and Cat and Cat and Cat", actual);
        }
Exemplo n.º 5
0
        public void Convert_LogicalAnd_MapToLogialAnd()
        {
            var    languageConverter = new CSharpNaturalLanguageConverter();
            var    cat    = false;
            var    dog    = true;
            string actual = languageConverter.Convert(() => dog & cat);

            Assert.AreEqual("Dog (and) Cat", actual);
        }
Exemplo n.º 6
0
        public void Convert_OrOperator_MapToOr()
        {
            var    languageConverter = new CSharpNaturalLanguageConverter();
            var    cat    = false;
            var    dog    = true;
            string actual = languageConverter.Convert(() => cat || dog);

            Assert.AreEqual("Cat or Dog", actual);
        }
Exemplo n.º 7
0
        public void Convert_OperatorsAndVariables_MapToStrings()
        {
            var    languageConverter = new CSharpNaturalLanguageConverter();
            var    cat    = false;
            var    dog    = true;
            string actual = languageConverter.Convert(() => cat && dog);

            Assert.AreEqual("Cat and Dog", actual);
        }
Exemplo n.º 8
0
        public void Convert_True_ConvertedToYes()
        {
            // todo #1: Remove the ignore attribute and get the tests passing. Changing the paremeter of the function is ok, but not the unit tests
            // todo #2: This is a terrible non-real world example because a real example would be too involved. So how is this feature really used?

            var    languageConverter = new CSharpNaturalLanguageConverter();
            string actual            = languageConverter.Convert(() => true);

            Assert.AreEqual("Yes", actual);
        }