Skip to content

Commit 92a0bff

Browse files
authored
Merge pull request #6060 from retailcoder/FakesUX
Adds parameter string names provider to Fakes API
2 parents ea42d7f + f266216 commit 92a0bff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1292
-0
lines changed

Rubberduck.Main/ComClientLibrary/Abstract/UnitTesting/IFakesProvider.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,5 +135,10 @@ public interface IFakesProvider
135135
[DispId(31)]
136136
[Description("Configures VBA.FileSystem.FileCopy calls.")]
137137
IStub FileCopy { get; }
138+
139+
140+
[DispId(255)]
141+
[Description("Gets an interface exposing the parameter names for all parameterized fakes.")]
142+
IParams Params { get; }
138143
}
139144
}
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
using System.ComponentModel;
2+
using System.Runtime.InteropServices;
3+
using Rubberduck.Resources.Registration;
4+
5+
// ReSharper disable InconsistentNaming
6+
// The parameters on RD's public interfaces are following VBA conventions not C# conventions to stop the
7+
// obnoxious "Can I haz all identifiers with the same casing" behavior of the VBE.
8+
9+
namespace Rubberduck.UnitTesting
10+
{
11+
[
12+
ComVisible(true),
13+
Guid(RubberduckGuid.IParamsGuid),
14+
InterfaceType(ComInterfaceType.InterfaceIsDual),
15+
EditorBrowsable(EditorBrowsableState.Always)
16+
]
17+
public interface IParams
18+
{
19+
[DispId(1)]
20+
[Description("Gets an interface exposing the parameter names for the 'VBA.Interaction.MsgBox' function.")]
21+
IMsgBoxParams MsgBox { get; }
22+
23+
[DispId(2)]
24+
[Description("Gets an interface exposing the parameter names for the 'VBA.Interaction.InputBox' function.")]
25+
IInputBoxParams InputBox { get; }
26+
27+
[DispId(3)]
28+
[Description("Gets an interface exposing the parameter names for the 'VBA.Interaction.Environ' function.")]
29+
IEnvironParams Environ { get; }
30+
31+
[DispId(4)]
32+
[Description("Gets an interface exposing the parameter names for the 'VBA.Interaction.Shell' function.")]
33+
IShellParams Shell { get; }
34+
35+
[DispId(5)]
36+
[Description("Gets an interface exposing the parameter names for the 'VBA.Interaction.SendKeys' function.")]
37+
ISendKeysParams SendKeys { get; }
38+
39+
[DispId(6)]
40+
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.Kill' function.")]
41+
IKillParams Kill { get; }
42+
43+
[DispId(7)]
44+
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.FileCopy' statement.")]
45+
IFileCopyParams FileCopy { get; }
46+
47+
[DispId(8)]
48+
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.FreeFile' function.")]
49+
IFreeFileParams FreeFile { get; }
50+
51+
[DispId(9)]
52+
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.GetAttr' function.")]
53+
IGetAttrParams GetAttr { get; }
54+
55+
[DispId(10)]
56+
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.SetAttr' statement.")]
57+
ISetAttrParams SetAttr { get; }
58+
59+
[DispId(11)]
60+
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.FileLen' function.")]
61+
IFileLenParams FileLen { get; }
62+
63+
[DispId(12)]
64+
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.FileDateTime' function.")]
65+
IFileDateTimeParams FileDateTime { get; }
66+
67+
[DispId(13)]
68+
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.Dir' function.")]
69+
IDirParams Dir { get; }
70+
71+
[DispId(14)]
72+
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.CurDir' function.")]
73+
ICurDirParams CurDir { get; }
74+
75+
[DispId(15)]
76+
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.ChDir' statement.")]
77+
IChDirParams ChDir { get; }
78+
79+
[DispId(16)]
80+
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.ChDrive' statement.")]
81+
IChDriveParams ChDrive { get; }
82+
83+
[DispId(17)]
84+
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.MkDir' statement.")]
85+
IMkDirParams MkDir { get; }
86+
87+
[DispId(18)]
88+
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.RmDir' statement.")]
89+
IRmDirParams RmDir { get; }
90+
91+
[DispId(19)]
92+
[Description("Gets an interface exposing the parameter names for the 'VBA.Interaction.SaveSetting' statement.")]
93+
ISaveSettingParams SaveSetting { get; }
94+
95+
[DispId(20)]
96+
[Description("Gets an interface exposing the parameter names for the 'VBA.Interaction.DeleteSetting' statement.")]
97+
IDeleteSettingParams DeleteSetting { get; }
98+
99+
[DispId(21)]
100+
[Description("Gets an interface exposing the parameter names for the 'VBA.Math.Randomize' statement.")]
101+
IRandomizeParams Randomize { get; }
102+
103+
[DispId(22)]
104+
[Description("Gets an interface exposing the parameter names for the 'VBA.Math.Rnd' function.")]
105+
IRndParams Rnd { get; }
106+
}
107+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System.ComponentModel;
2+
using System.Runtime.InteropServices;
3+
using Rubberduck.Resources.Registration;
4+
5+
// ReSharper disable InconsistentNaming
6+
// The parameters on RD's public interfaces are following VBA conventions not C# conventions to stop the
7+
// obnoxious "Can I haz all identifiers with the same casing" behavior of the VBE.
8+
9+
namespace Rubberduck.UnitTesting
10+
{
11+
[
12+
ComVisible(true),
13+
Guid(RubberduckGuid.ParamsChDirGuid),
14+
InterfaceType(ComInterfaceType.InterfaceIsDual),
15+
EditorBrowsable(EditorBrowsableState.Always),
16+
]
17+
public interface IChDirParams
18+
{
19+
/// <summary>
20+
/// Gets the name of the 'Path' parameter.
21+
/// </summary>
22+
[DispId(1)]
23+
[Description("Gets the name of the 'Path' parameter.")]
24+
string Path { get; }
25+
}
26+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System.ComponentModel;
2+
using System.Runtime.InteropServices;
3+
using Rubberduck.Resources.Registration;
4+
5+
// ReSharper disable InconsistentNaming
6+
// The parameters on RD's public interfaces are following VBA conventions not C# conventions to stop the
7+
// obnoxious "Can I haz all identifiers with the same casing" behavior of the VBE.
8+
9+
namespace Rubberduck.UnitTesting
10+
{
11+
[
12+
ComVisible(true),
13+
Guid(RubberduckGuid.ParamsChDriveGuid),
14+
InterfaceType(ComInterfaceType.InterfaceIsDual),
15+
EditorBrowsable(EditorBrowsableState.Always),
16+
]
17+
public interface IChDriveParams
18+
{
19+
/// <summary>
20+
/// Gets the name of the 'Drive' parameter.
21+
/// </summary>
22+
[DispId(1)]
23+
[Description("Gets the name of the 'Drive' parameter.")]
24+
string Drive { get; }
25+
}
26+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System.ComponentModel;
2+
using System.Runtime.InteropServices;
3+
using Rubberduck.Resources.Registration;
4+
5+
// ReSharper disable InconsistentNaming
6+
// The parameters on RD's public interfaces are following VBA conventions not C# conventions to stop the
7+
// obnoxious "Can I haz all identifiers with the same casing" behavior of the VBE.
8+
9+
namespace Rubberduck.UnitTesting
10+
{
11+
[
12+
ComVisible(true),
13+
Guid(RubberduckGuid.ParamsCurDirGuid),
14+
InterfaceType(ComInterfaceType.InterfaceIsDual),
15+
EditorBrowsable(EditorBrowsableState.Always),
16+
]
17+
public interface ICurDirParams
18+
{
19+
/// <summary>
20+
/// Gets the name of the 'Drive' optional parameter.
21+
/// </summary>
22+
[DispId(1)]
23+
[Description("Gets the name of the 'Drive' optional parameter.")]
24+
string Drive { get; }
25+
}
26+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
using System.ComponentModel;
2+
using System.Runtime.InteropServices;
3+
using Rubberduck.Resources.Registration;
4+
5+
// ReSharper disable InconsistentNaming
6+
// The parameters on RD's public interfaces are following VBA conventions not C# conventions to stop the
7+
// obnoxious "Can I haz all identifiers with the same casing" behavior of the VBE.
8+
9+
namespace Rubberduck.UnitTesting
10+
{
11+
[
12+
ComVisible(true),
13+
Guid(RubberduckGuid.ParamsDeleteSettingGuid),
14+
InterfaceType(ComInterfaceType.InterfaceIsDual),
15+
EditorBrowsable(EditorBrowsableState.Always),
16+
]
17+
public interface IDeleteSettingParams
18+
{
19+
/// <summary>
20+
/// Gets the name of the 'AppName' parameter.
21+
/// </summary>
22+
[DispId(1)]
23+
[Description("Gets the name of the 'AppName' parameter.")]
24+
string AppName { get; }
25+
26+
/// <summary>
27+
/// Gets the name of the 'Section' parameter.
28+
/// </summary>
29+
[DispId(2)]
30+
[Description("Gets the name of the 'Section' parameter.")]
31+
string Section { get; }
32+
33+
/// <summary>
34+
/// Gets the name of the 'Key' parameter.
35+
/// </summary>
36+
[DispId(3)]
37+
[Description("Gets the name of the 'Key' parameter.")]
38+
string Key { get; }
39+
}
40+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System.ComponentModel;
2+
using System.Runtime.InteropServices;
3+
using Rubberduck.Resources.Registration;
4+
5+
// ReSharper disable InconsistentNaming
6+
// The parameters on RD's public interfaces are following VBA conventions not C# conventions to stop the
7+
// obnoxious "Can I haz all identifiers with the same casing" behavior of the VBE.
8+
9+
namespace Rubberduck.UnitTesting
10+
{
11+
[
12+
ComVisible(true),
13+
Guid(RubberduckGuid.ParamsDirGuid),
14+
InterfaceType(ComInterfaceType.InterfaceIsDual),
15+
EditorBrowsable(EditorBrowsableState.Always),
16+
]
17+
public interface IDirParams
18+
{
19+
/// <summary>
20+
/// Gets the name of the 'PathName' optional parameter.
21+
/// </summary>
22+
[DispId(1)]
23+
[Description("Gets the name of the 'PathName' optional parameter.")]
24+
string PathName { get; }
25+
26+
/// <summary>
27+
/// Gets the name of the 'Attributes' optional parameter.
28+
/// </summary>
29+
[DispId(2)]
30+
[Description("Gets the name of the 'Attributes' optional parameter.")]
31+
string Attributes { get; }
32+
}
33+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System.ComponentModel;
2+
using System.Runtime.InteropServices;
3+
using Rubberduck.Resources.Registration;
4+
5+
// ReSharper disable InconsistentNaming
6+
// The parameters on RD's public interfaces are following VBA conventions not C# conventions to stop the
7+
// obnoxious "Can I haz all identifiers with the same casing" behavior of the VBE.
8+
9+
namespace Rubberduck.UnitTesting
10+
{
11+
[
12+
ComVisible(true),
13+
Guid(RubberduckGuid.ParamsEnvironGuid),
14+
InterfaceType(ComInterfaceType.InterfaceIsDual),
15+
EditorBrowsable(EditorBrowsableState.Always),
16+
]
17+
public interface IEnvironParams
18+
{
19+
/// <summary>
20+
/// Gets the name of the 'EnvString' optional parameter.
21+
/// </summary>
22+
[DispId(1)]
23+
[Description("Gets the name of the 'EnvString' optional parameter.")]
24+
string EnvString { get; }
25+
26+
/// <summary>
27+
/// Gets the name of the 'Number' optional parameter.
28+
/// </summary>
29+
[DispId(2)]
30+
[Description("Gets the name of the 'Number' optional parameter.")]
31+
string Number { get; }
32+
}
33+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System.ComponentModel;
2+
using System.Runtime.InteropServices;
3+
using Rubberduck.Resources.Registration;
4+
5+
// ReSharper disable InconsistentNaming
6+
// The parameters on RD's public interfaces are following VBA conventions not C# conventions to stop the
7+
// obnoxious "Can I haz all identifiers with the same casing" behavior of the VBE.
8+
9+
namespace Rubberduck.UnitTesting
10+
{
11+
[
12+
ComVisible(true),
13+
Guid(RubberduckGuid.ParamsFileCopyGuid),
14+
InterfaceType(ComInterfaceType.InterfaceIsDual),
15+
EditorBrowsable(EditorBrowsableState.Always),
16+
]
17+
public interface IFileCopyParams
18+
{
19+
/// <summary>
20+
/// Gets the name of the 'Source' parameter.
21+
/// </summary>
22+
[DispId(1)]
23+
[Description("Gets the name of the 'Source' parameter.")]
24+
string Source { get; }
25+
26+
/// <summary>
27+
/// Gets the name of the 'Destination' parameter.
28+
/// </summary>
29+
[DispId(2)]
30+
[Description("Gets the name of the 'Destination' parameter.")]
31+
string Destination { get; }
32+
}
33+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System.ComponentModel;
2+
using System.Runtime.InteropServices;
3+
using Rubberduck.Resources.Registration;
4+
5+
// ReSharper disable InconsistentNaming
6+
// The parameters on RD's public interfaces are following VBA conventions not C# conventions to stop the
7+
// obnoxious "Can I haz all identifiers with the same casing" behavior of the VBE.
8+
9+
namespace Rubberduck.UnitTesting
10+
{
11+
[
12+
ComVisible(true),
13+
Guid(RubberduckGuid.ParamsFileDateTimeGuid),
14+
InterfaceType(ComInterfaceType.InterfaceIsDual),
15+
EditorBrowsable(EditorBrowsableState.Always),
16+
]
17+
public interface IFileDateTimeParams
18+
{
19+
/// <summary>
20+
/// Gets the name of the 'PathName' parameter.
21+
/// </summary>
22+
[DispId(1)]
23+
[Description("Gets the name of the 'PathName' parameter.")]
24+
string PathName { get; }
25+
}
26+
}

0 commit comments

Comments
 (0)