/// <summary> /// A method that can be called to manually initiate or cancel the Realm file deletion process. If the method /// isn't called at all, the Realm file will be deleted the next time your application is launched and the /// sync subsystem is initialized. Can only be called once. /// </summary> /// <returns><c>true</c> if actions were run successfully, <c>false</c> otherwise.</returns> public bool DeleteRealmUserInfo() { Argument.Ensure <NotSupportedException>(!_actionInvoked, $"{nameof(DeleteRealmUserInfo)} can only be called once."); _actionInvoked = true; return(SharedRealmHandleExtensions.ImmediatelyRunFileActions(_originalFilePath)); }
protected override void CustomSetUp() { base.CustomSetUp(); if (!string.IsNullOrEmpty(SyncTestHelpers.ProfessionalFeatureToken)) { SyncConfiguration.SetFeatureToken(SyncTestHelpers.ProfessionalFeatureToken); } var defaultFolder = InteropConfig.DefaultStorageFolder; if (TestHelpers.IsWindows) { // We do this to reduce the length of the folders in Windows var testsIndex = defaultFolder.IndexOf("\\Tests\\"); var docsIndex = defaultFolder.IndexOf("\\Documents") + 1; if (testsIndex > -1 && docsIndex > testsIndex) { defaultFolder = Path.Combine(defaultFolder.Substring(0, testsIndex), defaultFolder.Substring(docsIndex)) .Replace("\\Documents", "\\D"); Directory.CreateDirectory(defaultFolder); } } SharedRealmHandleExtensions.ConfigureFileSystem(persistence, null, false, defaultFolder); }
protected override void CustomSetUp() { base.CustomSetUp(); if (!string.IsNullOrEmpty(SyncTestHelpers.ProfessionalFeatureToken)) { SyncConfiguration.SetFeatureToken(SyncTestHelpers.ProfessionalFeatureToken); } SharedRealmHandleExtensions.ConfigureFileSystem(persistence, null, false); }
/// <summary> /// Initiates the client reset process. /// </summary> /// <returns><c>true</c> if actions were run successfully, <c>false</c> otherwise.</returns> public bool InitiateClientReset() { return(SharedRealmHandleExtensions.ImmediatelyRunFileActions(_originalFilePath)); }
public void SetUp() { SharedRealmHandleExtensions.ResetForTesting(); }