How to create Xunit tests that are skippable in some environments

Опубликовано: 06 Октябрь 2024
на канале: Lethcode
481
11

In this video Andrew shows how to create a skippable attribute. This attribute can be used to select tests to run. For instance if you want a test to only run in a specific environment like Windows or Linux. First you see how to create the attribute for a Fact and then you see how it works for a Theory.

This can be a lot more effective allowing your developers to write useful tests that can't be run on a continuous integration environment. They can run them locally and keep them checked in and they will just be skipped on the build environment.

Get 2 FREE Audio Books from Audible
https://amzn.to/2ZfViDn

My Favorite Books on Coding, Devops, and Leadership

The Phoenix Project https://amzn.to/3ahITFm
The Unicorn Project https://amzn.to/2NtIKFD
The Devops Handbook https://amzn.to/3jMG6al
The Infinite Game https://amzn.to/3b9AjHO
Start With Why https://amzn.to/3pf6jPS
Clean Code https://amzn.to/3b2dOEU
Code Complete https://amzn.to/2NtIYMZ

Gear Used
Blue Snowball iCE USB Mic https://amzn.to/2ZiPpVT
Intel Core i5-10600KF - 8GB Memory - NVIDIA GeForce GTX 1660 SUPER - 1TB HDD + 240GB SSD
https://amzn.to/2ZeZT91

Davinci Resolve - Editing
StreamLabs OBS - Screen Capture

**Disclaimer: Lethcode is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to www.amazon.com.