public override void RetireRepository(object key, MocksRepository repo) { var dict = currentRepositories.GetAllThreadsValues().FirstOrDefault(repos => repos.Any(pair => pair.Value.Target == repo)); if (dict != null) { var repositoryId = repo.RepositoryId; var repositoryPath = repo.GetRepositoryPath(); dict.Remove(key); repo.Retire(); #if !PORTABLE try { if (MockingContext.Plugins.Exists <IDebugWindowPlugin>()) { var debugWindowPlugin = MockingContext.Plugins.Get <IDebugWindowPlugin>(); debugWindowPlugin.RepositoryRetired(repositoryId, repositoryPath); } } catch (Exception e) { System.Diagnostics.Trace.WriteLine("Exception thrown calling IDebugWindowPlugin plugin: " + e); } #endif } }
public override void RetireRepository(object key, MocksRepository repo) { var dict = currentRepositories.GetAllThreadsValues().FirstOrDefault(repos => repos.Any(pair => pair.Value.Target == repo)); if (dict != null) { dict.Remove(key); repo.Retire(); } }
public static void RetireRepository() { var stackTrace = new StackTrace(); if (stackTrace.EnumerateFrames().Contains(contextMethod)) { contextRepository.Retire(); contextMethod = null; contextRepository = null; } }
public override void RetireRepository(object key, MocksRepository repo) { var dict = currentRepositories.GetAllThreadsValues().FirstOrDefault(repos => repos.Any(pair => pair.Value.Target == repo)); if (dict != null) { dict.Remove(key); repo.Retire(); } }