assertsharp
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/assertsharp package

1.0.1 • Public • Published

Build Status

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<T>(expected: T, actual: T, message?: string): void;
        static AreNotEqual<T>(notExpected: T, actual: T, message?: string): void;
        static AreNotSame<T>(notExpected: T, actual: T, message?: string): void;
        static AreSequenceEqual<T>(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;
    }
}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    1
  • 1.0.0
    0

Package Sidebar

Install

npm i assertsharp

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • brunolm