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
v0.1.48.
- Remove static fail variable and the need to include implementation.cpp in the NuGet package, which was always displayed by the projects consuming the package.
- Add Usage section to the readme.md .
Copy file name to clipboardExpand all lines: README.md
+59-4Lines changed: 59 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,63 @@
1
-
# simply::com
1
+
# simply::assert
2
2
3
-
A small C++ library for asserting in unit tests.
3
+
A small C++ library for asserting in unit tests. It was born out of frustration with the CppUnitTest framework
4
+
used by the Visual Studio Native Unit Test projects and meant to replace its rudimentary [Assert](https://msdn.microsoft.com/en-us/library/hh694604.aspx)
5
+
class with a TDD-focused, rich, modern assertion APIs comparable to [Xunit.Assert](https://github.com/xunit/xunit/tree/master/src/xunit.assert)'s.
4
6
5
-
## building
7
+
## use
8
+
9
+
Add the [simply.assert](http://www.nuget.org/packages/simply.assert/) NuGet package to your Visual C++ Native Unit Test project
10
+
using the [Package Manager Console](http://docs.nuget.org/consume/package-manager-console) or
11
+
using the [Package Manager Dialog](http://docs.nuget.org/consume/Package-Manager-Dialog).
12
+
13
+
```PowerShell
14
+
Install-Package simply.assert
15
+
```
16
+
17
+
Include the `simply/assert.h` header to your C++ file and use the `simply` namespace.
18
+
19
+
```C++
20
+
#include<simply/assert.h>
21
+
usingnamespacesimply;
22
+
```
23
+
24
+
Use assert functions.
25
+
26
+
```C++
27
+
// fail (with overloads for std::string and std::wstring)
28
+
assert::fail("foo");
29
+
30
+
// bool
31
+
assert::is_true(true);
32
+
assert::is_false(false);
33
+
34
+
// equality
35
+
assert::is_equal(42, 42);
36
+
assert::is_not_equal(0, 42);
37
+
38
+
// exceptions
39
+
unique_ptr<exception> e = assert::throws<exception>([] { throw exception("foo"}; );
40
+
41
+
// null (with overloads for typed and void pointers)
0 commit comments