Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassModules do not import to excel #18

Open
LightMike opened this issue Oct 28, 2023 · 3 comments
Open

ClassModules do not import to excel #18

LightMike opened this issue Oct 28, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@LightMike
Copy link

Hello Kevin.
I have problems importing the some of the class modules from the VBAUnitTester

As with the SQL classes I replaced LF with CR LF. But still classes like LoggerErrorHandlingTests.cls
(below) import as Module without name. Seems something is missing in the header section.

Thanks for your support.


`Implements iTestCase

Dim TestCase As iTestCase

' Constructor: Class_Initialize
' Initialize class members
Private Sub Class_Initialize()
Set TestCase = CreateTestCase()
End Sub

Sub iTestCase_Setup()
Dim SpecialTestCase As iTestCase
Set SpecialTestCase = New PostLogTests
SpecialTestCase.RunTest "ExpectExceptionSetupTest"
End Sub

Sub iTestCase_TearDown()

End Sub

' Function: iTestCase_GetObject
' Returns this object
Function iTestCase_GetObject()
Set iTestCase_GetObject = New LoggerErrorHandlingTests
End Function

'Function: ErrorCaughtTest
' Ensure that when an expected runtime error is generated it is not logged, and the test is still passing.
Sub ErrorCaughtTest()
Status = TestReporter.GetLastTestStatus
PassFail = Status(2)
TestReporter.RemoveLastTest
AssertEquals PassFail, "Passing", "Test should be passing because an expected error was generated. Status is " & PassFail
End Sub

' Sub: iTestCase_RunTest
' Run a specific test.
Public Sub iTestCase_RunTest(Test As String, Optional clsObj = Nothing)
TestCase.RunTest Test, Me
End Sub

' Sub: iTestCase_RunAllTests
' Run all tests.
Public Sub iTestCase_RunAllTests(Optional ByVal clsObj = Nothing)
TestCase.RunAllTests Me
End Sub`

@Beakerboy
Copy link
Owner

Thanks. Did you notice that any files have the wrong line endings? You’re probably right about the header. I often get in the habit of just copying the code into already existing classModules so I skip this step.

@Beakerboy
Copy link
Owner

If you are familiar with git or using GitHub, feel free to submit pull requests for any issues you discover. I’m also happy to discuss how to make this project easier to use from a developer or just “plan user” perspective. I’m not the world’s greatest VBA coder.

@Beakerboy Beakerboy added the bug Something isn't working label Oct 28, 2023
@Beakerboy
Copy link
Owner

Beakerboy commented Oct 28, 2023

I created a new issue branch called “file_headers”. Please let me know if those modifications address your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants