Search Results for

    Show / Hide Table of Contents

    Class AssertWhenDebugging

    Assertion methods which are stripped out in release mode.

    Inheritance
    Object
    AssertWhenDebugging
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: Microsoft.ML.Probabilistic.Utilities
    Assembly: Microsoft.ML.Probabilistic.dll
    Syntax
    public static class AssertWhenDebugging
    Remarks

    To catch assertion failures in the debugger: Debug -> Exceptions -> Add Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException

    Methods

    Distinct(IEnumerable<Int32>)

    Throws an exception if the collection has duplicate elements.

    Declaration
    [Conditional("DEBUG")]
    public static void Distinct(IEnumerable<int> collection)
    Parameters
    Type Name Description
    IEnumerable<Int32> collection

    Any collection

    IsTrue(Boolean)

    Checks if a condition is true; if not, an exception without error message is thrown.

    Declaration
    [Conditional("DEBUG")]
    public static void IsTrue(bool condition)
    Parameters
    Type Name Description
    Boolean condition

    Condition that must be true

    IsTrue(Boolean, String)

    Checks if a condition is true; if not, an exception is thrown with an error message.

    Declaration
    [Conditional("DEBUG")]
    public static void IsTrue(bool condition, string message)
    Parameters
    Type Name Description
    Boolean condition

    Condition that must be true

    String message

    Message to be output by the exception

    In This Article
    Back to top Copyright © .NET Foundation. All rights reserved.