public void Function_SomeValue_Equal()
 {
     const string function = "myfunc";
     var term = new FunctionDeclarationTerm(function, 1);
     Assert.That(term.Identifier, Is.EqualTo(function));
     Assert.That(term.ArgumentCount, Is.EqualTo(1));
 }
        public void Resolve_AbsentFunction_Null()
        {
            var children = new[]
            {
                MockRepository.GenerateStub<ISyntacticNode>(),
            };

            var linkedClass = MockRepository.GenerateStub<ILinkedLibrary>();
            var term = new FunctionDeclarationTerm("max", 1);
            linkedClass.Stub(lc => lc.FindParamFunction(term)).Return(null);
            

            var resolver = new ParamFunctionResolver();
            var resolvedTerm = resolver.Resolve(term, children, linkedClass);

            Assert.That(resolvedTerm, Is.Null);
        }
예제 #3
0
 public void Resolve_AppropriateTermType_True()
 {
     var resolverType = new ResolverType<FunctionDeclarationTerm>();
     var term = new FunctionDeclarationTerm("variable", 1);
     Assert.That(resolverType.Resolve(term), Is.True);
 }