Skip to content

Commit

Permalink
Take into account New normalized modules
Browse files Browse the repository at this point in the history
- only typographic changes
  • Loading branch information
Jean-Pierre Imbert committed Jan 16, 2015
1 parent d9c74e6 commit 82fb253
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Source/ConfTest/vtKImportExportUtilitiesTester.cls
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ End Sub

Public Sub TestNumberOfVBAUnitModules()
' Verify the correct number of VBAUnit Modules in the list
mAssert.Equals vtkVBAUnitModulesList.count, 18, "There are 18 VBAUnit Modules"
mAssert.Equals vtkVBAUnitModulesList.Count, 18, "There are 18 VBAUnit Modules"
End Sub

Public Sub TestVBAUnitMainIsTheFirstVBAUnitModule()
Expand Down
2 changes: 1 addition & 1 deletion Source/ConfTest/vtkConfManagerExcel11Tester.cls
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Private Const workbookNameWithConfigurationV10 As String = "WorkBookForConfigura
Private Sub SaveThenReOpenNewWorkbook()
' Utility Function for saving then re-open the new workbook and re-initialize the configuration managers
Dim savedNewWorkbookPath As String
savedNewWorkbookPath = newWorkbook.FullName
savedNewWorkbookPath = newWorkbook.fullName
' If newWorkbook.path = "" Then
' newWorkbook.Close SaveChanges:=True, Filename:=savedNewWorkbookPath
' Else
Expand Down
4 changes: 2 additions & 2 deletions Source/ConfTest/vtkConfManagerExcel12Tester.cls
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Private Const workbookNameWithConfigurationV11 As String = "WorkBookForConfigura
Private Sub SaveThenReOpenNewWorkbook()
' Utility Function for saving then re-open the new workbook and re-initialize the configuration managers
Dim savedNewWorkbookPath As String
savedNewWorkbookPath = newWorkbook.FullName
savedNewWorkbookPath = newWorkbook.fullName
' If newWorkbook.path = "" Then
' newWorkbook.Close SaveChanges:=True, Filename:=savedNewWorkbookPath
' Else
Expand Down Expand Up @@ -128,7 +128,7 @@ Public Sub TestConfigurationSheetDoesntExistInNewWorkbook()
' using a fresh configuration Manager (with no default sheet initialized)
Dim cm As New vtkConfigurationManagerExcel, Wb As Workbook, wbFullName As String
Set Wb = vtkCreateExcelWorkbookForTestWithProjectName("NewWorkbook") ' create a fresh new Excel workbook
wbFullName = Wb.FullName
wbFullName = Wb.fullName
mAssert.Should Not cm.isConfigurationInitializedForWorkbook(ExcelName:=Wb.name), "The Configuration sheet must not exist in new workbook"
Wb.Close saveChanges:=False
Kill PathName:=wbFullName
Expand Down
6 changes: 3 additions & 3 deletions Source/ConfTest/vtkInitializeVbaUnitTester.cls
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Option Explicit
Implements ITest
Implements ITestCase

Private newWorkBook As Workbook
Private newWorkbook As Workbook
Private Const projectName As String = "NewProject"
Private newConfManager As vtkConfigurationManager

Expand All @@ -54,12 +54,12 @@ End Property

Private Sub ITestCase_SetUp(Assert As IAssert)
Set mAssert = Assert
Set newWorkBook = vtkCreateExcelWorkbookForTestWithProjectName(projectName) ' create an Excel project for tests
Set newWorkbook = vtkCreateExcelWorkbookForTestWithProjectName(projectName) ' create an Excel project for tests
Set newConfManager = vtkConfigurationManagerForProject(projectName)
End Sub

Private Sub ITestCase_TearDown()
vtkCloseAndKillWorkbook Wb:=newWorkBook ' close the new Excel project
vtkCloseAndKillWorkbook Wb:=newWorkbook ' close the new Excel project
vtkResetConfigurationManagers ' reset all configuration managers
End Sub

Expand Down
8 changes: 4 additions & 4 deletions Source/ConfTest/vtkModuleTester.cls
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Public Sub Test_ModuleCollection_Count()
' This test verifies the count of modules collection property of Configuration Management
' just initialized from an Excel worlbook

mAssert.Equals confManager.modules.count, 4, "Number of modules in the Test workbook"
mAssert.Equals confManager.modules.Count, 4, "Number of modules in the Test workbook"
End Sub

Public Sub Test_AddedConfigurationCollection_Count()
Expand All @@ -81,7 +81,7 @@ Public Sub Test_AddedConfigurationCollection_Count()

