Giter VIP home page Giter VIP logo

Comments (6)

farlee2121 avatar farlee2121 commented on June 1, 2024

test name automation
https://bitwiseguy.wordpress.com/2015/11/23/creating-readable-xunit-test-method-names-automatically/

Not very relevant anymore, these token replacements

from testingpatterns.

farlee2121 avatar farlee2121 commented on June 1, 2024

Official set of extension examples
https://github.com/xunit/samples.xunit

Deep equals and assertion extension
https://stackoverflow.com/questions/16194952/extending-xunit-assert-class-with-new-asserts

Samples of extensions
https://xunit.net/docs/upgrade-extensions

Extensiblity examples in an old version of xunit
https://www.bricelam.net/2012/04/xunitnet-extensibility.html

from testingpatterns.

farlee2121 avatar farlee2121 commented on June 1, 2024

XUnit offers some default naming configuration through the xUnit config file

https://xunit.net/schema/current/xunit.runner.schema.json
https://xunit.net/docs/configuring-with-json

from testingpatterns.

farlee2121 avatar farlee2121 commented on June 1, 2024

If collection fixtures don't work, I may be able to implement integration/unit test reuse by making inherited theory/fact attributes

https://codopia.wordpress.com/2017/02/20/xunit-net-vs-nunit-a-pragmatic-comparison/

from testingpatterns.

farlee2121 avatar farlee2121 commented on June 1, 2024

Needs more research, but there is the IUseFixture that allows you to define a method for setting up that fixture. Maybe I implement different test run strategies as variants of this and have a setup method for each run strategy.

from testingpatterns.

farlee2121 avatar farlee2121 commented on June 1, 2024

Summary of findings, the samples repository (https://github.com/xunit/samples.xunit) is really the definitive source of extension documentation.
You can override most any step, this example shows an example of overriding almost every step

DisplayNames: Looks like display names could be overwritten by make a new TestCase type or TestCaseRunner
Integration/Unit Reuse:

  • Could do it at the theory level, but i'd have to set configuration in every test method
  • Can use Activator.CreateInstance(testClass.Class.ToRuntimeType()) starting at the CollectionRunner (and down) to create an instance of the test class. Could then modify properties on the test class to run different configurations

Points of extension

  • Fact/Theory inheritance:
  • Class/Collection/Assembly fixture: share data between tests, breaks test isolation and not conditional
  • TestDiscover: Manage how tests are discovered, i.e. find only certain attributes, look for additional attributes, etc
  • TestRunner:
  • TestInvoker
  • TestOrder: ITestCaseOrderer to order tests. could probably insert tests here too
  • Assertions: can write extensions for custom assertions
  • Traits: can inherit from traits to create attributes for repeated trait usage

xUnit Flow: Discoverer > Executor > AssemblyRunner > CollectionRunner > TestClassRunner > TestMethodRunner > TestCase > TestCaseRunner > TestRunner > TestInvoker

from testingpatterns.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.