Gui.cs: Implement unit and regression tests

Created on 28 May 2020  路  6Comments  路  Source: migueldeicaza/gui.cs

This project desperately needs a set of automated unit and regression tests.

1.0 enhancement help wanted

Most helpful comment

Charlie asked me to comment on this.

I agree that we need unit tests, but have struggled to come up with a plan.

XUnit sounds like a fine choice

All 6 comments

My ideas:

  • Use xunit - I've used it before and dig it.
  • Ensure all tests run as part of CI/CD - I would prefer we use Github actions over Azure Pipelines or TravisCI just to keep things simple and contained.
  • I envision a set of tests that leverage UICatalog Scenarios - build a mock ConsoleDriver that lets tests specify how a console buffer should look and then check after the Scenario has run.

I now have a plan for the first set of automated tests.

  • Define a set of View unit tests

    • Initialize Absolute

    • Initialize Computed

    • For each typical DimPos scenario set X, Y, Height, Width and verify no crashes

    • For anything with a Text or Title property, throw different strings at 'em ensuring no crashes (see #617)

    • Etc...

  • I will leverage the code in the new AllViewsTester to dynamically run through every View derived class and automate most of the above so one test set runs against all controls.
  • I'll enable per-control tests

This will be the start. I'm willing to bet that once the infrastructure is in place, having more people contribute tests will be contagious.

This will be the start. I'm willing to bet that once the infrastructure is in place, having more people contribute tests will be contagious.

I look forward to using it. I am a great advocate of regression testing and this initiative makes it much more contagious, believe me. Thank you.

Charlie asked me to comment on this.

I agree that we need unit tests, but have struggled to come up with a plan.

XUnit sounds like a fine choice

image

Woot! Closed with #648

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TylerLeonhardt picture TylerLeonhardt  路  5Comments

pviotti picture pviotti  路  8Comments

tig picture tig  路  4Comments

tig picture tig  路  4Comments

UnrealSecurity picture UnrealSecurity  路  4Comments