diff --git a/docs/docs/2019-01-01-search.md b/docs/docs/2019-01-01-search.md deleted file mode 100644 index 36ce5e1b..00000000 --- a/docs/docs/2019-01-01-search.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: Search ---- - - - diff --git a/docs/docs/toc.yml b/docs/docs/toc.yml deleted file mode 100644 index 449a2978..00000000 --- a/docs/docs/toc.yml +++ /dev/null @@ -1,26 +0,0 @@ -- href: 2010-01-01-getting-started.md -- href: 2010-01-02-creating-a-substitute.md -- href: 2010-02-01-set-return-value.md -- href: 2010-02-02-return-for-args.md -- href: 2010-02-03-return-for-any-args.md -- href: 2010-02-03-return-from-function.md -- href: 2010-02-04-multiple-returns.md -- href: 2010-02-10-replacing-return-values.md -- href: 2010-03-01-received-calls.md -- href: 2010-03-10-clear-received-calls.md -- href: 2010-04-01-argument-matchers.md -- href: 2010-05-01-callbacks.md -- href: 2010-05-02-throwing-exceptions.md -- href: 2010-05-10-configure.md -- href: 2010-06-01-raising-events.md -- href: 2010-10-01-auto-and-recursive-mocks.md -- href: 2010-11-01-setting-out-and-ref-arguments.md -- href: 2010-12-01-actions-with-arguments.md -- href: 2013-01-01-received-in-order.md -- href: 2013-02-01-partial-subs.md -- href: 2013-03-01-return-for-all.md -- href: 2013-04-01-threading.md -- href: 2013-04-15-compat-args.md -- href: 2013-05-01-nsubstitute-analysers.md -- href: 2015-01-01-how-nsub-works.md -- href: 2019-01-01-search.md diff --git a/docs/help.md b/docs/help.md index ca20d1ef..2638432c 100644 --- a/docs/help.md +++ b/docs/help.md @@ -3,8 +3,8 @@ title: Docs and getting help permalink: /help.html --- -

Read Getting started for a quick tour of NSubstitute.

+

Read Getting started for a quick tour of NSubstitute.

-

For more in depth information start with Creating a substitute.

+

For more in depth information start with Creating a substitute.

If you can't find the answer you're looking for, or if you have feature requests or feedback on NSubstitute, please raise an issue on our project site. All questions are welcome via our project site, but for "how-to"-style questions you can also try StackOverflow with the [nsubstitute] tag, which often leads to very good answers from the larger programming community. StackOverflow is especially useful if your question also relates to other libraries that our team may not be as familiar with (e.g. NSubstitute with Entity Framework).

