public void ReportOnTechDebtAndFailTestIfTotalPainExceeded() { var assemblyContainingTechDebt = Assembly.GetAssembly(typeof(SomeThing)); const int maximumPainInCodebaseThatWereWillingToLiveWith = 10; TechDebtReporter.AssertMaxPainNotExceeded(assemblyContainingTechDebt, maximumPainInCodebaseThatWereWillingToLiveWith); }
public void ReportOnTechDebtAndFailTestIfTotalPainExceeded() { var assemblyContainingTechDebt = Assembly.GetAssembly(typeof(Book)); //would need team / business descision as to how much pain we are willing to incur //find code hotspots see how often things change, also how easy is it to change this will give pain metric const int maximumPainInCodebaseThatWereWillingToLiveWith = 50; TechDebtReporter.AssertMaxPainNotExceeded(assemblyContainingTechDebt, maximumPainInCodebaseThatWereWillingToLiveWith); }
public void ShouldNotThrowExceptionWhenPainIsAcceptableToTeam() { var assemblyToReportOn = Assembly.GetAssembly(typeof(SomeThing)); TechDebtReporter.AssertMaxPainNotExceeded(assemblyToReportOn, int.MaxValue); }
public void ShouldThrowExceptionWhenPainLimitExceeded() { var assemblyToReportOn = Assembly.GetAssembly(typeof(SomeThing)); Assert.Throws <TechDebtPainExceededException>(() => TechDebtReporter.AssertMaxPainNotExceeded(assemblyToReportOn, 1)); }