C# Класс RubberduckTests.Mocks.MockProjectBuilder

Builds a mock VBProject.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddComponent ( Mock component ) : MockProjectBuilder

Adds a new mock component to the project. Use the AddComponent(string,vbext_ComponentType,string) overload to add module components. Use this overload to add user forms created with a RubberduckTests.Mocks.MockUserFormBuilder instance.

AddComponent ( string name, vbext_ComponentType type, string content ) : MockProjectBuilder

Adds a new component to the project.

AddReference ( string name, string filePath, bool isBuiltIn = false ) : MockProjectBuilder

Adds a mock reference to the project.

Build ( ) : Mock

Gets the mock VBProject instance.

MockProjectBuilder ( string name, vbext_ProjectProtection protection, Func getVbe, MockVbeBuilder mockVbeBuilder ) : System
MockUserFormBuilder ( string name, string content ) : MockUserFormBuilder

Creates a RubberduckTests.Mocks.MockUserFormBuilder to build a new form component.

MockVbeBuilder ( ) : MockVbeBuilder

Builds the project, adds it to the VBE, and returns a MockVbeBuilder to continue adding projects to the VBE.

Приватные методы

Метод Описание
CreateCodeModuleMock ( string content ) : Mock
CreateCodeModuleMock ( string name, string content ) : Mock
CreateCodePaneMock ( string name ) : Mock
CreateComponentMock ( string name, vbext_ComponentType type, string content ) : Mock
CreateComponentsMock ( ) : Mock
CreateProjectMock ( string name, vbext_ProjectProtection protection ) : Mock
CreateReferenceMock ( string name, string filePath, bool isBuiltIn = true ) : Mock
CreateReferencesMock ( ) : Mock

Описание методов

AddComponent() публичный Метод

Adds a new mock component to the project. Use the AddComponent(string,vbext_ComponentType,string) overload to add module components. Use this overload to add user forms created with a RubberduckTests.Mocks.MockUserFormBuilder instance.
public AddComponent ( Mock component ) : MockProjectBuilder
component Mock The component to add.
Результат MockProjectBuilder

AddComponent() публичный Метод

Adds a new component to the project.
public AddComponent ( string name, vbext_ComponentType type, string content ) : MockProjectBuilder
name string The name of the new component.
type vbext_ComponentType The type of component to create.
content string The VBA code associated to the component.
Результат MockProjectBuilder

AddReference() публичный Метод

Adds a mock reference to the project.
public AddReference ( string name, string filePath, bool isBuiltIn = false ) : MockProjectBuilder
name string The name of the referenced library.
filePath string The path to the referenced library.
isBuiltIn bool Indicates whether the reference is a built-in reference.
Результат MockProjectBuilder

Build() публичный Метод

Gets the mock VBProject instance.
public Build ( ) : Mock
Результат Mock

MockProjectBuilder() публичный Метод

public MockProjectBuilder ( string name, vbext_ProjectProtection protection, Func getVbe, MockVbeBuilder mockVbeBuilder ) : System
name string
protection vbext_ProjectProtection
getVbe Func
mockVbeBuilder MockVbeBuilder
Результат System

MockUserFormBuilder() публичный Метод

Creates a RubberduckTests.Mocks.MockUserFormBuilder to build a new form component.
public MockUserFormBuilder ( string name, string content ) : MockUserFormBuilder
name string The name of the component.
content string The VBA code associated to the component.
Результат MockUserFormBuilder

MockVbeBuilder() публичный Метод

Builds the project, adds it to the VBE, and returns a MockVbeBuilder to continue adding projects to the VBE.
public MockVbeBuilder ( ) : MockVbeBuilder
Результат MockVbeBuilder