Skip to content

Commit

Permalink
Merge pull request #6060 from retailcoder/FakesUX
Browse files Browse the repository at this point in the history
Adds parameter string names provider to Fakes API
  • Loading branch information
retailcoder committed Dec 2, 2022
2 parents ea42d7f + f266216 commit 92a0bff
Show file tree
Hide file tree
Showing 50 changed files with 1,292 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,10 @@ public interface IFakesProvider
[DispId(31)]
[Description("Configures VBA.FileSystem.FileCopy calls.")]
IStub FileCopy { get; }


[DispId(255)]
[Description("Gets an interface exposing the parameter names for all parameterized fakes.")]
IParams Params { get; }
}
}
107 changes: 107 additions & 0 deletions Rubberduck.Main/ComClientLibrary/Abstract/UnitTesting/IParams.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
using System.ComponentModel;
using System.Runtime.InteropServices;
using Rubberduck.Resources.Registration;

// ReSharper disable InconsistentNaming
// The parameters on RD's public interfaces are following VBA conventions not C# conventions to stop the
// obnoxious "Can I haz all identifiers with the same casing" behavior of the VBE.

namespace Rubberduck.UnitTesting
{
[
ComVisible(true),
Guid(RubberduckGuid.IParamsGuid),
InterfaceType(ComInterfaceType.InterfaceIsDual),
EditorBrowsable(EditorBrowsableState.Always)
]
public interface IParams
{
[DispId(1)]
[Description("Gets an interface exposing the parameter names for the 'VBA.Interaction.MsgBox' function.")]
IMsgBoxParams MsgBox { get; }

[DispId(2)]
[Description("Gets an interface exposing the parameter names for the 'VBA.Interaction.InputBox' function.")]
IInputBoxParams InputBox { get; }

[DispId(3)]
[Description("Gets an interface exposing the parameter names for the 'VBA.Interaction.Environ' function.")]
IEnvironParams Environ { get; }

[DispId(4)]
[Description("Gets an interface exposing the parameter names for the 'VBA.Interaction.Shell' function.")]
IShellParams Shell { get; }

[DispId(5)]
[Description("Gets an interface exposing the parameter names for the 'VBA.Interaction.SendKeys' function.")]
ISendKeysParams SendKeys { get; }

[DispId(6)]
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.Kill' function.")]
IKillParams Kill { get; }

[DispId(7)]
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.FileCopy' statement.")]
IFileCopyParams FileCopy { get; }

[DispId(8)]
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.FreeFile' function.")]
IFreeFileParams FreeFile { get; }

[DispId(9)]
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.GetAttr' function.")]
IGetAttrParams GetAttr { get; }

[DispId(10)]
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.SetAttr' statement.")]
ISetAttrParams SetAttr { get; }

[DispId(11)]
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.FileLen' function.")]
IFileLenParams FileLen { get; }

[DispId(12)]
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.FileDateTime' function.")]
IFileDateTimeParams FileDateTime { get; }

[DispId(13)]
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.Dir' function.")]
IDirParams Dir { get; }

[DispId(14)]
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.CurDir' function.")]
ICurDirParams CurDir { get; }

[DispId(15)]
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.ChDir' statement.")]
IChDirParams ChDir { get; }

[DispId(16)]
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.ChDrive' statement.")]
IChDriveParams ChDrive { get; }

[DispId(17)]
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.MkDir' statement.")]
IMkDirParams MkDir { get; }

[DispId(18)]
[Description("Gets an interface exposing the parameter names for the 'VBA.FileSystem.RmDir' statement.")]
IRmDirParams RmDir { get; }

[DispId(19)]
[Description("Gets an interface exposing the parameter names for the 'VBA.Interaction.SaveSetting' statement.")]
ISaveSettingParams SaveSetting { get; }

[DispId(20)]
[Description("Gets an interface exposing the parameter names for the 'VBA.Interaction.DeleteSetting' statement.")]
IDeleteSettingParams DeleteSetting { get; }

[DispId(21)]
[Description("Gets an interface exposing the parameter names for the 'VBA.Math.Randomize' statement.")]
IRandomizeParams Randomize { get; }

[DispId(22)]
[Description("Gets an interface exposing the parameter names for the 'VBA.Math.Rnd' function.")]
IRndParams Rnd { get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System.ComponentModel;
using System.Runtime.InteropServices;
using Rubberduck.Resources.Registration;

// ReSharper disable InconsistentNaming
// The parameters on RD's public interfaces are following VBA conventions not C# conventions to stop the
// obnoxious "Can I haz all identifiers with the same casing" behavior of the VBE.

namespace Rubberduck.UnitTesting
{
[
ComVisible(true),
Guid(RubberduckGuid.ParamsChDirGuid),
InterfaceType(ComInterfaceType.InterfaceIsDual),
EditorBrowsable(EditorBrowsableState.Always),
]
public interface IChDirParams
{
/// <summary>
/// Gets the name of the 'Path' parameter.
/// </summary>
[DispId(1)]
[Description("Gets the name of the 'Path' parameter.")]
string Path { get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System.ComponentModel;
using System.Runtime.InteropServices;
using Rubberduck.Resources.Registration;

// ReSharper disable InconsistentNaming
// The parameters on RD's public interfaces are following VBA conventions not C# conventions to stop the
// obnoxious "Can I haz all identifiers with the same casing" behavior of the VBE.

namespace Rubberduck.UnitTesting
{
[
ComVisible(true),
Guid(RubberduckGuid.ParamsChDriveGuid),
InterfaceType(ComInterfaceType.InterfaceIsDual),
EditorBrowsable(EditorBrowsableState.Always),
]
public interface IChDriveParams
{
/// <summary>
/// Gets the name of the 'Drive' parameter.
/// </summary>
[DispId(1)]
[Description("Gets the name of the 'Drive' parameter.")]
string Drive { get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System.ComponentModel;
using System.Runtime.InteropServices;
using Rubberduck.Resources.Registration;

// ReSharper disable InconsistentNaming
// The parameters on RD's public interfaces are following VBA conventions not C# conventions to stop the
// obnoxious "Can I haz all identifiers with the same casing" behavior of the VBE.

namespace Rubberduck.UnitTesting
{
[
ComVisible(true),
Guid(RubberduckGuid.ParamsCurDirGuid),
InterfaceType(ComInterfaceType.InterfaceIsDual),
EditorBrowsable(EditorBrowsableState.Always),
]
public interface ICurDirParams
{
/// <summary>
/// Gets the name of the 'Drive' optional parameter.
/// </summary>
[DispId(1)]
[Description("Gets the name of the 'Drive' optional parameter.")]
string Drive { get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System.ComponentModel;
using System.Runtime.InteropServices;
using Rubberduck.Resources.Registration;

// ReSharper disable InconsistentNaming
// The parameters on RD's public interfaces are following VBA conventions not C# conventions to stop the
// obnoxious "Can I haz all identifiers with the same casing" behavior of the VBE.

namespace Rubberduck.UnitTesting
{
[
ComVisible(true),
Guid(RubberduckGuid.ParamsDeleteSettingGuid),
InterfaceType(ComInterfaceType.InterfaceIsDual),
EditorBrowsable(EditorBrowsableState.Always),
]
public interface IDeleteSettingParams
{
/// <summary>
/// Gets the name of the 'AppName' parameter.
/// </summary>
[DispId(1)]
[Description("Gets the name of the 'AppName' parameter.")]
string AppName { get; }

/// <summary>
/// Gets the name of the 'Section' parameter.
/// </summary>
[DispId(2)]
[Description("Gets the name of the 'Section' parameter.")]
string Section { get; }

/// <summary>
/// Gets the name of the 'Key' parameter.
/// </summary>
[DispId(3)]
[Description("Gets the name of the 'Key' parameter.")]
string Key { get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System.ComponentModel;
using System.Runtime.InteropServices;
using Rubberduck.Resources.Registration;

// ReSharper disable InconsistentNaming
// The parameters on RD's public interfaces are following VBA conventions not C# conventions to stop the
// obnoxious "Can I haz all identifiers with the same casing" behavior of the VBE.

namespace Rubberduck.UnitTesting
{
[
ComVisible(true),
Guid(RubberduckGuid.ParamsDirGuid),
InterfaceType(ComInterfaceType.InterfaceIsDual),
EditorBrowsable(EditorBrowsableState.Always),
]
public interface IDirParams
{
/// <summary>
/// Gets the name of the 'PathName' optional parameter.
/// </summary>
[DispId(1)]
[Description("Gets the name of the 'PathName' optional parameter.")]
string PathName { get; }

/// <summary>
/// Gets the name of the 'Attributes' optional parameter.
/// </summary>
[DispId(2)]
[Description("Gets the name of the 'Attributes' optional parameter.")]
string Attributes { get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System.ComponentModel;
using System.Runtime.InteropServices;
using Rubberduck.Resources.Registration;

// ReSharper disable InconsistentNaming
// The parameters on RD's public interfaces are following VBA conventions not C# conventions to stop the
// obnoxious "Can I haz all identifiers with the same casing" behavior of the VBE.

namespace Rubberduck.UnitTesting
{
[
ComVisible(true),
Guid(RubberduckGuid.ParamsEnvironGuid),
InterfaceType(ComInterfaceType.InterfaceIsDual),
EditorBrowsable(EditorBrowsableState.Always),
]
public interface IEnvironParams
{
/// <summary>
/// Gets the name of the 'EnvString' optional parameter.
/// </summary>
[DispId(1)]
[Description("Gets the name of the 'EnvString' optional parameter.")]
string EnvString { get; }

/// <summary>
/// Gets the name of the 'Number' optional parameter.
/// </summary>
[DispId(2)]
[Description("Gets the name of the 'Number' optional parameter.")]
string Number { get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System.ComponentModel;
using System.Runtime.InteropServices;
using Rubberduck.Resources.Registration;

// ReSharper disable InconsistentNaming
// The parameters on RD's public interfaces are following VBA conventions not C# conventions to stop the
// obnoxious "Can I haz all identifiers with the same casing" behavior of the VBE.

namespace Rubberduck.UnitTesting
{
[
ComVisible(true),
Guid(RubberduckGuid.ParamsFileCopyGuid),
InterfaceType(ComInterfaceType.InterfaceIsDual),
EditorBrowsable(EditorBrowsableState.Always),
]
public interface IFileCopyParams
{
/// <summary>
/// Gets the name of the 'Source' parameter.
/// </summary>
[DispId(1)]
[Description("Gets the name of the 'Source' parameter.")]
string Source { get; }

/// <summary>
/// Gets the name of the 'Destination' parameter.
/// </summary>
[DispId(2)]
[Description("Gets the name of the 'Destination' parameter.")]
string Destination { get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System.ComponentModel;
using System.Runtime.InteropServices;
using Rubberduck.Resources.Registration;

// ReSharper disable InconsistentNaming
// The parameters on RD's public interfaces are following VBA conventions not C# conventions to stop the
// obnoxious "Can I haz all identifiers with the same casing" behavior of the VBE.

namespace Rubberduck.UnitTesting
{
[
ComVisible(true),
Guid(RubberduckGuid.ParamsFileDateTimeGuid),
InterfaceType(ComInterfaceType.InterfaceIsDual),
EditorBrowsable(EditorBrowsableState.Always),
]
public interface IFileDateTimeParams
{
/// <summary>
/// Gets the name of the 'PathName' parameter.
/// </summary>
[DispId(1)]
[Description("Gets the name of the 'PathName' parameter.")]
string PathName { get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System.ComponentModel;
using System.Runtime.InteropServices;
using Rubberduck.Resources.Registration;

// ReSharper disable InconsistentNaming
// The parameters on RD's public interfaces are following VBA conventions not C# conventions to stop the
// obnoxious "Can I haz all identifiers with the same casing" behavior of the VBE.

namespace Rubberduck.UnitTesting
{
[
ComVisible(true),
Guid(RubberduckGuid.ParamsFileLenGuid),
InterfaceType(ComInterfaceType.InterfaceIsDual),
EditorBrowsable(EditorBrowsableState.Always),
]
public interface IFileLenParams
{
/// <summary>
/// Gets the name of the 'PathName' parameter.
/// </summary>
[DispId(1)]
[Description("Gets the name of the 'PathName' parameter.")]
string PathName { get; }
}
}
Loading

0 comments on commit 92a0bff

Please sign in to comment.