diff --git a/docs/docs/2010-12-01-actions-with-arguments.md b/docs/help/actions-with-arguments/index.md similarity index 100% rename from docs/docs/2010-12-01-actions-with-arguments.md rename to docs/help/actions-with-arguments/index.md diff --git a/docs/docs/2010-04-01-argument-matchers.md b/docs/help/argument-matchers/index.md similarity index 100% rename from docs/docs/2010-04-01-argument-matchers.md rename to docs/help/argument-matchers/index.md diff --git a/docs/docs/2010-10-01-auto-and-recursive-mocks.md b/docs/help/auto-and-recursive-mocks/index.md similarity index 100% rename from docs/docs/2010-10-01-auto-and-recursive-mocks.md rename to docs/help/auto-and-recursive-mocks/index.md diff --git a/docs/docs/2010-05-01-callbacks.md b/docs/help/callbacks/index.md similarity index 100% rename from docs/docs/2010-05-01-callbacks.md rename to docs/help/callbacks/index.md diff --git a/docs/docs/2010-03-10-clear-received-calls.md b/docs/help/clear-received-calls/index.md similarity index 100% rename from docs/docs/2010-03-10-clear-received-calls.md rename to docs/help/clear-received-calls/index.md diff --git a/docs/docs/2013-04-15-compat-args.md b/docs/help/compat-args/index.md similarity index 100% rename from docs/docs/2013-04-15-compat-args.md rename to docs/help/compat-args/index.md diff --git a/docs/docs/2010-05-10-configure.md b/docs/help/configure/index.md similarity index 100% rename from docs/docs/2010-05-10-configure.md rename to docs/help/configure/index.md diff --git a/docs/docs/2010-01-02-creating-a-substitute.md b/docs/help/creating-a-substitute/index.md similarity index 99% rename from docs/docs/2010-01-02-creating-a-substitute.md rename to docs/help/creating-a-substitute/index.md index f15d8077..c567affe 100644 --- a/docs/docs/2010-01-02-creating-a-substitute.md +++ b/docs/help/creating-a-substitute/index.md @@ -14,7 +14,7 @@ This is how you'll normally create substitutes for types. Generally this type wi ⚠️ **Warning:** Substituting for classes can have some nasty side-effects! -For starters, **NSubstitute can only work with *virtual* members of the class** that are overridable in the test assembly, so any non-virtual code in the class will actually execute! If you try to substitute for a class that formats your hard drive in the constructor or in a non-virtual property setter then you're asking for trouble. By overridable we mean `public virtual`, `protected virtual`, `protected internal virtual`, or `internal virtual` with `InternalsVisibleTo` attribute applied (although to configure or assert on calls members will also need to be callable from the test assembly, so `public virtual` or `internal virtual` with `InternalsVisibleTo`). See [How NSubstitute works](/help/how-nsub-works) for more information. +For starters, **NSubstitute can only work with *virtual* members of the class** that are overridable in the test assembly, so any non-virtual code in the class will actually execute! If you try to substitute for a class that formats your hard drive in the constructor or in a non-virtual property setter then you're asking for trouble. By overridable we mean `public virtual`, `protected virtual`, `protected internal virtual`, or `internal virtual` with `InternalsVisibleTo` attribute applied (although to configure or assert on calls members will also need to be callable from the test assembly, so `public virtual` or `internal virtual` with `InternalsVisibleTo`). See [How NSubstitute works](/help/how-nsub-works/) for more information. It also means features like `Received()`, `Returns()`, `Arg.Is()`, `Arg.Any()` and `When()..Do()` **will not work with these non-overridable members**. For example: `subClass.Received().NonVirtualCall()` will not actually run an assertion (it will always pass, even if there are no calls to `NonVirtualCall()`), and can even cause confusing problems with later tests. These features will work correctly with virtual members of the class, but we have to be careful to avoid the non-virtual ones. diff --git a/docs/docs/2010-01-01-getting-started.md b/docs/help/getting-started/index.md similarity index 100% rename from docs/docs/2010-01-01-getting-started.md rename to docs/help/getting-started/index.md diff --git a/docs/docs/2015-01-01-how-nsub-works.md b/docs/help/how-nsub-works/index.md similarity index 100% rename from docs/docs/2015-01-01-how-nsub-works.md rename to docs/help/how-nsub-works/index.md diff --git a/docs/docs/2010-02-04-multiple-returns.md b/docs/help/multiple-returns/index.md similarity index 100% rename from docs/docs/2010-02-04-multiple-returns.md rename to docs/help/multiple-returns/index.md diff --git a/docs/docs/2013-05-01-nsubstitute-analysers.md b/docs/help/nsubstitute-analysers/index.md similarity index 100% rename from docs/docs/2013-05-01-nsubstitute-analysers.md rename to docs/help/nsubstitute-analysers/index.md diff --git a/docs/docs/2013-02-01-partial-subs.md b/docs/help/partial-subs/index.md similarity index 100% rename from docs/docs/2013-02-01-partial-subs.md rename to docs/help/partial-subs/index.md diff --git a/docs/docs/2010-06-01-raising-events.md b/docs/help/raising-events/index.md similarity index 100% rename from docs/docs/2010-06-01-raising-events.md rename to docs/help/raising-events/index.md diff --git a/docs/docs/2010-03-01-received-calls.md b/docs/help/received-calls/index.md similarity index 100% rename from docs/docs/2010-03-01-received-calls.md rename to docs/help/received-calls/index.md diff --git a/docs/docs/2013-01-01-received-in-order.md b/docs/help/received-in-order/index.md similarity index 100% rename from docs/docs/2013-01-01-received-in-order.md rename to docs/help/received-in-order/index.md diff --git a/docs/docs/2010-02-10-replacing-return-values.md b/docs/help/replacing-return-values/index.md similarity index 100% rename from docs/docs/2010-02-10-replacing-return-values.md rename to docs/help/replacing-return-values/index.md diff --git a/docs/docs/2013-03-01-return-for-all.md b/docs/help/return-for-all/index.md similarity index 100% rename from docs/docs/2013-03-01-return-for-all.md rename to docs/help/return-for-all/index.md diff --git a/docs/docs/2010-02-03-return-for-any-args.md b/docs/help/return-for-any-args/index.md similarity index 100% rename from docs/docs/2010-02-03-return-for-any-args.md rename to docs/help/return-for-any-args/index.md diff --git a/docs/docs/2010-02-02-return-for-args.md b/docs/help/return-for-args/index.md similarity index 100% rename from docs/docs/2010-02-02-return-for-args.md rename to docs/help/return-for-args/index.md diff --git a/docs/docs/2010-02-03-return-from-function.md b/docs/help/return-from-function/index.md similarity index 100% rename from docs/docs/2010-02-03-return-from-function.md rename to docs/help/return-from-function/index.md diff --git a/docs/help/search/index.md b/docs/help/search/index.md new file mode 100644 index 00000000..bf08d0f3 --- /dev/null +++ b/docs/help/search/index.md @@ -0,0 +1,7 @@ +--- +title: Search +--- + + + \ No newline at end of file diff --git a/docs/docs/2010-02-01-set-return-value.md b/docs/help/set-return-value/index.md similarity index 100% rename from docs/docs/2010-02-01-set-return-value.md rename to docs/help/set-return-value/index.md diff --git a/docs/docs/2010-11-01-setting-out-and-ref-arguments.md b/docs/help/setting-out-and-ref-arguments/index.md similarity index 100% rename from docs/docs/2010-11-01-setting-out-and-ref-arguments.md rename to docs/help/setting-out-and-ref-arguments/index.md diff --git a/docs/docs/2013-04-01-threading.md b/docs/help/threading/index.md similarity index 100% rename from docs/docs/2013-04-01-threading.md rename to docs/help/threading/index.md diff --git a/docs/docs/2010-05-02-throwing-exceptions.md b/docs/help/throwing-exceptions/index.md similarity index 100% rename from docs/docs/2010-05-02-throwing-exceptions.md rename to docs/help/throwing-exceptions/index.md diff --git a/docs/help/toc.yml b/docs/help/toc.yml new file mode 100644 index 00000000..512a6ff7 --- /dev/null +++ b/docs/help/toc.yml @@ -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 diff --git a/docs/index.md b/docs/index.md index 3b1d22c7..ae0aa0b2 100644 --- a/docs/index.md +++ b/docs/index.md @@ -3,6 +3,29 @@ layout: landing title: A friendly substitute for .NET mocking libraries --- + +
@@ -54,31 +77,6 @@ Received 2 non-matching calls (non-matching arguments indicated with '*' charact
-
- -## Don't sweat the small stuff - -

Mock, stub, fake, spy, test double? Strict or loose? Nah, just substitute for the type you need!

-

NSubstitute is designed for Arrange-Act-Assert (AAA) testing, so you just need to arrange how it should work, then assert it received the calls you expected once you're done. Because you've got more important code to write than whether you need a mock or a stub.

-
- - - -