mstest


All test methods in a package/solution in MSTest


I would like to get list of all Test Methods in unit test project/solution. I am using MSTest framework. I would like to get list of all test methods so that I can write some logic to implement logging of all available tests Vs what is executed and which one is being executed etc.,
I am a 1 year old novice in this field. So please provide the detailed explanation or code.
I found a post on how to do this in Nunit and was able to figure out doing it in MSTest.
var tests = new List ();
var testTypes = from t in assembly.GetTypes()
orderby t.Name
select t;
foreach (var type in testTypes)
{
var testMethods = from m in type.GetMethods()
let attributes = m.GetCustomAttributes(typeof(TestMethodAttribute), true)
where attributes != null && attributes.Length > 0
orderby m.Name
select m;
foreach (var method in testMethods)
{
tests.Add(method.Name);
}
}

Related Links

MSTest DeploymentItem doesn't copy files to output dir
Mstest name instead Data Row with Data-Driven testing
How to unit test a class defined in a Metro executable
local.testsettings file that is sensitive to configuration
Can't run Unit Tests In VS2012RC
assemblybinding does not work in mstest
what is the equivalant to MbUnit.Framework.RowAttribute in MSTest?
MSTest: A sensible way to deploy items from a common directory?
Adding Unit Test Project to ASP.Net MVC 4 Project
What is the major difference between Pex vs MsTest?
What is the significance of the red outline in a failed Coded UI test screenshot?
MS Test, Multiple Test Projects in Solution, and DeploymentItemAttribute
Print MSTest summary after command line exeution
How do you get the iteration / line number from TestContext in data driven tests?
How to refresh UIMap object in CodedUI
No mole class for NativeMethods.cs?

Categories

HOME
uml
deep-learning
apache-jena
gpu
alexa-skills-kit
google-spreadsheet
twig
interface
mstest
google-cloud-functions
3d-reconstruction
interpolation
jetty
missing-data
openstreetmap
heap
favicon
android-intent
internationalization
scsi
microsoft-dynamics-nav
easyphp
soci
swagger-2.0
asciidoctor-pdf
articulate-storyline
object-storage
direct3d11
google-cloud-print
maze
slidetoggle
flooding
fractions
event-flow
scatter3d
postback
papaparse
sammy.js
baidu-map
batching
getlasterror
roblox
parse-tree
openproject
bc
mcustomscrollbar
lpsolve
avcapturedevice
angular-http
tf
insight
android-testing
otp
mach-o
monkey
cpu-cache
chromium-os
omxplayer
parfor
tinkerpop3
gogs
invoke-sqlcmd
mobiledoc-kit
asyncdisplaykit
character-replacement
ess
typemock
nutiteq
nsurlsessiondatatask
matlab-deployment
bufferedinputstream
code-documentation
cross-join
rapidsvn
execve
webmatrix-3
metatrader5
cocos3d
jqmodal
reflector
extjs2
fpdi
accesscontrolexception
mysql-error-1044
embedded-fonts
isqlquery
mongohq
neos-server
asdf
redis-py
cakephp-1.2
paginator
expression-blend-4
promotion-code
landscape-portrait
filemerge
u2netdk
diagrams
metaweblog
facebook-iframe
data-mapping
online-storage

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App