예제 #1
0
        public async Task CreateFolderForUser_NotUniqueName_ExceptionThrown()
        {
            var db      = CreateAndSeedDb();
            var service = new FolderService(db);

            await Assert.ThrowsAsync <BadRequestException>(async() =>
            {
                await service.CreateFolderForUserAsync("895973FB-F8E1-4FD6-89C4-DC13CED4780E", "Folder1");
            });
        }
예제 #2
0
        public async Task CreateFolderForUser_FolderCreated()
        {
            var db         = CreateAndSeedDb();
            var service    = new FolderService(db);
            var userId     = Guid.NewGuid().ToString();
            var folderName = "Folder";

            await service.CreateFolderForUserAsync(userId, folderName);

            Assert.Contains(db.Folders, folder => folder.OwnerId == userId && folder.Name == folderName);
        }