Пример #1
0
        public ulong CurrentLimit()
        {
            var quotaLimit = _diskQuotaControl.FindUser(_sid).QuotaLimit;

            if (quotaLimit > 0)
            {
                return((ulong)quotaLimit - _offset);
            }

            return(0);
        }
Пример #2
0
 private void deleteUserDiskQuota()
 {
     try
     {
         var dskuser = diskQuotaControl.FindUser(user.SID);
         diskQuotaControl.DeleteUser(dskuser);
     }
     catch (COMException)
     {
         // we can't determine if a disk quota exists for a given user
         // so we just have to try to delete it and catch the exception
     }
 }
Пример #3
0
            public void DeletesDiskQuota()
            {
                var dskuser = Substitute.For <DIDiskQuotaUser>();

                DiskQuotaControl.FindUser(User.SID).Returns(dskuser);

                Container.Destroy();

                DiskQuotaControl.Received(1).DeleteUser(dskuser);
            }
Пример #4
0
 public ContainerDiskQuotaTests()
 {
     diskQuotaControl = Substitute.For <DiskQuotaControl>();
     quotaUser        = Substitute.For <DIDiskQuotaUser>();
     diskQuotaControl.FindUser(sid).Returns(quotaUser);
 }