Search Results for

    Show / Hide Table of Contents

    AssignableTo Constraint

    AssignableToConstraint tests that one type is assignable to another

    Constructor

    AssignableToConstraint(Type)
    

    Syntax

    Is.AssignableTo(Type)
    Is.AssignableTo<T>()
    

    Examples of Use

    Assert.That("Hello", Is.AssignableTo(typeof(object)));
    Assert.That(5, Is.Not.AssignableTo(typeof(string)));
    
    • Edit this page
    In this article
    Back to top Generated by DocFX | Copyright (c) 2018- The NUnit Project - Licensed under CC BY-NC-SA 4.0