Conversation
…`System.Console` vs `Fixie.Console`), and because this ambiguity has most often been resolved by explicitly referencing `System.Console...` inline, consistently apply that approach instead of occasionally using different techniques.
…gets injected into test projects by the NuGet package.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This repo has been placing
usingdirectives withinnamespaceblocks. The apparent benefit was occasional brevity for "nearby" namespaces: within theFixie.Testsnamespace, you could simply sayusing Assertionsto bring in the nearby namespaceFixie.Tests.Assertions. This was the only benefit, and switching to it was a Pyrrhic victory for two reasons:namespacedirective below existingusingdirectives. Fortunately most such conflicts would coincidentally surface as a compiler error based on usages of the identifier, but still: here be dragons.This reorders
usingvsnamespaceas a step towards cleanly applying implicit/globalusingdirectives in a subsequent PR. By applying this code change separately from the implicit/globalusingdirectives, each can be more easily reviewed in isolation.This was done manually. For each visited file, already-abbreviated
usingdirectives were first expanded to their fully-qualified equivalent, letting the IDE first confirm what the implied full name was. Once allusingdirectives in a code file were fully-qualified, they could be safely cut and pasted before thenamespacewith confidence that the move could not alter the meaning of the following code.Two name conflicts were encountered and resolved:
Consoletends to be ambiguous in the tests when we can alternately meanSystem.ConsoleorFixie.Console. We resolve this by always referring toSystem.Console...explicitly in the tests, and can meanFixie.Consoleimplicitly otherwise.TestResultcan mean eitherMicrosoft.VisualStudio.TestPlatform.ObjectModel.TestResultorFixie.TestResult. We resolve this in bothVsExecutionRecorderandVsExecutionRecorderTestsby including the following alias after the namespace declaration: