Our tests are very bloated -- often we only test one or two specific lines of code whereas the rest of the test scenario stays in the same. Look into moving from a test scenario like this:
[TestMethod]
public void StringDotFormatWithDifferentAmountOfArguments_WithValidScenario()
{
var original = @"
using System;
using System.Text;
namespace ConsoleApplication1
{
class MyClass
{
void Method(string input)
{
string s = string.Format(""abc {0}, def {1}"", 1, 2);
}
}
}";
VerifyDiagnostic(original);
}
To this:
[TestMethod]
public void StringDotFormatWithDifferentAmountOfArguments_WithValidScenario()
{
Test("string s = string.Format(\"abc {0}, def {1}\", 1, 2);")
}
void Test(string scenario)
{
var original = $@"
using System;
using System.Text;
namespace ConsoleApplication1
{
class MyClass
{
void Method(string input)
{
{scenario}
}
}
}";
VerifyDiagnostic(original);
}
Our tests are very bloated -- often we only test one or two specific lines of code whereas the rest of the test scenario stays in the same. Look into moving from a test scenario like this:
To this: