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

Update Workbook proxy #6

Open
timhall opened this issue Jan 11, 2015 · 1 comment
Open

Update Workbook proxy #6

timhall opened this issue Jan 11, 2015 · 1 comment

Comments

@timhall
Copy link
Member

timhall commented Jan 11, 2015

Tasks:

  • Add AfterEach to teardown workbook after each test
  • Add instance to BeforeEach and AfterEach methods to allow passing in workbook helper instance
  • Separate from core into extensions (WBProxy and Scenario)
  • Use copy of workbook in case it's already open or unexpected things happen
  • Explore using standard WBProxy in other IWBProxy implementations. (lots of overlap currently)

BeforeEach and AfterEach goal:

Dim Proxy As New WBProxy
' Initial setup/mapping...

Suite.BeforeEach "Setup", Instance:=Proxy
Suite.AfterEach "Teardown", Instance:=Proxy

Causes an issue with current arguments implementation, since ParamArray cannot be used with other Optional variables (Instance), but ByRef with BeforeEach and AfterEach is a goal, so ParamArray might not be useful anyways.

@timhall
Copy link
Member Author

timhall commented Aug 27, 2018

This seems much more likely with the evented approach used in v2 and the Context object proposed in #23 so this is seeming much more straightforward. Basically, it will open / copy the workbook before each test, pass it in as .Context("workbook"), and close the workbook without saving after each test.

Dim Suite As New TestSuite

Dim Fixture As New WorkbookFixture
Fixture.Open "path/to/workbook.xlsm"
Fixture.ListenTo Suite

With Suite.Test("should open workbook")
  .IsEqual .Context("workbook").Name, "workbook"
End With

@timhall timhall changed the title Plan: Update Workbook proxy Update Workbook proxy Aug 27, 2018
@timhall timhall added this to the vba-test v2 milestone Aug 27, 2018
@timhall timhall removed the planned label Aug 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant