Search Results for

    Show / Hide Table of Contents

    Interface IStringGuardable

    This interface provides methods for string related guard clauses. The implementation of these methods should succeed, if they approve the statement of the method name.

    Namespace: TeleScope.GuardClauses.Abstractions
    Assembly: TeleScope.GuardClauses.dll
    Syntax
    public interface IStringGuardable

    Methods

    | Improve this Doc View Source

    IsIpAddress(String, InternetProtocols, String, String)

    The implementation shall check, if the input string is a valid IP address.

    Declaration
    string IsIpAddress(string input, InternetProtocols protocol = InternetProtocols.IPv4, string expression = null, string message = null)
    Parameters
    Type Name Description
    System.String input

    The instance under test.

    InternetProtocols protocol

    The protocol version that needs to match during the guard precedure. The default value is IPv4.

    System.String expression

    The optional parameter name under test.

    System.String message

    The optional exception message that wil be used, if the method implementation throws.

    Returns
    Type Description
    System.String

    The input data, if no exception will be thrown.

    | Improve this Doc View Source

    IsMailAddress(String, String, String)

    The implementation shall check, if the input string is a valid email address.

    Declaration
    string IsMailAddress(string input, string expression = null, string message = null)
    Parameters
    Type Name Description
    System.String input

    The instance under test.

    System.String expression

    The optional parameter name under test.

    System.String message

    The optional exception message that wil be used, if the method implementation throws.

    Returns
    Type Description
    System.String

    The input data, if no exception will be thrown.

    | Improve this Doc View Source

    IsNotNullOrEmpty(String, String, String)

    The implementation shall check, if the input string is Null or an empty string.

    Declaration
    string IsNotNullOrEmpty(string input, string expression = null, string message = null)
    Parameters
    Type Name Description
    System.String input

    The instance under test.

    System.String expression

    The optional parameter name under test.

    System.String message

    The optional exception message that wil be used, if the method implementation throws.

    Returns
    Type Description
    System.String

    The input data, if no exception will be thrown.

    | Improve this Doc View Source

    IsNotNullOrWhiteSpace(String, String, String)

    The implementation shall check, if the input string is Null or a whitespace.

    Declaration
    string IsNotNullOrWhiteSpace(string input, string expression = null, string message = null)
    Parameters
    Type Name Description
    System.String input

    The instance under test.

    System.String expression

    The optional parameter name under test.

    System.String message

    The optional exception message that wil be used, if the method implementation throws.

    Returns
    Type Description
    System.String

    The input data, if no exception will be thrown.

    | Improve this Doc View Source

    IsUri(String, UriKind, String, String)

    The implementation shall check, if the input string is a valid Uri.

    Declaration
    string IsUri(string input, UriKind kind = null, string expression = null, string message = null)
    Parameters
    Type Name Description
    System.String input

    The instance under test.

    UriKind kind

    The uri kind. The default value is .

    System.String expression

    The optional parameter name under test.

    System.String message

    The optional exception message that wil be used, if the method implementation throws.

    Returns
    Type Description
    System.String

    The input data, if no exception will be thrown.

    | Improve this Doc View Source

    IsWebUri(String, String, String)

    The implementation shall check, if the input string is a valid Uri.

    Declaration
    string IsWebUri(string input, string expression = null, string message = null)
    Parameters
    Type Name Description
    System.String input

    The instance under test.

    System.String expression

    The optional parameter name under test.

    System.String message

    The optional exception message that wil be used, if the method implementation throws.

    Returns
    Type Description
    System.String

    The input data, if no exception will be thrown.

    | Improve this Doc View Source

    ToMailAddress(String, String, String)

    The implementation shall check, if the input string is a valid email address.

    Declaration
    MailAddress ToMailAddress(string input, string expression = null, string message = null)
    Parameters
    Type Name Description
    System.String input

    The instance under test.

    System.String expression

    The optional parameter name under test.

    System.String message

    The optional exception message that wil be used, if the method implementation throws.

    Returns
    Type Description
    MailAddress

    The input data as , if no exception will be thrown.

    | Improve this Doc View Source

    ToUri(String, String, String)

    The implementation shall check, if the input string is a valid Uri and shall convert the value into an in a successful case.

    Declaration
    Uri ToUri(string input, string expression = null, string message = null)
    Parameters
    Type Name Description
    System.String input

    The instance under test.

    System.String expression

    The optional parameter name under test.

    System.String message

    The optional exception message that wil be used, if the method implementation throws.

    Returns
    Type Description
    Uri

    The input data as , if no exception will be thrown.

    • GITHUB
    • Improve this Doc
    • View Source
    ☀
    ☾
    In This Article
    Back to top
    Copyright 2020-2022 TeleScope-dotnet. Generated by DocFX.
    ☀
    ☾