public ulong CurrentLimit() { var quotaLimit = _diskQuotaControl.FindUser(_sid).QuotaLimit; if (quotaLimit > 0) { return((ulong)quotaLimit - _offset); } return(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 } }
public void DeletesDiskQuota() { var dskuser = Substitute.For <DIDiskQuotaUser>(); DiskQuotaControl.FindUser(User.SID).Returns(dskuser); Container.Destroy(); DiskQuotaControl.Received(1).DeleteUser(dskuser); }
public ContainerDiskQuotaTests() { diskQuotaControl = Substitute.For <DiskQuotaControl>(); quotaUser = Substitute.For <DIDiskQuotaUser>(); diskQuotaControl.FindUser(sid).Returns(quotaUser); }