-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add Suite Grouping #27
Conversation
src/TestSuite.cls
Outdated
|
||
'' | ||
' (Optional) description of suite for display in runners | ||
' | ||
' @property Description | ||
' @type String | ||
'' | ||
Public Description As String | ||
Public Name As String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you think about keeping Description
as a property, for backwards compatibility.
Public Property Get Description() as String
Debug.Print "The Property ""Description"" has been deprecated. Use ""Name"" instead."
Description = Name
End Property
Public Property Let Description(NewDescription as String)
Debug.Print "The Property ""Description"" has been deprecated. Use ""Name"" instead."
Name = NewDescription
End Property
this would reduce the need to alter existing code for a semantic name change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I can't get blocks to build... |
The current test suite doesn't test I've tried altering the Tests.RunTests() a bit to wedge everything into a single test suite but can't seem to get the syntax right. so far, a couple different directions that seem logical but don't work: Public Function RunTests() As TestSuite
Dim wbr As New WorkbookReporter
wbr.ConnectTo ThisWorkbook.Sheets(1)
wbr.Start 1
wbr.Output NestedTests
wbr.Done
End Function
Private Function NestedTests() As TestSuite
Dim ts As New TestSuite
ts.Name = "RunTests"
Dim TCase As TestCase
With ts.Group("TestSuite Tests")
Dim TTS As TestSuite
Set TTS = Tests_TestSuite.Tests
For Each TCase In TTS.Tests
.Test(TCase.Name).Self = TCase
Next TCase
End With
With ts.Group("TestCase Tests")
Dim TTC As TestSuite
Set TTC = Tests_TestCase.Tests
For Each TCase In TTS.Tests
TCase .Test(TCase.Name)
Next TCase
End With
Set NestedTests = ts
End Function sorry! trying to be helpful and contribute. how can I get this tested before approving the PR? Thanks Tim! |
Temporarily removed WorkbookReporter, will add it back in a later PR |
The goal here is that reporters only take in a single
TestSuite
, but for added flexibilityTestSuite
can contain any number of arbitrarily nestedTestSuite
groups. This should simplify the API forWorkbookReporter
and allow different ways of defining tests.This allows for separating tests and suites among different functions / files.