Exemplo n.º 1
0
        public bool IsGrammarCorrect()
        {
            string[] splittedEntry = entry.Split('.');

            if (splittedEntry.Length != 2)
            {
                return(false);
                //throw new Exception("#Incorrect length of attr ref");
            }

            string declarationName = splittedEntry[0];
            string attrNameEntry   = splittedEntry[1];

            Synonym  synonym  = new Synonym(declarationName);
            AttrName attrName = new AttrName(attrNameEntry, declarationName, declarations);

            if (!synonym.IsGrammarCorrect())
            {
                return(false);
                //throw new Exception("#Incorrect synonym in attr ref: " + synonym.entry);
            }

            if (!attrName.IsGrammarCorrect())
            {
                return(false);
                //throw new Exception("#Incorrect attr name: " + attrName.entry);
            }

            refType = attrName.refType;
            return(true);
        }
Exemplo n.º 2
0
        public void ValidateSynonym_ShouldReturnFalse(string input)
        {
            Synonym synonym = new Synonym(input);
            bool    result  = synonym.IsGrammarCorrect();

            Assert.False(result);
        }