Skip to content

Commit 229bf9f

Browse files
authored
Update generated header of unit test classes
Make the purpose of this generated code more clear, and note how this is only generated once.
1 parent df0fabd commit 229bf9f

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

UnitsNet/Scripts/Include-GenerateUnitTestPlaceholderSourceCode.ps1

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ function GenerateUnitTestPlaceholderSourceCode($unitClass)
44
@"
55
//------------------------------------------------------------------------------
66
// <auto-generated>
7-
// This code was generated by \GenerateUnits.bat.
8-
//
9-
// Changes to this file will be lost when the code is regenerated.
10-
// The build server regenerates the code before each build and a pre-build
11-
// step will regenerate the code on each local build.
7+
// This code was generated (once) by \GenerateUnits.bat, but will not be
8+
// regenerated when it already exists. The purpose of creating this file is to make
9+
// it easier to remember to implement all the unit conversion test cases.
10+
//
11+
// Whenever a new unit is added to this unit class and \GenerateUnits.bat is run,
12+
// the base test class will get a new abstract property and cause a compile error
13+
// in this derived class, reminding the developer to implement the test case
14+
// for the new unit.
1215
//
1316
// See https://github.com/anjdreas/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
1417
//
@@ -51,4 +54,4 @@ namespace UnitsNet.Tests.CustomCode
5154
}
5255
}
5356
"@;
54-
}
57+
}

0 commit comments

Comments
 (0)