Ejemplo n.º 1
0
        public void RemoteDocumentCreationWithContent()
        {
            Mock <IMetaDataStorage> storage = MockMetaDataStorageUtil.GetMetaStorageMockWithToken();

            Mock <ISession> session = MockSessionUtil.GetSessionMockReturningDocumentChange(DotCMIS.Enums.ChangeType.Created, DefaultId, "someStreamId");

            ObservableHandler observer = this.RunQueue(session, storage);

            observer.AssertGotSingleFileEvent(MetaDataChangeType.CREATED, ContentChangeType.CREATED);
        }
Ejemplo n.º 2
0
        public void LocallyNotExistingRemoteDocumentUpdated()
        {
            Mock <IMetaDataStorage> storage = MockMetaDataStorageUtil.GetMetaStorageMockWithToken();

            Mock <ISession> session = MockSessionUtil.GetSessionMockReturningDocumentChange(DotCMIS.Enums.ChangeType.Updated, DefaultId, null);

            ObservableHandler observer = this.RunQueue(session, storage);

            observer.AssertGotSingleFileEvent(MetaDataChangeType.CREATED, ContentChangeType.CREATED);
        }
Ejemplo n.º 3
0
        public void RemoteDeletionChangeTest()
        {
            Mock <IMetaDataStorage> storage = MockMetaDataStorageUtil.GetMetaStorageMockWithToken();
            var file = Mock.Of <IFileInfo>(f => f.FullName == "path");

            storage.AddLocalFile(file, DefaultId);

            Mock <ISession>   session  = MockSessionUtil.GetSessionMockReturningDocumentChange(DotCMIS.Enums.ChangeType.Deleted, DefaultId, null);
            ObservableHandler observer = this.RunQueue(session, storage);

            observer.AssertGotSingleFileEvent(MetaDataChangeType.DELETED, ContentChangeType.NONE);
        }
Ejemplo n.º 4
0
        public void RemoteSecurityChangeOfExistingFile()
        {
            Mock <IMetaDataStorage> storage = MockMetaDataStorageUtil.GetMetaStorageMockWithToken();
            var path = Mock.Of <IFileInfo>(f => f.FullName == "path");

            storage.AddLocalFile(path, DefaultId);

            Mock <ISession>   session  = MockSessionUtil.GetSessionMockReturningDocumentChange(DotCMIS.Enums.ChangeType.Security, DefaultId);
            ObservableHandler observer = this.RunQueue(session, storage);

            storage.Verify(s => s.GetObjectByRemoteId(DefaultId), Times.Once());

            observer.AssertGotSingleFileEvent(MetaDataChangeType.CHANGED, ContentChangeType.NONE);
        }