コード例 #1
0
        public async void DirectoryDelete_RootDir_Should_Not_Be_Deletable()
        {
            var user1 = await UserManager.GenerateUser();

            await Assert.ThrowsAsync <ObjectNotResolvableException>(async() =>
                                                                    await DirectoryManager.Delete(user1.UserId, user1.RootDirectoryId)
                                                                    );

            var metadata = await DirectoryManager.GetDirectoryMetadata(user1.UserId, user1.RootDirectoryId, null);

            Assert.NotNull(metadata);
        }
コード例 #2
0
        public async void DirectoryDelete()
        {
            var user1 = await UserManager.GenerateUser();

            var subDirectoryId = IdGenerator.NewId(IdType.Directory);

            Assert.True(await DirectoryManager.InsertDirectory(
                            user1.UserId,
                            user1.RootDirectoryId,
                            "Dir1",
                            subDirectoryId));

            Assert.Equal(new string[0], await DirectoryManager.Delete(user1.UserId, subDirectoryId));


            await Assert.ThrowsAsync <ObjectNotResolvableException>(
                async() => await DirectoryManager.GetDirectoryMetadata(user1.UserId, subDirectoryId, null));
        }