Skip to content

Commit b1d9556

Browse files
committed
added xml docs
1 parent 96840e0 commit b1d9556

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

RubberduckTests/Mocks/MockProjectBuilder.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
namespace 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;

RubberduckTests/Mocks/MockUserFormBuilder.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
namespace RubberduckTests.Mocks
1010
{
11+
/// <summary>
12+
/// Builds a mock <see cref="UserForm"/> component.
13+
/// </summary>
1114
public class MockUserFormBuilder
1215
{
1316
private readonly Mock<VBComponent> _component;
@@ -25,6 +28,11 @@ public MockUserFormBuilder(Mock<VBComponent> component)
2528
_vbControls = CreateControlsMock();
2629
}
2730

31+
/// <summary>
32+
/// Adds a <see cref="Control"/> to the form.
33+
/// </summary>
34+
/// <param name="name">The name of the control to add.</param>
35+
/// <returns></returns>
2836
public MockUserFormBuilder AddControl(string name)
2937
{
3038
var control = new Mock<Control>();
@@ -34,6 +42,10 @@ public MockUserFormBuilder AddControl(string name)
3442
return this;
3543
}
3644

45+
/// <summary>
46+
/// Gets the mock <see cref="UserForm"/> component.
47+
/// </summary>
48+
/// <returns></returns>
3749
public Mock<VBComponent> Build()
3850
{
3951
var designer = CreateMockDesigner();

RubberduckTests/Mocks/MockVbeBuilder.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
namespace RubberduckTests.Mocks
88
{
9+
/// <summary>
10+
/// Builds a mock <see cref="VBE"/>.
11+
/// </summary>
912
public class MockVbeBuilder
1013
{
1114
private readonly Mock<VBE> _vbe;
@@ -21,6 +24,12 @@ public MockVbeBuilder()
2124
_vbe = CreateVbeMock();
2225
}
2326

27+
/// <summary>
28+
/// Adds a project to the mock VBE.
29+
/// Use a <see cref="MockProjectBuilder"/> to build the <see cref="project"/>.
30+
/// </summary>
31+
/// <param name="project">A mock <see cref="VBProject"/>.</param>
32+
/// <returns>Returns the <see cref="MockVbeBuilder"/> instance.</returns>
2433
public MockVbeBuilder AddProject(Mock<VBProject> project)
2534
{
2635
project.SetupGet(m => m.VBE).Returns(_vbe.Object);
@@ -34,12 +43,20 @@ public MockVbeBuilder AddProject(Mock<VBProject> project)
3443
return this;
3544
}
3645

46+
/// <summary>
47+
/// Creates a <see cref="MockProjectBuilder"/> to build a new project.
48+
/// </summary>
49+
/// <param name="name">The name of the project to build.</param>
50+
/// <param name="protection">A value that indicates whether the project is protected.</param>
3751
public MockProjectBuilder ProjectBuilder(string name, vbext_ProjectProtection protection)
3852
{
3953
var result = new MockProjectBuilder(name, protection, () => _vbe.Object);
4054
return result;
4155
}
4256

57+
/// <summary>
58+
/// Gets the mock <see cref="VBE"/> instance.
59+
/// </summary>
4360
public Mock<VBE> Build()
4461
{
4562
return _vbe;

0 commit comments

Comments
 (0)