Comments (6)
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.
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.
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.
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.
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.
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)
- Add accessors for a different persistence type (text? json?) HOT 2
- Should I implement data contracts as structs to prevent referential mutation? HOT 2
- Add automated Seed data sample
- Experiment with abstracting Id type with a struct HOT 1
- Add automated UI testing examples
- Demonstrate centralized auth and permissions
- Is my test structure too coupled to system structure? HOT 2
- Explore editorconfig for style enforcement
- Experiment with local package system model for stable experimental client development HOT 2
- Investigate injecting connection strings via DI HOT 2
- Investigate .net core DI tooling
- Abstract test datastore creation HOT 1
- Too many data contracts?
- Impact of c# 8 extensions on design HOT 2
- Builder Patterns for more flexible dataprep HOT 3
- Create a cli interface using the snazzy new .net cli parser
- Special Charater Testings
- Generative (Statistical) Testing HOT 2
- F# backend
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from testingpatterns.