Class TestingExtensions
A set of extension methods to be used in unit-testing scenarios. Should not be used in production.
Inherited Members
Namespace: Realms.Sync.Testing
Assembly: Realm.Sync.dll
Syntax
public static class TestingExtensions
Methods
| Improve this Doc View SourceSimulateError(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 |
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.
SimulateProgress(Session, UInt64, UInt64, UInt64, UInt64)
Simulates a progress update.
Declaration
[Obsolete("This method no longer works and will be removed in a future version of the SDK.")]
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.