public void AddUserToBlobSet()
        {
            using (TransactionScope ts = new TransactionScope())
            {
                BlobShareDataStoreEntities context    = BlobShareDataStoreEntities.CreateInstance();
                BlobSetService             setService = new BlobSetService(context);
                BlobSet set = new BlobSet()
                {
                    Name        = "Resource Set Test",
                    Description = "Resource Set Test"
                };
                setService.CreateBlobSet(set);

                User user = CreateUserForTest("testuser1", context);
                PermissionService service    = new PermissionService(context);
                Permission        permission = service.GrantPermissionToUserBlobSet(Privilege.Read, user, set, DateTime.UtcNow.AddDays(1));

                Assert.IsNotNull(permission);
                Assert.AreEqual(user, permission.Users.First());
                Assert.AreEqual(set, permission.BlobSet);
                Assert.AreEqual((int)Privilege.Read, permission.Privilege);

                IEnumerable <BlobSet> sets = service.GetBlobSetsByUser(user);

                Assert.IsNotNull(sets);
                Assert.AreEqual(1, sets.Count());
                Assert.AreEqual(set.BlobSetId, sets.First().BlobSetId);

                Assert.IsTrue(service.CheckPermissionToBlobSet(user.NameIdentifier, user.IdentityProvider, set.BlobSetId));
            }
        }