-
Notifications
You must be signed in to change notification settings - Fork 282
Fix doc links (#884) #886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix doc links (#884) #886
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| title: Search | ||
| --- | ||
|
|
||
| <script async src="https://cse.google.com/cse.js?cx=005697633880271604295:lw9srlgcpg8"> | ||
| </script> | ||
| <div class="gcse-search"></div> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| - href: getting-started/index.md | ||
| - href: creating-a-substitute/index.md | ||
| - href: set-return-value/index.md | ||
| - href: return-for-args/index.md | ||
| - href: return-for-any-args/index.md | ||
| - href: return-from-function/index.md | ||
| - href: multiple-returns/index.md | ||
| - href: replacing-return-values/index.md | ||
| - href: received-calls/index.md | ||
| - href: clear-received-calls/index.md | ||
| - href: argument-matchers/index.md | ||
| - href: callbacks/index.md | ||
| - href: throwing-exceptions/index.md | ||
| - href: configure/index.md | ||
| - href: raising-events/index.md | ||
| - href: auto-and-recursive-mocks/index.md | ||
| - href: setting-out-and-ref-arguments/index.md | ||
| - href: actions-with-arguments/index.md | ||
| - href: received-in-order/index.md | ||
| - href: partial-subs/index.md | ||
| - href: return-for-all/index.md | ||
| - href: threading/index.md | ||
| - href: compat-args/index.md | ||
| - href: nsubstitute-analysers/index.md | ||
| - href: how-nsub-works/index.md | ||
| - href: search/index.md | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| - name: Documentation | ||
| href: docs/ | ||
| href: help/ | ||
|
|
||
| - name: Getting help | ||
| href: help.md | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,7 +37,13 @@ public static string FormatCode(string code) | |
|
|
||
| private static string GenerateTestsClassName(AdditionalText markdownFile) | ||
| { | ||
| return $"Tests_{Path.GetFileNameWithoutExtension(markdownFile.Path).Replace("-", "_")}"; | ||
| var file = Path.GetFileNameWithoutExtension(markdownFile.Path); | ||
| var pathSegments = markdownFile.Path.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can avoid manually working with paths var fileName = Path.GetFileNameWithoutExtension(markdownFile.Path);
var directoryName = new FileInfo(markdownFile.Path).Directory.Name;
var nameToUse = string.Equals(fileName, "index", StringComparison.InvariantCultureIgnoreCase) ? directoryName : fileName;
return $"Tests_{nameToUse.Replace("-", "_")}";
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Applied suggestion 👍
Romfos marked this conversation as resolved.
Outdated
|
||
| var dirName = pathSegments[pathSegments.Length - 2]; // second last path segment | ||
| var nameToUse = string.Equals(file, "index", StringComparison.InvariantCultureIgnoreCase) | ||
| ? dirName | ||
| : file; | ||
| return $"Tests_{nameToUse.Replace("-", "_")}"; | ||
| } | ||
|
|
||
| private static string GenerateTestClassContent(string testsClassName, AdditionalText markdownFile) | ||
|
|
@@ -55,7 +61,7 @@ private static string GenerateTestClassContent(string testsClassName, Additional | |
| using NSubstitute.ExceptionExtensions; | ||
|
|
||
| namespace NSubstitute.Documentation.Tests.Generated; | ||
|
|
||
| public sealed class {{testsClassName}} | ||
| { | ||
| """); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.