Example #1
0
        public void GivenAnActiveClass_WhenAMethodIsFound_ThenTheMethodIsAddedToTheClassModel()
        {
            Class classmodel = new Class("", "");

            _methodListener.setCurrentClass(classmodel);

            Mocks.MethodContextMock methodcontext = new Mocks.MethodContextMock(null, 1);
            _methodListener.EnterMethodDeclaration(methodcontext);

            _methodListener.resetCurrentClass();

            Assert.AreEqual(classmodel.NumberOfMethods, 1);
            Assert.AreEqual("test", classmodel.Methods[0].Content);
        }
Example #2
0
        public void GivenNoActiveClass_WhenAMethodIsFound_ThenTheMethodIsIgnored()
        {
            Mocks.MethodContextMock methodcontext = new Mocks.MethodContextMock(null, 1);

            Assert.DoesNotThrow(() => _methodListener.EnterMethodDeclaration(methodcontext));
        }