public void EmptyInterface()
        {
            var source = @"
                public interface MyInterface {
                }
            ";

            var interfaceDeclarationNode = NodeFinder <InterfaceDeclarationSyntax> .GetNode(source);

            Assert.IsNotNull(interfaceDeclarationNode);

            var translationUnitFactory = new InterfaceDeclarationTranslationUnitFactory(interfaceDeclarationNode).Create();

            Assert.IsNotNull(translationUnitFactory, "Translation unit expected to be created!");

            var interfaceTranslationUnit = (translationUnitFactory as InterfaceDeclarationTranslationUnit);

            Assert.IsNotNull(interfaceTranslationUnit, $"Expecting a translation unit of type {typeof(InterfaceDeclarationTranslationUnit).Name}!");

            var translationUnit = MockedInterfaceDeclarationTranslationUnit.Create(interfaceTranslationUnit);

            Assert.IsNotNull(translationUnit.Signatures);
            Assert.AreEqual(0, translationUnit.Signatures.Count(), "Expecting no signatures!");
        }
示例#2
0
 protected MockedInterfaceASTWalker(InterfaceASTWalker original)
     : base(original)
 {
     // Reassigning since base class operated on it
     this.interfaceDeclaration = MockedInterfaceDeclarationTranslationUnit.Create(this.interfaceDeclaration);
 }