confManager.addModule ("NewModule")

mAssert.Equals confManager.modules.count, 5, "Number of modules in the Test workbook with added module"
mAssert.Equals confManager.modules.Count, 5, "Number of modules in the Test workbook with added module"
End Sub

Public Sub Test_ModuleCollection_Parent()
Expand Down Expand Up @@ -115,7 +115,7 @@ Public Sub Test_ModuleCollection_ID()
' collection just initialized from an Excel worlbook
Dim i As Integer
For i = 1 To 4
mAssert.Equals confManager.modules(i).ID, "m" & i, "Expected ID for module " & i
mAssert.Equals confManager.modules(i).id, "m" & i, "Expected ID for module " & i
Next i
End Sub

Expand All @@ -137,7 +137,7 @@ Public Sub Test_AddedModuleCollection_ID()
confManager.addModule ("NewConfiguration")
Dim i As Integer
For i = 1 To 5
mAssert.Equals confManager.modules(i).ID, "m" & i, "Expected ID of vtkModule " & i
mAssert.Equals confManager.modules(i).id, "m" & i, "Expected ID of vtkModule " & i
Next i
End Sub

Expand Down
2 changes: 1 addition & 1 deletion Source/ConfTest/vtkNormalizeTester.cls
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ Public Sub Test_vtkNormalizeFile_onlyOneFileInFolder()

vtkNormalizeFile dummyFile, getListOfIdentifiersToNormalize

mAssert.Equals fso.GetFolder(VBAToolKit.vtkTestPath).Files.count, 1, _
mAssert.Equals fso.GetFolder(VBAToolKit.vtkTestPath).Files.Count, 1, _
"There must only be one file in the directory, no tmp file or old file."

On Error GoTo 0
Expand Down
16 changes: 8 additions & 8 deletions Source/ConfTest/vtkReferenceManagerTester.cls
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Private existingRefManager As vtkReferenceManager ' Reference Manager for the
Private Sub SaveThenReOpenNewWorkbook()
' Utility Function for saving then re-open the new workbook and re-initialize the reference manager
Dim savedNewWorkbookPath As String
savedNewWorkbookPath = newWorkbook.FullName
savedNewWorkbookPath = newWorkbook.fullName
newWorkbook.Close saveChanges:=True
Set newWorkbook = Workbooks.Open(fileName:=savedNewWorkbookPath)
Set newRefManager = New vtkReferenceManager
Expand Down Expand Up @@ -213,7 +213,7 @@ Public Sub TestAddConfiguration()
mAssert.Equals ws.Range("E1"), existingWorkbook.VBProject.name & "_DEV", "Expected Title for DEV project column"
mAssert.Equals ws.Range("F1"), "NewConfiguration", "Expected Title for the new configuration column"

mAssert.Equals existingRefManager.references(3).count, 0, "Number of references attached to the new configuration"
mAssert.Equals existingRefManager.references(3).Count, 0, "Number of references attached to the new configuration"

Set confManager = Nothing

Expand Down Expand Up @@ -349,7 +349,7 @@ Public Sub TestGetReferencesFromNewWorkbook()

' Test references for the main configuration (#1)
Set c = newRefManager.references(1)
mAssert.Equals c.count, 10, "Reference count for the main configuration"
mAssert.Equals c.Count, 10, "Reference count for the main configuration"
mAssert.Equals c(1).name, "VBA", "Reference for the main configuration"
mAssert.Equals c(2).name, "Excel", "Reference for the main configuration"
mAssert.Equals c(3).name, "stdole", "Reference for the main configuration"
Expand All @@ -363,7 +363,7 @@ Public Sub TestGetReferencesFromNewWorkbook()

' Test references for the development configuration (#2)
Set c = newRefManager.references(2)
mAssert.Equals c.count, 11, "Reference count for the development configuration"
mAssert.Equals c.Count, 11, "Reference count for the development configuration"
mAssert.Equals c(1).name, "VBA", "Reference for the development configuration"
mAssert.Equals c(2).name, "Excel", "Reference for the development configuration"
mAssert.Equals c(3).name, "stdole", "Reference for the development configuration"
Expand Down Expand Up @@ -411,7 +411,7 @@ Public Sub TestGetReferencesWithNullDevConf()

