public void CanAddUpdateRemove() { //TODO: make this test resilient to other changes using (var remoteClient = Context.CreateFinancialClient()) { var snapshotMaster = remoteClient.MarketDataSnapshotMaster; using (var view = MasterView.Create(snapshotMaster)) { //TODO check events var name = TestUtils.GetUniqueName(); AssertValidView(view.Documents); int count = view.Documents.Count; var marketDataSnapshotDocument = snapshotMaster.Add(RemoteMarketDataSnapshotMasterTests.GetDocument(name)); Thread.Sleep(TimeSpan.FromSeconds(1)); AssertValidView(view.Documents); int count2 = view.Documents.Count; Assert.Equal(count + 1, count2); int index = IndexOf(view.Documents, marketDataSnapshotDocument.UniqueId.ObjectID); Assert.InRange(index, 0, view.Documents.Count); marketDataSnapshotDocument.Snapshot.Name = marketDataSnapshotDocument.Snapshot.Name + " Updated"; snapshotMaster.Update(marketDataSnapshotDocument); Thread.Sleep(TimeSpan.FromSeconds(1)); AssertValidView(view.Documents); int count4 = view.Documents.Count; Assert.Equal(count2, count4); int updatedIndex = IndexOf(view.Documents, marketDataSnapshotDocument.UniqueId.ObjectID); Assert.Equal(index, updatedIndex); snapshotMaster.Remove(marketDataSnapshotDocument.UniqueId); Thread.Sleep(TimeSpan.FromSeconds(1)); AssertValidView(view.Documents); int count3 = view.Documents.Count; Assert.Equal(count, count3); } } }