- add `[NotNull]` in some `public` or `protected` callers as well
- add `[NotNull]` in `SeekableTextReader` constructors
- add `where TSymbolType : struct` to replace incorrect `null` checks
- remove `T` type parameters in changed files e.g. change to `TWriter`
- remove tests of removed code
nits:
- change `TextReaderExtensions` to consistently call other extensions as statics
- wrap some long doc comments
- #362 and more
- make a few more properties immutable
- in a few cases, just remove `private` setters
- in others, adjust consuming code to handle the changes
- make `Equals()` commutative
- use `GetType() == obj.GetType()` if necessary
- use only immutable values in `GetHashCode()` calculations
- avoid `object.GetHashCode()`; that calculates hash of reference
- add warnings about `RazorError` property setters but use properties
- BUT lack of immutable values leads to some static `GetHashCode()` calculations
- correct important typo in `TagHelperDescriptorComparer`
- ensure `Equals()` does not `throw` an NRE e.g. in `LineMapping`
- add `SyntaxTreeNode.GetEquivalenceHash()`
- make `SourceLocation.Equals()` and `SourceLocation.CompareTo()` consistent
Update affected tests
- code generators and edit handlers less likely to be equal; adjust expectations
Add lots of tests
- not for all updated classes but enough to see impact of odd choices
nits:
- remove some `Equals()` and `GetHashCode()` overrides in `SpanCodeGenerator` subclasses
- no longer unique
- remove redundant null checks e.g. when also done in `base.Equals()`
- add `StringComparer.Ordinal` if `StringComparison.Ordinal` used in `Equals()`
- make some `CSharpLineMappingWriter` fields `readonly`
- remove unused `LineMapping` constructor
- Normalized newlines for code generation tests. We default all tests to use \r\n. This way we can have a consistent test experience cross plat.
- For tests that expected indexes that were affected by new lines I modified them to account for cross plat scenarios.
- Added a few test classes to ensure we could normalize newlines for codegen tests.
#106
- #EngineeringDay
- Total replaced: 506 Matching files: 118
Did not change any files under test/Microsoft.AspNet.Razor.Test/TestFiles
- avoiding need to redo hashes
The largest sub-segment change was removing the Microsoft.TestCommon project. Ultimately it involved touching every test file and re-mapping them to use Xunit directly instead of a helper class which was initially ported over for legacy reasons. Lastly how files were embedded before included the full path to the embedded file; currently there is no path associated with the embedded files so had to make modifications to account for this. This is a temporary change and I left comments in the locations where we'll need to uncomment out old code once embeded files act the same as they used to.
#18
This addition will eventually replace CodeDOM to allow for the k10 project to build. It is a new type of codegeneration method that is highly extensible.