# Tests

Trend Metric Trend Metrics / Coverage

Number of test methods: methods of test assemblies (the TestCode view) tagged with a test attribute of a supported test framework (xUnit, NUnit, MSTest, TUnit…).

CQLinq source

This trend metric is written in CQLinq, C# LINQ over the NDepend code model. It ships with every new NDepend project: you can read it, adapt it, or use it as a starting point for your own custom rules.

// <TrendMetric Name="# Tests" Unit="Tests" />
from m in TestCode.Methods
where m.IsTestMethod
select new { m, m.ParentType, m.NbLinesOfCode }

//<Desc>
// Number of test methods: methods of test assemblies (the **TestCode** view)
// tagged with a test attribute of a supported test framework (xUnit, NUnit,
// MSTest, TUnit…).
//</Desc>

Trend Metrics / Coverage: all 12 items