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
Perfect for those new to testing, and for others who would just like to to get their tests written with less noise and fewer lambdas.
6
+
7
+
## How to use
8
+
9
+
```csharp
10
+
// Create:
11
+
varcalculator=Substitute.For<ICalculator>();
12
+
13
+
// Set a return value:
14
+
calculator.Add(1, 2).Returns(3);
15
+
Assert.AreEqual(3, calculator.Add(1, 2));
16
+
17
+
// Check received calls:
18
+
calculator.Received().Add(1, Arg.Any<int>());
19
+
calculator.DidNotReceive().Add(2, 2);
20
+
21
+
// Raise events
22
+
calculator.PoweringUp+=Raise.Event();
23
+
```
24
+
25
+
## Optional Roslyn analysers
26
+
27
+
- For C# projects: [NSubstitute.Analyzers.CSharp](https://www.nuget.org/packages/NSubstitute.Analyzers.CSharp/)
28
+
- For VB projects: [NSubstitute.Analyzers.VisualBasic](https://www.nuget.org/packages/NSubstitute.Analyzers.VisualBasic/)
29
+
30
+
## Getting help
31
+
32
+
If you have questions, feature requests or feedback on NSubstitute please [raise an issue](https://github.com/nsubstitute/NSubstitute/issues) on our project site.
33
+
34
+
## More information
35
+
36
+
- Visit [NSubstitute website](https://nsubstitute.github.io) for more examples and documentation.
37
+
- Visit [NSubstitute on GitHub](https://github.com/nsubstitute/NSubstitute).
0 commit comments