public MockUserFormBuilder(Mock<VBComponent> component, MockProjectBuilder mockProjectBuilder)
        {
            if (component.Object.Type != vbext_ComponentType.vbext_ct_MSForm)
            {
                throw new InvalidOperationException("Component type must be 'vbext_ComponentType.vbext_ct_MSForm'.");
            }

            _component = component;
            _mockProjectBuilder = mockProjectBuilder;
            _vbControls = CreateControlsMock();
        }
示例#2
0
        public MockUserFormBuilder(Mock <IVBComponent> component, MockProjectBuilder mockProjectBuilder)
        {
            if (component.Object.Type != ComponentType.UserForm)
            {
                throw new InvalidOperationException("Component type must be 'ComponentType.UserForm'.");
            }

            _component          = component;
            _mockProjectBuilder = mockProjectBuilder;
            _vbControls         = CreateControlsMock();
        }
        public MockProjectBuilder ProjectBuilder(string name, string filename, vbext_ProjectProtection protection)
        {
            var result = new MockProjectBuilder(name, filename, protection, () => _vbe.Object, this);

            return(result);
        }
示例#4
0
 /// <summary>
 /// Creates a <see cref="MockProjectBuilder"/> to build a new project.
 /// </summary>
 /// <param name="name">The name of the project to build.</param>
 /// <param name="protection">A value that indicates whether the project is protected.</param>
 public MockProjectBuilder ProjectBuilder(string name, vbext_ProjectProtection protection)
 {
     var result = new MockProjectBuilder(name, protection, () => _vbe.Object, this);
     return result;
 }