You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,9 +128,7 @@ Assert.That(eventWasRaised);
128
128
129
129
NSubstitute and its tests can be compiled and run using Visual Studio, Visual Studio Code or any other editor with .NET support. Note that some tests are marked `[Pending]` and are not meant to pass at present, so it is a good idea to exclude tests in the Pending category from test runs.
130
130
131
-
There are also build scripts in the `./build` directory for command line builds, and CI configurations in the project root.
132
-
133
-
To do [full builds](https://github.com/nsubstitute/NSubstitute/wiki/Release-procedure) you'll also need Ruby, as the jekyll gem is used to generate the website.
Copy file name to clipboardExpand all lines: acknowledgements.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ The aim of this file is to acknowledge the software projects that have been used
3
3
# Software distributed with/compiled into NSubstitute
4
4
5
5
## Castle.Core
6
-
NSubstitute is built on the Castle.Core library, particularly Castle.DynamicProxy which is used for generating proxies for types and intercepting calls made to them so that NSubstitute can record them.
6
+
NSubstitute is built on the Castle.Core library, particularly Castle.DynamicProxy which is used for generating proxies for types and intercepting calls made to them so that NSubstitute can record them.
7
7
8
8
Castle.Core is maintained by the Castle Project [https://www.castleproject.org/] and is released under the Apache License, Version 2.0 [https://www.apache.org/licenses/LICENSE-2.0.html].
9
9
@@ -19,13 +19,13 @@ Used for mocking parts of the NSubstitute mocking library for testing. It is dis
19
19
Moq is not directly used in NSubstitute, but was a great source of inspiration. Moq pioneered Arrange-Act-Assert (AAA) mocking syntax for .NET, as well as removing the distinction between mocks and stubs, both of which have become important parts of NSubstitute. Moq is available under the BSD license [https://www.opensource.org/licenses/bsd-license.php].
20
20
21
21
## Jekyll [https://jekyllrb.com/]
22
-
Static website generator written in Ruby, used for NSubstitute's website and documentation. Distributed under the MIT license [https://www.opensource.org/licenses/bsd-license.php].
22
+
Static website generator written in Ruby, used for NSubstitute's website and documentation. Distributed under the MIT license [https://www.opensource.org/licenses/bsd-license.php]. No longer used since migration to docfx.
Open source, JavaScript, client-side code highlighter used for highlighting code samples on the NSubstitute website. Distributed under the MIT License [https://en.wikipedia.org/wiki/MIT_License] and the GPL [https://www.gnu.org/copyleft/lesser.html].
26
26
27
27
## FAKE [https://fsharp.github.io/FAKE/]
28
-
FAKE (F# Make) is used for NSubstitute's build. It is inspired by `make` and `rake`. FAKE is distributed under a dual Apache 2 / MS-PL license [https://github.com/fsharp/FAKE/blob/master/License.txt].
28
+
FAKE (F# Make) is used for NSubstitute's build. It is inspired by `make` and `rake`. FAKE is distributed under a dual Apache 2 / MS-PL license [https://github.com/fsharp/FAKE/blob/master/License.txt]. No longer used since migration to source generators.
29
29
30
30
## Microsoft .NET Framework [https://www.microsoft.com/net/]
31
31
NSubstitute is coded in C# and compiled using Microsoft .NET. It can also run and compile under Mono [https://www.mono-project.com], an open source implementation of the open .NET standards for C# and the CLI.
Here we specify that a call to `Multiply` with any first argument should pass the second argument and put it in the `argumentUsed` variable. This can be quite useful when we want to assert several properties on an argument (for types more complex than `int` that is).
@@ -97,7 +97,7 @@ calculator.Multiply(2, 10);
97
97
calculator.Multiply(5, 10);
98
98
calculator.Multiply(7, 4567); //Will not match our Arg.Do as second arg is not 10
Each time a recursively-subbed property or method is called with the same arguments it will return the same substitute. If a method is called with different arguments a new substitute will be returned.
@@ -57,8 +57,8 @@ var firstCall = factory.Create(',');
_Note:_ Recursive substitutes will not be created for non-purely virtual classes, as creating and using classes can have potentially unwanted side-effects. You'll therefore need to create and return these explicitly.
@@ -86,9 +86,9 @@ To get the identity of the `CurrentRequest` to return a certain name, we could m
86
86
```csharp
87
87
varcontext=Substitute.For<IContext>();
88
88
context.CurrentRequest.Identity.Name.Returns("My pet fish Eric");
89
-
Assert.AreEqual(
90
-
"My pet fish Eric",
91
-
context.CurrentRequest.Identity.Name);
89
+
Assert.That(
90
+
context.CurrentRequest.Identity.Name,
91
+
Is.EqualTo("My pet fish Eric"));
92
92
```
93
93
94
94
Here `CurrentRequest` is automatically going to return a substitute for `IRequest`, and the `IRequest` substitute will automatically return a substitute for `IIdentity`.
@@ -100,6 +100,7 @@ Properties and methods returning types of `String` or `Array` will automatically
Copy file name to clipboardExpand all lines: docs/help/multiple-returns/index.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,9 +17,9 @@ A call can also be configured to return a different value over multiple calls. T
17
17
18
18
```csharp
19
19
calculator.Mode.Returns("DEC", "HEX", "BIN");
20
-
Assert.AreEqual("DEC", calculator.Mode);
21
-
Assert.AreEqual("HEX", calculator.Mode);
22
-
Assert.AreEqual("BIN", calculator.Mode);
20
+
Assert.That(calculator.Mode, Is.EqualTo("DEC"));
21
+
Assert.That(calculator.Mode, Is.EqualTo("HEX"));
22
+
Assert.That(calculator.Mode, Is.EqualTo("BIN"));
23
23
```
24
24
25
25
This can also be achieved by [returning from a function](/help/return-from-function), but passing multiple values to `Returns()` is simpler and reads better.
@@ -30,8 +30,8 @@ This can also be achieved by [returning from a function](/help/return-from-funct
0 commit comments