private static void SetupObjects(TestDrawingObjectManager manager) { if (manager == null) { throw new ArgumentException("No manager."); } manager.Clear(); if (manager.ManagedObjects.Count != 0) { throw new ArgumentException("Objects not cleared."); } var objId1 = Guid.NewGuid(); var objId2 = Guid.NewGuid(); var obj1 = TestDrawingObject.CreateActiveObject(objId1); var obj2 = TestDrawingObject.CreateActiveObject(objId2); manager.Add(obj1); manager.Add(obj2); if (manager.ManagedObjects.Count != 2) { throw new ArgumentException("Incorrect count of objects."); } }
public bool VerifyAdditionResident() { try { Document doc = Application.DocumentManager.MdiActiveDocument; IReviewManager reviewer = CoreExtensionApplication._current.Container.GetRequiredService <IReviewManager>(); DataService data = DataService.Current; data.PopulateStoreTypes(); int startingItemCount = reviewer.GetUnverified(doc).Count(); TestDocumentStore testDocumentStore = data.GetStore <TestDocumentStore>(doc.Name); TestDrawingObjectManager objectManager = testDocumentStore.GetManager <TestDrawingObjectManager>(); objectManager.Add(TestDrawingObject.CreateActiveObject(Guid.NewGuid())); reviewer.Refresh(doc); int endItemCount = reviewer.GetUnverified(doc).Count(); int difference = (endItemCount - startingItemCount); return(difference == 1); } catch (Exception) { return(false); } }