' Test references for the main configuration (#1)
Set c = newRefManager.references(1)
mAssert.Equals c.count, 10, "Reference count for the main configuration"
mAssert.Equals c.Count, 10, "Reference count for the main configuration"
mAssert.Equals c(1).name, "VBA", "Reference for the main configuration"
mAssert.Equals c(2).name, "Excel", "Reference for the main configuration"
mAssert.Equals c(3).name, "stdole", "Reference for the main configuration"
Expand All @@ -425,7 +425,7 @@ Public Sub TestGetReferencesWithNullDevConf()

' Test references for the development configuration (#2)
Set c = newRefManager.references(2)
mAssert.Equals c.count, 10, "Reference count for the development configuration"
mAssert.Equals c.Count, 10, "Reference count for the development configuration"
mAssert.Equals c(1).name, "VBA", "Reference for the development configuration"
mAssert.Equals c(2).name, "Excel", "Reference for the development configuration"
mAssert.Equals c(3).name, "stdole", "Reference for the development configuration"
Expand Down Expand Up @@ -457,11 +457,11 @@ Public Sub TestGetReferencesWithNoDevConf()

' Test references for the main configuration (#1)
Set c = newRefManager.references(1)
mAssert.Equals c.count, 0, "Reference count for the main configuration"
mAssert.Equals c.Count, 0, "Reference count for the main configuration"

' Test references for the development configuration (#2)
Set c = newRefManager.references(2)
mAssert.Equals c.count, 0, "Reference count for the development configuration"
mAssert.Equals c.Count, 0, "Reference count for the development configuration"

On Error GoTo 0
Exit Sub
Expand Down
4 changes: 2 additions & 2 deletions Source/ConfTest/vtkTestUtilitiesTester.cls
Original file line number Diff line number Diff line change
Expand Up @@ -523,8 +523,8 @@ Private Sub assertTestFolderIsEmpty(mAssert As IAssert)
Dim fso As New FileSystemObject, folderTest As Folder
Set folderTest = fso.GetFolder(VBAToolKit.vtkTestPath)

mAssert.Equals folderTest.Files.count, 0, "All files hasn't been deleted"
mAssert.Equals folderTest.SubFolders.count, 0, "All folders hasn't been deleted"
mAssert.Equals folderTest.Files.Count, 0, "All files hasn't been deleted"
mAssert.Equals folderTest.SubFolders.Count, 0, "All folders hasn't been deleted"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : Test_vtkResetTestFolder_OneFile
Expand Down
10 changes: 5 additions & 5 deletions Source/VbaUnit/TestClassLister.cls
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ Attribute VB_Exposed = False
Option Explicit

Public Function TestClasses() As Collection
Dim Components As VBComponents, Component As VBComponent
Dim Components As VBComponents, component As VBComponent
Set TestClasses = New Collection
Set Components = Application.VBE.ActiveVBProject.VBComponents
For Each Component In Components
If IsClassModule(Component.Type) And IsTestClassName(Component.name) Then
TestClasses.Add Component.name
For Each component In Components
If IsClassModule(component.Type) And IsTestClassName(component.name) Then
TestClasses.Add component.name
End If
Next
End Function
Expand Down Expand Up @@ -43,6 +43,7 @@ Public Function SelectTestClass(TestClassName As String) As ITest
Case "vtkWorkbookIsOpenTester": Set SelectTestClass = New vtkWorkbookIsOpenTester
Case "vtkConfManagerExcel10Tester": Set SelectTestClass = New vtkConfManagerExcel10Tester
Case "vtkConfManagerExcel11Tester": Set SelectTestClass = New vtkConfManagerExcel11Tester
Case "vtkConfManagerExcel12Tester": Set SelectTestClass = New vtkConfManagerExcel12Tester
Case "vtkConfigurationManagersTester": Set SelectTestClass = New vtkConfigurationManagersTester
Case "vtkProjectsTester": Set SelectTestClass = New vtkProjectsTester
Case "vtkProjectTester": Set SelectTestClass = New vtkProjectTester
Expand All @@ -64,7 +65,6 @@ Public Function SelectTestClass(TestClassName As String) As ITest
Case "vtkReferenceManagerTester": Set SelectTestClass = New vtkReferenceManagerTester
Case "vtkConfManagerXML20Tester": Set SelectTestClass = New vtkConfManagerXML20Tester
Case "vtkRecreateConfXMLTester": Set SelectTestClass = New vtkRecreateConfXMLTester
Case "vtkConfManagerExcel12Tester": Set SelectTestClass = New vtkConfManagerExcel12Tester
Case Else:
End Select
End Function

0 comments on commit 82fb253

Please sign in to comment.