Show / Hide Table of Contents

    Class TestingExtensions

    A set of extension methods to be used in unit-testing scenarios. Should not be used in production.

    Inheritance
    Object
    TestingExtensions
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace:Realms.Sync.Testing
    Assembly:Realm.Sync.dll
    Syntax
    public static class TestingExtensions

    Methods

    | Improve this Doc View Source

    SimulateError(Session, ErrorCode, String, Boolean)

    Simulates a session error.

    Declaration
    public static void SimulateError(this Session session, ErrorCode errorCode, string message, bool isFatal = false)
    Parameters
    Type Name Description
    Session session

    The session where the simulated error will occur.

    ErrorCode errorCode

    Error code.

    String message

    Error message.

    Boolean isFatal

    If set to true the error will be marked as fatal.

    Remarks

    Use this method to test your error handling code without connecting to a Realm Object Server. Some error codes, such as OtherSessionError will be ignored and will not be reported to Error subscribers.

    | Improve this Doc View Source

    SimulateProgress(Session, UInt64, UInt64, UInt64, UInt64)

    Simulates a progress update.

    Declaration
    public static void SimulateProgress(this Session session, ulong downloadedBytes, ulong downloadableBytes, ulong uploadedBytes, ulong uploadableBytes)
    Parameters
    Type Name Description
    Session session

    Session which will report progress.

    UInt64 downloadedBytes

    Downloaded bytes.

    UInt64 downloadableBytes

    Downloadable bytes.

    UInt64 uploadedBytes

    Uploaded bytes.

    UInt64 uploadableBytes

    Uploadable bytes.

    Remarks

    Use this method to test your progress handling code without connecting to a Realm Object Server. Some throttling may occur at a native level, so it is recommended to use Task.Delay() between invocations.

    • Improve this Doc
    • View Source
    Back to top Copyright © 2017 Realm
    Generated by DocFX