コード例 #1
0
        public void ParseTest(string input, Type[] expectedStatementTypes)
        {
            var target = new SignalStatementParser();
            var actualStatementTypes = target.Parse(input).Select(statement => statement.GetType());

            CollectionAssert.AreEquivalent(expectedStatementTypes, actualStatementTypes);
        }
コード例 #2
0
        public void EnsureTokensSimple(string input, string[] expectedTokenValues)
        {
            var target            = new SignalStatementParser();
            var actual            = target.Parse(input);
            var actualTokenvalues = actual.SelectMany(statement => statement.Tokens()).Select(token => token.Value);

            CollectionAssert.AreEquivalent(expectedTokenValues, actualTokenvalues);
        }
コード例 #3
0
        public void VerifySourceAndTarget(string input, string expectedSourceValue, string expectedTargetValue)
        {
            var parser          = new SignalStatementParser();
            var statements      = parser.Parse(input);
            var signalStatement = statements.OfType <SignalStatement>().Single();

            Assert.That(signalStatement.Source.Value, Is.EqualTo(expectedSourceValue));
            Assert.That(signalStatement.Target.Value, Is.EqualTo(expectedTargetValue));
        }