コード例 #1
0
        public async Task CreateDefaultFoldersForUser_FoldersCreated()
        {
            var db      = CreateAndSeedDb();
            var service = new FolderService(db);

            var userId = Guid.NewGuid().ToString();
            await service.CreateDefaultFoldersForUserAsync(userId);

            Assert.Contains(db.Folders,
                            folder =>
                            folder.IsDefault &&
                            folder.Name == "Favorite Movies" &&
                            folder.OwnerId == userId);

            Assert.Contains(db.Folders,
                            folder =>
                            folder.IsDefault &&
                            folder.Name == "Watch Later" &&
                            folder.OwnerId == userId);
        }