Ejemplo n.º 1
0
        public void GivenAnActiveMethod_WhenAStatmentIsFound_ThenTheStatmentIsAddedToTheClassModel()
        {
            Method method = new Method(null, "", "");

            _statementListener.setCurrentMethod(method);

            Mocks.StatementContextMock statementContext = new Mocks.StatementContextMock(null, 1);
            _statementListener.EnterStatement(statementContext);
            method.ExtractInnerAndOuterMethodInvocations();

            _statementListener.resetCurrentMethod();

            Assert.AreEqual(1, method.OuterMethodInvocations.Count);
            Assert.AreEqual("testInvoke", method.OuterMethodInvocations[0].Content);
        }
Ejemplo n.º 2
0
        public void GivenNoActiveMethod_WhenAStatmentIsFound_ThenTheStatmentIsIgnored()
        {
            Mocks.StatementContextMock statementContext = new Mocks.StatementContextMock(null, 1);

            Assert.DoesNotThrow(() => _statementListener.EnterStatement(statementContext));
        }