public void CreateSession() { var repo = new MockedRepository(); var repoService = new MockedServer.MockedServices.MockedRepositoryService(); repoService.RepositoryInfos.Add(repo.Object); repo.RepositoryService = repoService.Object; var session = repo.Object.CreateSession(); Assert.That(session, Is.Not.Null); Assert.That(session.GetRootFolder(), Is.EqualTo(repo.MockedRootFolder.Object)); var rootFolder = session.GetRootFolder(); rootFolder.DeleteTree(true, null, true); Assert.Throws<CmisObjectNotFoundException>(() => session.GetRootFolder()); Assert.Throws<CmisObjectNotFoundException>(() => rootFolder.DeleteTree(true, null, true)); }
public void CreateSession() { var repo = new MockedRepository(); var repoService = new MockedServer.MockedServices.MockedRepositoryService(); repoService.RepositoryInfos.Add(repo.Object); repo.RepositoryService = repoService.Object; var session = repo.Object.CreateSession(); Assert.That(session, Is.Not.Null); Assert.That(session.GetRootFolder(), Is.EqualTo(repo.MockedRootFolder.Object)); var rootFolder = session.GetRootFolder(); rootFolder.DeleteTree(true, null, true); Assert.Throws <CmisObjectNotFoundException>(() => session.GetRootFolder()); Assert.Throws <CmisObjectNotFoundException>(() => rootFolder.DeleteTree(true, null, true)); }