Skip to content

Commit 017745a

Browse files
authored
Code review refactoring (#55)
* Code clean up * Refactor AccUnit interface: use dependency injection for TestRunner, TestBuilder,... in TestSuites * new AccUnit TestSuite interface
1 parent bc37507 commit 017745a

File tree

68 files changed

+583
-723
lines changed

Some content is hidden

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

68 files changed

+583
-723
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
/access-add-in/Tests
1111
*.laccdb
1212
/excel-add-in/lib
13+
*.zip

access-add-in/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ vcs-index.json
1717
# Ignore any dotenv files (used for external database connections)
1818
*.env
1919

20+
# test folder, ...
21+
LocalTest*

access-add-in/AccUnitLoader.accda

-8 KB
Binary file not shown.

access-add-in/source/dbs-properties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
"Type": 4
102102
},
103103
"NavPane Width": {
104-
"Value": 514,
104+
"Value": 558,
105105
"Type": 4
106106
},
107107
"Never Cache": {

access-add-in/source/forms/AccUnitLoaderForm.bas

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ Begin Form
1717
Width =10604
1818
DatasheetFontHeight =11
1919
ItemSuffix =128
20-
Left =4748
21-
Top =3563
22-
Right =20888
23-
Bottom =12773
20+
Left =3713
21+
Top =3915
22+
Right =20010
23+
Bottom =12750
2424
OnUnload ="[Event Procedure]"
2525
RecSrcDt = Begin
2626
0x212b6fd80e9ce340

access-add-in/source/forms/AccUnitLoaderForm.cls

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ Private Sub cmdClose_Click()
3434
DoCmd.Close acForm, Me.Name
3535
End Sub
3636

37-
Private Property Get CurrentAccUnitDllPath() As String
38-
CurrentAccUnitDllPath = Me.txtAccUnitDllPath.Value
39-
End Property
40-
4137
Private Sub cmdExportAccUnitFiles_Click()
4238

4339
On Error GoTo HandleErr

access-add-in/source/forms/AccUnitUserSettings.bas

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ Begin Form
114114
OverlapFlags =85
115115
TextAlign =1
116116
IMESentenceMode =3
117-
Left =2318
117+
Left =2310
118118
Top =90
119-
Width =9072
119+
Width =9075
120120
Height =405
121121
TabIndex =1
122122
Name ="txtTestClassNameFormat"
@@ -125,9 +125,9 @@ Begin Form
125125
HorizontalAnchor =2
126126
ShowDatePicker =0
127127

128-
LayoutCachedLeft =2318
128+
LayoutCachedLeft =2310
129129
LayoutCachedTop =90
130-
LayoutCachedWidth =11390
130+
LayoutCachedWidth =11385
131131
LayoutCachedHeight =495
132132
ColumnStart =1
133133
ColumnEnd =1
@@ -163,9 +163,9 @@ Begin Form
163163
OverlapFlags =85
164164
TextAlign =1
165165
IMESentenceMode =3
166-
Left =2318
167-
Top =683
168-
Width =9072
166+
Left =2310
167+
Top =675
168+
Width =9075
169169
Height =405
170170
TabIndex =2
171171
Name ="txtImportExportFolder"
@@ -174,10 +174,10 @@ Begin Form
174174
HorizontalAnchor =2
175175
ShowDatePicker =0
176176

177-
LayoutCachedLeft =2318
178-
LayoutCachedTop =683
179-
LayoutCachedWidth =11390
180-
LayoutCachedHeight =1088
177+
LayoutCachedLeft =2310
178+
LayoutCachedTop =675
179+
LayoutCachedWidth =11385
180+
LayoutCachedHeight =1080
181181
RowStart =1
182182
RowEnd =1
183183
ColumnStart =1
@@ -191,7 +191,7 @@ Begin Form
191191
OverlapFlags =85
192192
TextAlign =1
193193
Left =120
194-
Top =683
194+
Top =675
195195
Width =2161
196196
Height =405
197197
Name ="Label130"
@@ -200,9 +200,9 @@ Begin Form
200200
RightPadding =0
201201
BottomPadding =150
202202
LayoutCachedLeft =120
203-
LayoutCachedTop =683
203+
LayoutCachedTop =675
204204
LayoutCachedWidth =2281
205-
LayoutCachedHeight =1088
205+
LayoutCachedHeight =1080
206206
RowStart =1
207207
RowEnd =1
208208
LayoutGroup =1
@@ -216,9 +216,9 @@ Begin Form
216216
OverlapFlags =85
217217
TextAlign =1
218218
IMESentenceMode =3
219-
Left =2318
220-
Top =1275
221-
Width =9072
219+
Left =2310
220+
Top =1260
221+
Width =9075
222222
Height =405
223223
TabIndex =3
224224
Name ="txtTemplateFolder"
@@ -227,10 +227,10 @@ Begin Form
227227
HorizontalAnchor =2
228228
ShowDatePicker =0
229229

230-
LayoutCachedLeft =2318
231-
LayoutCachedTop =1275
232-
LayoutCachedWidth =11390
233-
LayoutCachedHeight =1680
230+
LayoutCachedLeft =2310
231+
LayoutCachedTop =1260
232+
LayoutCachedWidth =11385
233+
LayoutCachedHeight =1665
234234
RowStart =2
235235
RowEnd =2
236236
ColumnStart =1
@@ -244,7 +244,7 @@ Begin Form
244244
OverlapFlags =85
245245
TextAlign =1
246246
Left =120
247-
Top =1275
247+
Top =1260
248248
Width =2161
249249
Height =405
250250
Name ="Label132"
@@ -253,9 +253,9 @@ Begin Form
253253
RightPadding =0
254254
BottomPadding =150
255255
LayoutCachedLeft =120
256-
LayoutCachedTop =1275
256+
LayoutCachedTop =1260
257257
LayoutCachedWidth =2281
258-
LayoutCachedHeight =1680
258+
LayoutCachedHeight =1665
259259
RowStart =2
260260
RowEnd =2
261261
LayoutGroup =1
@@ -270,9 +270,9 @@ Begin Form
270270
TextAlign =1
271271
TextFontFamily =49
272272
IMESentenceMode =3
273-
Left =2318
274-
Top =1868
275-
Width =9072
273+
Left =2310
274+
Top =1845
275+
Width =9075
276276
Height =2835
277277
FontSize =10
278278
TabIndex =5
@@ -284,10 +284,10 @@ Begin Form
284284
VerticalAnchor =2
285285
ShowDatePicker =0
286286

287-
LayoutCachedLeft =2318
288-
LayoutCachedTop =1868
289-
LayoutCachedWidth =11390
290-
LayoutCachedHeight =4703
287+
LayoutCachedLeft =2310
288+
LayoutCachedTop =1845
289+
LayoutCachedWidth =11385
290+
LayoutCachedHeight =4680
291291
RowStart =3
292292
RowEnd =3
293293
ColumnStart =1
@@ -301,7 +301,7 @@ Begin Form
301301
OverlapFlags =85
302302
TextAlign =1
303303
Left =120
304-
Top =1868
304+
Top =1845
305305
Width =2161
306306
Height =2835
307307
Name ="Label134"
@@ -311,9 +311,9 @@ Begin Form
311311
BottomPadding =0
312312
VerticalAnchor =2
313313
LayoutCachedLeft =120
314-
LayoutCachedTop =1868
314+
LayoutCachedTop =1845
315315
LayoutCachedWidth =2281
316-
LayoutCachedHeight =4703
316+
LayoutCachedHeight =4680
317317
RowStart =3
318318
RowEnd =3
319319
LayoutGroup =1

access-add-in/source/modules/ACLibConfiguration.cls

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ Friend Function GetACLibGlobalProperty(ByRef PropertyName As String) As String
260260

261261
End Function
262262

263-
Friend Function SetACLibGlobalProperty(ByRef PropertyName As String, ByRef NewValue As String) As String
263+
Friend Sub SetACLibGlobalProperty(ByRef PropertyName As String, ByRef NewValue As String)
264264

265265
Dim rst As DAO.Recordset
266266
Dim SelectSql As String
@@ -277,7 +277,7 @@ Friend Function SetACLibGlobalProperty(ByRef PropertyName As String, ByRef NewVa
277277
rst.Update
278278
rst.Close
279279

280-
End Function
280+
End Sub
281281

282282
Private Property Get ACLibPropertyDb() As DAO.Database
283283

access-add-in/source/modules/AccUnitConfiguration.cls

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,15 @@ Attribute VB_Description = "Konfigurationseinstellungen der CodeLib verwalten"
1818
Option Compare Text
1919
Option Explicit
2020

21-
Private m_DaoSqlTools As SqlTools
22-
2321
#Const ADODB_EARLYBINDING = 0
24-
'ADODB wird hier über Late binding eingesetzt, da es nur zum Erstellen der Tabelle genutzt wird
25-
26-
Private m_ACLibConfig As ACLibConfiguration
22+
'ADODB is used here via late binding, as it is only used to create the table
2723

2824
' Base config
2925
Private Const PROPNAME_ACCUNITDLLPATH As String = "AccUnitDllPath"
3026

31-
' Hilfsvariablen
32-
Private m_AccUnitDllPath As String ' allg. Repository-Verzeichnis
33-
Private m_PrivateRepositoryPath As String ' privates Verzeichnis (nicht in CodeLib enthalten)
34-
Private m_ImportTestDefaultValue As Long
35-
Private m_ACLibPropertyDb As DAO.Database
27+
' Auxiliary variables
28+
Private m_AccUnitDllPath As String
29+
Private m_ACLibConfig As ACLibConfiguration
3630

3731
Public Property Get ACLibConfig() As ACLibConfiguration
3832
If m_ACLibConfig Is Nothing Then

access-add-in/source/modules/AccUnitLoaderConfigProcedures.bas

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,25 +151,24 @@ End Property
151151

152152
Public Sub ExportAccUnitFiles()
153153

154-
Dim accFileName As Variant
155-
Dim sBit As String
154+
Dim AccUnitFileName As Variant
156155
Dim DllPath As String
157156

158157
On Error GoTo HandleErr
159158

160159
DllPath = CurrentAccUnitConfiguration.AccUnitDllPath
161160

162161
With modApplication.CurrentApplication.Extensions("AppFile")
163-
For Each accFileName In AccUnitFileNames
164-
.CreateAppFile accFileName, DllPath & accFileName
162+
For Each AccUnitFileName In AccUnitFileNames
163+
.CreateAppFile AccUnitFileName, DllPath & AccUnitFileName
165164
Next
166165
End With
167166

168167
ExitHere:
169168
Exit Sub
170169

171170
HandleErr:
172-
If accFileName = "AccessCodeLib.AccUnit.tlb" Then
171+
If AccUnitFileName = "AccessCodeLib.AccUnit.tlb" Then
173172
Resume Next
174173
End If
175174
Err.Raise Err.Number, Err.Source, Err.Description, Err.HelpFile, Err.HelpContext
@@ -178,14 +177,14 @@ End Sub
178177

179178
Public Sub ImportAccUnitFiles()
180179

181-
Dim accFileName As Variant
180+
Dim AccFileName As Variant
182181
Dim DllPath As String
183182

184183
DllPath = CurrentAccUnitConfiguration.AccUnitDllPath
185184

186185
With modApplication.CurrentApplication.Extensions("AppFile")
187-
For Each accFileName In AccUnitFileNames
188-
.SaveAppFile accFileName, DllPath & accFileName, True
186+
For Each AccFileName In AccUnitFileNames
187+
.SaveAppFile AccFileName, DllPath & AccFileName, True
189188
Next
190189
End With
191190

0 commit comments

Comments
 (0)