Esempio n. 1
0
        public void SanitizerTestSanitizeSimpleSkill()
        {
            string expression = $"{LConstants.HARM_F}({LConstants.TargetKeyword},{LConstants.SourceKeyword}, T, {LConstants.GET_PROP_F}({LConstants.SourceKeyword}, STR))";

            string[] expected = { LConstants.HARM_F, "(", MockEnemy.Key, ",", MockPlayer.Key, ",", "T", ",", LConstants.GET_PROP_F, "(", MockPlayer.Key, ",", "STR", ")", ")" };
            Token[]  actual   = SanitizerInstance.ReplaceEntities(Tokenizer.Tokenize(expression), MockPlayer, MockEnemy);
            Assert.AreEqual(expected.Length, actual.Length);
            for (int i = 0; i < actual.Length; ++i)
            {
                Assert.AreEqual(expected[i], actual[i].Value);
            }
        }