Skip to content

Commit 21d0d91

Browse files
authored
Fix: export test components with test classes (#51)
* * Export Test Classes: + option to include TestComponents
1 parent de398f8 commit 21d0d91

File tree

6 files changed

+16
-7
lines changed

6 files changed

+16
-7
lines changed

access-add-in/AccUnitLoader.accda

0 Bytes
Binary file not shown.

access-add-in/source/vcs-options.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"Info": {
3-
"AddinVersion": "4.0.34",
3+
"AddinVersion": "4.0.35",
44
"AccessVersion": "16.0 32-bit"
55
},
66
"Options": {

excel-add-in/AccUnitLoader.xlam

-518 Bytes
Binary file not shown.

source/AccUnit/Configuration/Configurator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public interface IConfigurator
1818
void RemoveTestEnvironment(bool RemoveTestModules = false, bool ExportModulesBeforeRemoving = true, [MarshalAs(UnmanagedType.IDispatch)] object VBProject = null);
1919
void InsertAccUnitLoaderFactoryModule(bool UseAccUnitTypeLib, bool RemoveIfExists = false, [MarshalAs(UnmanagedType.IDispatch)] object VBProject = null, object HostApplication = null);
2020
void RemoveAccUnitLoaderFactoryModule([MarshalAs(UnmanagedType.IDispatch)] object VBProject = null);
21-
void ExportTestClasses(string ExportPath = null, [MarshalAs(UnmanagedType.IDispatch)] object VBProject = null);
21+
void ExportTestClasses(string ExportPath = null, [MarshalAs(UnmanagedType.IDispatch)] object VBProject = null, bool ExportTestComponents = true);
2222
void ImportTestClasses(string FileNameFilter = null, string ImportPath = null, [MarshalAs(UnmanagedType.IDispatch)] object VBProject = null);
2323

2424
IUserSettings UserSettings { get; }
@@ -127,15 +127,15 @@ private void RemoveAccUnitTlbReference()
127127
}
128128
}
129129

130-
public void ExportTestClasses(string exportPath = null, object vbProject = null)
130+
public void ExportTestClasses(string exportPath = null, object vbProject = null, bool exportTestComponents = true)
131131
{
132132
if (vbProject != null)
133133
_vbProject = (VBProject)vbProject;
134134

135135
OfficeApplicationHelper officeApplicationHelper = new VBProjectOnlyApplicatonHelper(_vbProject);
136136
using (var testClassManager = new TestClassManager(officeApplicationHelper))
137137
{
138-
testClassManager.ExportTestClasses(exportPath);
138+
testClassManager.ExportTestClasses(exportPath, exportTestComponents);
139139
}
140140
}
141141

source/AccUnit/Configuration/TestClassManager.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ private static OfficeObjectInfo GetObjectInfo(string name)
148148
}
149149
}
150150

151-
public void ExportTestClasses(string exportDirectory = null)
151+
public void ExportTestClasses(string exportDirectory = null, bool exportTestComponents = false)
152152
{
153153
if (exportDirectory is null)
154154
{
@@ -160,6 +160,15 @@ public void ExportTestClasses(string exportDirectory = null)
160160
{
161161
ExportTestClass(testClassInfo.Name, exportDirectory);
162162
}
163+
164+
if (exportTestComponents)
165+
{
166+
var components = new TestClassReader(ActiveVBProject).GetTestComponents();
167+
foreach (var c in components)
168+
{
169+
ExportTestClass(c.Name, exportDirectory);
170+
}
171+
}
163172
}
164173

165174
public void DeleteFactoryCodeModule()

source/AccUnit/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
3232
// indem Sie "*" wie unten gezeigt eingeben:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("0.9.4.0")]
35-
[assembly: AssemblyFileVersion("0.9.4.0")]
34+
[assembly: AssemblyVersion("0.9.5.0")]
35+
[assembly: AssemblyFileVersion("0.9.5.0")]

0 commit comments

Comments
 (0)