77
88namespace  RubberduckTests . Mocks 
99{ 
10+     /// <summary> 
11+     /// Builds a mock <see cref="VBProject"/>. 
12+     /// </summary> 
1013    public  class  MockProjectBuilder 
1114    { 
1215        private  readonly  Func < VBE >  _getVbe ; 
@@ -30,30 +33,58 @@ public MockProjectBuilder(string name, vbext_ProjectProtection protection, Func<
3033            _project . SetupGet ( m =>  m . References ) . Returns ( _vbReferences . Object ) ; 
3134        } 
3235
36+         /// <summary> 
37+         /// Adds a new component to the project. 
38+         /// </summary> 
39+         /// <param name="name">The name of the new component.</param> 
40+         /// <param name="type">The type of component to create.</param> 
41+         /// <param name="content">The VBA code associated to the component.</param> 
42+         /// <returns>Returns the <see cref="MockProjectBuilder"/> instance.</returns> 
3343        public  MockProjectBuilder  AddComponent ( string  name ,  vbext_ComponentType  type ,  string  content ) 
3444        { 
3545            var  component  =  CreateComponentMock ( name ,  type ,  content ) ; 
3646            return  AddComponent ( component ) ; 
3747        } 
3848
49+         /// <summary> 
50+         /// Adds a new mock component to the project. 
51+         /// Use the <see cref="AddComponent(string,vbext_ComponentType,string)"/> overload to add module components. 
52+         /// Use this overload to add user forms created with a <see cref="MockUserFormBuilder"/> instance. 
53+         /// </summary> 
54+         /// <param name="component">The component to add.</param> 
55+         /// <returns>Returns the <see cref="MockProjectBuilder"/> instance.</returns> 
3956        public  MockProjectBuilder  AddComponent ( Mock < VBComponent >  component ) 
4057        { 
4158            _components . Add ( component ) ; 
4259            return  this ;             
4360        } 
4461
62+         /// <summary> 
63+         /// Adds a mock reference to the project. 
64+         /// </summary> 
65+         /// <param name="name">The name of the referenced library.</param> 
66+         /// <param name="filePath">The path to the referenced library.</param> 
67+         /// <returns>Returns the <see cref="MockProjectBuilder"/> instance.</returns> 
4568        public  MockProjectBuilder  AddReference ( string  name ,  string  filePath ) 
4669        { 
4770            _references . Add ( CreateReferenceMock ( name ,  filePath ) ) ; 
4871            return  this ; 
4972        } 
5073
74+         /// <summary> 
75+         /// Creates a <see cref="MockUserFormBuilder"/> to build a new form component. 
76+         /// </summary> 
77+         /// <param name="name">The name of the component.</param> 
78+         /// <param name="content">The VBA code associated to the component.</param> 
5179        public  MockUserFormBuilder  UserFormBuilder ( string  name ,  string  content ) 
5280        { 
5381            var  component  =  CreateComponentMock ( name ,  vbext_ComponentType . vbext_ct_MSForm ,  content ) ; 
5482            return  new  MockUserFormBuilder ( component ) ; 
5583        } 
5684
85+         /// <summary> 
86+         /// Gets the mock <see cref="VBProject"/> instance. 
87+         /// </summary> 
5788        public  Mock < VBProject >  Build ( ) 
5889        { 
5990            return  _project ; 
0 commit comments