public void ParseTest(string input, Type[] expectedStatementTypes) { var target = new SignalStatementParser(); var actualStatementTypes = target.Parse(input).Select(statement => statement.GetType()); CollectionAssert.AreEquivalent(expectedStatementTypes, actualStatementTypes); }
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); }
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)); }