diff --git a/access-add-in/AccUnitLoader.accda b/access-add-in/AccUnitLoader.accda index 445e9f9..8f65a24 100644 Binary files a/access-add-in/AccUnitLoader.accda and b/access-add-in/AccUnitLoader.accda differ diff --git a/access-add-in/source/modules/AccUnitLoaderConfigProcedures.bas b/access-add-in/source/modules/AccUnitLoaderConfigProcedures.bas index 5015c6d..795c815 100644 --- a/access-add-in/source/modules/AccUnitLoaderConfigProcedures.bas +++ b/access-add-in/source/modules/AccUnitLoaderConfigProcedures.bas @@ -146,7 +146,7 @@ Public Property Get AccUnitFileNames() As Variant() ACCUNIT_DLL_FILE, _ "AccessCodeLib.Common.Tools.dll", _ "AccessCodeLib.Common.VBIDETools.dll", _ - "AccessCodeLib.AccUnit.VbeAddIn.dll", _ + "AccUnit.VbeAddIn.dll", _ "AccessCodeLib.Common.VbeUserControlHost.dll") End Property diff --git a/access-add-in/source/modules/_config_Application.bas b/access-add-in/source/modules/_config_Application.bas index 9f5eace..d591020 100644 --- a/access-add-in/source/modules/_config_Application.bas +++ b/access-add-in/source/modules/_config_Application.bas @@ -18,7 +18,7 @@ Option Compare Text Option Explicit 'Version number -Private Const APPLICATION_VERSION As String = "0.9.800.240509" +Private Const APPLICATION_VERSION As String = "0.9.800.240510" Private Const APPLICATION_NAME As String = "ACLib AccUnit Loader" Private Const APPLICATION_FULLNAME As String = "Access Code Library - AccUnit Loader" diff --git a/access-add-in/source/vcs-options.json b/access-add-in/source/vcs-options.json index 47722c4..5ef655f 100644 --- a/access-add-in/source/vcs-options.json +++ b/access-add-in/source/vcs-options.json @@ -1,6 +1,6 @@ { "Info": { - "AddinVersion": "4.0.35-jp01", + "AddinVersion": "4.0.36-jp", "AccessVersion": "16.0 32-bit" }, "Options": { diff --git a/excel-add-in/AccUnitLoader.xlam b/excel-add-in/AccUnitLoader.xlam index 7280d2f..55900fb 100644 Binary files a/excel-add-in/AccUnitLoader.xlam and b/excel-add-in/AccUnitLoader.xlam differ diff --git a/excel-add-in/source/AccUnitLoaderConfigProcedures.bas b/excel-add-in/source/AccUnitLoaderConfigProcedures.bas index 9c02d03..56b6232 100644 --- a/excel-add-in/source/AccUnitLoaderConfigProcedures.bas +++ b/excel-add-in/source/AccUnitLoaderConfigProcedures.bas @@ -4,7 +4,7 @@ Option Compare Text Public Sub AddAccUnitTlbReference() RemoveAccUnitTlbReference - CurrentVbProject.References.AddFromFile CurrentAccUnitConfiguration.AccUnitDllPath & "\AccessCodeLib.AccUnit.tlb" + CurrentVbProject.References.AddFromFile CurrentAccUnitConfiguration.AccUnitDllPath & "\" & ACCUNIT_TYPELIB_FILE End Sub Public Sub RemoveAccUnitTlbReference() diff --git a/excel-add-in/source/AccUnitLoaderForm.frm b/excel-add-in/source/AccUnitLoaderForm.frm index 9d52711..1a034bb 100644 --- a/excel-add-in/source/AccUnitLoaderForm.frm +++ b/excel-add-in/source/AccUnitLoaderForm.frm @@ -261,7 +261,7 @@ Private Sub cmdSetAccUnitTlbReferenz_Click() On Error GoTo HandleErr AddAccUnitTlbReference - ShowSuccessInfo "AccUnit.tlb reference inserted" + ShowSuccessInfo ACCUNIT_TYPELIB_FILE & " reference inserted" ExitHere: Exit Sub @@ -277,7 +277,7 @@ Private Sub cmdRemoveAccUnitTlbReferenz_Click() On Error GoTo HandleErr RemoveAccUnitTlbReference - ShowSuccessInfo "AccUnit.tlb reference removed" + ShowSuccessInfo ACCUNIT_TYPELIB_FILE & " reference removed" ExitHere: Exit Sub diff --git a/excel-add-in/source/AccUnitLoaderForm.frx b/excel-add-in/source/AccUnitLoaderForm.frx index abefc9d..50fbb57 100644 Binary files a/excel-add-in/source/AccUnitLoaderForm.frx and b/excel-add-in/source/AccUnitLoaderForm.frx differ diff --git a/excel-add-in/source/AccUnitUserSettings.frx b/excel-add-in/source/AccUnitUserSettings.frx index 958e962..65df64a 100644 Binary files a/excel-add-in/source/AccUnitUserSettings.frx and b/excel-add-in/source/AccUnitUserSettings.frx differ diff --git a/excel-add-in/source/config_Application.bas b/excel-add-in/source/config_Application.bas index d48c583..780ee2f 100644 --- a/excel-add-in/source/config_Application.bas +++ b/excel-add-in/source/config_Application.bas @@ -19,14 +19,14 @@ Option Explicit Option Private Module 'Version number -Private Const APPLICATION_VERSION As String = "0.9.700.240403" +Private Const APPLICATION_VERSION As String = "0.9.900.2400512" Private Const APPLICATION_NAME As String = "ACLib AccUnit Loader" Private Const APPLICATION_FULLNAME As String = "Access Code Library - AccUnit Loader" Private Const APPLICATION_TITLE As String = APPLICATION_FULLNAME Private Const APPLICATION_ICONFILE As String = "ACLib.ico" -Public Const ACCUNIT_TYPELIB_FILE As String = "AccessCodeLib.AccUnit.tlb" -Public Const ACCUNIT_DLL_FILE As String = "AccessCodeLib.AccUnit.dll" +Public Const ACCUNIT_TYPELIB_FILE As String = "AccUnit.tlb" +Public Const ACCUNIT_DLL_FILE As String = "AccUnit.dll" Private Const APPLICATION_STARTFORMNAME As String = "AccUnitLoaderForm" @@ -39,7 +39,7 @@ Private m_Extensions As AppHandler_ExtensionCollection ' ' Konfigurationseinstellungen initialisieren ' -' Möglichkeit einer Referenzübergabe, damit nicht CurrentApplication genutzt werden muss +' Möglichkeit einer Referenzübergabe, damit nicht CurrentApplication genutzt werden muss ' ' ' diff --git a/excel-add-in/source/defGlobal_AccUnitLoader.bas b/excel-add-in/source/defGlobal_AccUnitLoader.bas index df950e5..4a748cb 100644 --- a/excel-add-in/source/defGlobal_AccUnitLoader.bas +++ b/excel-add-in/source/defGlobal_AccUnitLoader.bas @@ -78,7 +78,9 @@ Public Property Get AccUnitFileNames() As Variant() ACCUNIT_TYPELIB_FILE, _ ACCUNIT_DLL_FILE, _ "AccessCodeLib.Common.Tools.dll", _ - "AccessCodeLib.Common.VBIDETools.dll") + "AccessCodeLib.Common.VBIDETools.dll", _ + "AccUnit.VbeAddIn.dll", _ + "AccessCodeLib.Common.VbeUserControlHost.dll") End Property @@ -101,7 +103,7 @@ ExitHere: Exit Sub HandleErr: - If AccUnitFileName = "AccessCodeLib.AccUnit.tlb" Then + If AccUnitFileName = ACCUNIT_TYPELIB_FILE Then Resume Next End If Err.Raise Err.Number, Err.Source, Err.Description, Err.HelpFile, Err.HelpContext diff --git a/source/AccUnit/Properties/AssemblyInfo.cs b/source/AccUnit/Properties/AssemblyInfo.cs index 38fe72b..2ea2cd7 100644 --- a/source/AccUnit/Properties/AssemblyInfo.cs +++ b/source/AccUnit/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // indem Sie "*" wie unten gezeigt eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.9.8.0")] -[assembly: AssemblyFileVersion("0.9.8.0")] +[assembly: AssemblyVersion("0.9.9.0")] +[assembly: AssemblyFileVersion("0.9.9.0")] diff --git a/source/AccUnit/Tools/TestClassGenerator.cs b/source/AccUnit/Tools/TestClassGenerator.cs index 2aeef02..b665d2d 100644 --- a/source/AccUnit/Tools/TestClassGenerator.cs +++ b/source/AccUnit/Tools/TestClassGenerator.cs @@ -1,6 +1,7 @@ using AccessCodeLib.Common.VBIDETools; using Microsoft.Vbe.Interop; using System.Collections.Generic; +using System.Linq; namespace AccessCodeLib.AccUnit.Tools { @@ -28,7 +29,9 @@ public CodeModule NewTestClass(string CodeModuleToTest = null, return InsertTestMethods(testClassName, methods); } - private IEnumerable GetTestCodeModuleMemberFromCodeModule(string codeModuleToTest, string stateUnderTest = null, string expectedBehaviour = null) + private IEnumerable GetTestCodeModuleMemberFromCodeModule( + string codeModuleToTest, string stateUnderTest = null, string expectedBehaviour = null, + IEnumerable methodsUnderTestFilter = null) { var codeModule = new CodeModuleContainer(_vbProject).TryGetCodeModule(codeModuleToTest); if (codeModule is null) @@ -40,6 +43,11 @@ private IEnumerable GetTestCodeModuleMemberFromCodeModule(stri var members = codeModulueReader.Members; var publicMembers = members.FindAll(true); + if (methodsUnderTestFilter != null) + { + publicMembers = publicMembers.Where(m => methodsUnderTestFilter.Contains(m.Name)).ToList(); + } + var testCodeModuleMembers = new List(); foreach (var member in publicMembers) { @@ -94,6 +102,15 @@ public CodeModule InsertTestMethods(string testClass, IEnumerable methodsUnderTest, string stateUnderTest, string expectedBehaviour) + { + if (codeModuleToTest == null ) + return InsertTestMethods(testClass, methodsUnderTest, stateUnderTest, expectedBehaviour); + + var methods = GetTestCodeModuleMemberFromCodeModule(codeModuleToTest, stateUnderTest, expectedBehaviour, methodsUnderTest); + return InsertTestMethods(testClass, methods); + } + public CodeModule InsertTestMethods(string testClass, IEnumerable methodsUnderTest, string stateUnderTest, string expectedBehaviour) { var testCodeGenerator = new TestCodeGenerator(); diff --git a/vbe-add-In/AccUnit.VbeAddIn/CommitMethodNameEventArgs.cs b/vbe-add-In/AccUnit.VbeAddIn/CommitMethodNameEventArgs.cs index 5be096b..710b2ed 100644 --- a/vbe-add-In/AccUnit.VbeAddIn/CommitMethodNameEventArgs.cs +++ b/vbe-add-In/AccUnit.VbeAddIn/CommitMethodNameEventArgs.cs @@ -19,8 +19,9 @@ public CommitInsertTestMethodEventArgs(string methodUnderTest, string stateUnder public class CommitInsertTestMethodsEventArgs : EventArgs { - public CommitInsertTestMethodsEventArgs(string testClass, IEnumerable methodsUnderTest, string stateUnderTest, string expectedBehaviour) + public CommitInsertTestMethodsEventArgs(string codeModuleToTest, string testClass, IEnumerable methodsUnderTest, string stateUnderTest, string expectedBehaviour) { + CodeModuleToTest = codeModuleToTest; TestClass = testClass; MethodsUnderTest = methodsUnderTest; StateUnderTest = stateUnderTest; @@ -28,6 +29,7 @@ public CommitInsertTestMethodsEventArgs(string testClass, IEnumerable me Cancel = false; } + public string CodeModuleToTest { get; private set; } public string TestClass { get; private set; } public IEnumerable MethodsUnderTest { get; private set; } public string StateUnderTest { get; private set; } diff --git a/vbe-add-In/AccUnit.VbeAddIn/InsertTestMethod/GenerateTestMethodsFromCodeModuleViewModel.cs b/vbe-add-In/AccUnit.VbeAddIn/InsertTestMethod/GenerateTestMethodsFromCodeModuleViewModel.cs index b3af3e2..fce2c90 100644 --- a/vbe-add-In/AccUnit.VbeAddIn/InsertTestMethod/GenerateTestMethodsFromCodeModuleViewModel.cs +++ b/vbe-add-In/AccUnit.VbeAddIn/InsertTestMethod/GenerateTestMethodsFromCodeModuleViewModel.cs @@ -208,7 +208,7 @@ public IStringValueLabelControlSource MethodNameSyntax protected virtual void Commit() { InsertTestMethods?.Invoke(this, - new CommitInsertTestMethodsEventArgs(TestClassName.Value, MethodNamesToTest, StateTestNamePart.Value, ExpectedTestNamePart.Value)); + new CommitInsertTestMethodsEventArgs(CurrentCodeModule.Name, TestClassName.Value, MethodNamesToTest, StateTestNamePart.Value, ExpectedTestNamePart.Value)); } } } diff --git a/vbe-add-In/AccUnit.VbeAddIn/Properties/AssemblyInfo.cs b/vbe-add-In/AccUnit.VbeAddIn/Properties/AssemblyInfo.cs index f0af9f8..a57c307 100644 --- a/vbe-add-In/AccUnit.VbeAddIn/Properties/AssemblyInfo.cs +++ b/vbe-add-In/AccUnit.VbeAddIn/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // indem Sie "*" wie unten gezeigt eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.9.0.0")] -[assembly: AssemblyFileVersion("0.9.0.0")] +[assembly: AssemblyVersion("0.9.1.0")] +[assembly: AssemblyFileVersion("0.9.1.0")] diff --git a/vbe-add-In/AccUnit.VbeAddIn/VbeIntegrationManager.cs b/vbe-add-In/AccUnit.VbeAddIn/VbeIntegrationManager.cs index 53d436e..a911aea 100644 --- a/vbe-add-In/AccUnit.VbeAddIn/VbeIntegrationManager.cs +++ b/vbe-add-In/AccUnit.VbeAddIn/VbeIntegrationManager.cs @@ -370,7 +370,7 @@ private CodeModule InsertTestMethodsDialogCommitMethodName(object sender, Commit { using (new BlockLogger($"{e.TestClass}.{e.MethodsUnderTest}_{e.StateUnderTest}_{e.ExpectedBehaviour}")) { - return testClassGenerator.InsertTestMethods(e.TestClass, e.MethodsUnderTest, e.StateUnderTest, e.ExpectedBehaviour); + return testClassGenerator.InsertTestMethods(e.CodeModuleToTest, e.TestClass, e.MethodsUnderTest, e.StateUnderTest, e.ExpectedBehaviour); } } catch (Exception ex)