https://github.com/brunolm/assertsharp
Assert based on .NET
https://github.com/brunolm/assertsharp
Last synced: 9 months ago
JSON representation
Assert based on .NET
- Host: GitHub
- URL: https://github.com/brunolm/assertsharp
- Owner: brunolm
- Created: 2015-11-03T01:40:55.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-03T21:48:56.000Z (about 10 years ago)
- Last Synced: 2025-03-13T18:19:00.355Z (9 months ago)
- Language: TypeScript
- Homepage:
- Size: 133 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://travis-ci.org/brunolm/AssertSharp)
# AssertSharp
Assert methods based on .NET Assert class. If the assertion fails it throws a new Error.
Import/Require:
```
import Assert from "assertsharp";
```
or
```
var Assert = require("assertsharp").default;
```
## TypeScript definition
```
declare module "assertsharp" {
export default class Assert {
static AreEqual(expected: T, actual: T, message?: string): void;
static AreNotEqual(notExpected: T, actual: T, message?: string): void;
static AreNotSame(notExpected: T, actual: T, message?: string): void;
static AreSequenceEqual(expected: T[], actual: T[], equals?: (x, y) => boolean, message?: string): void;
static Fail(message?: string): void;
static IsFalse(actual: boolean, message?: string): void;
static IsInstanceOfType(actual: any, expectedType: Function, message?: string): void;
static IsNotInstanceOfType(actual: any, wrongType: Function, message?: string): void;
static IsNotNull(actual: any, message?: string): void;
static IsNull(actual: any, message?: string): void;
static IsTrue(actual: boolean, message?: string): void;
static Throws(fn: () => void, message?: string): void;
}
}
```