Пример #1
0
        public ExtractInterfaceModel(IDeclarationFinderProvider declarationFinderProvider, ClassModuleDeclaration target, ICodeBuilder codeBuilder)
        {
            TargetDeclaration         = target;
            DeclarationFinderProvider = declarationFinderProvider;

            if (TargetDeclaration == null)
            {
                return;
            }

            InterfaceName       = $"I{TargetDeclaration.IdentifierName}";
            InterfaceInstancing = ImplementingClassInstancing;

            LoadMembers(codeBuilder);
        }
        public void ExtractInterfaceRefactoring_DefaultsToPublicInterface(string attribute, ClassInstancing expected)
        {
            var inputCode =
                $@"{attribute}

Public Sub F|oo
End Sub";

            var model = RetrieveModel(inputCode.ToCodeString());

            Assert.AreEqual(expected, model.InterfaceInstancing);
        }