public void Cannot_execute_LicenseeQueries_without_permissions()
        {
            /* Arrange */
            LogWithNewAdmin(Modules.LicenseeManager, Permissions.View);

            /* Act */
            Assert.Throws <InsufficientPermissionsException>(() => _licenseeQueries.GetRenewContractData(new Guid()));
        }
Exemplo n.º 2
0
        public string RenewContract(Guid licenseeId)
        {
            var licensee = _licenseeQueries.GetRenewContractData(licenseeId);

            if (licensee == null)
            {
                return(null);
            }

            var data = new
            {
                name            = licensee.Name,
                companyName     = licensee.CompanyName,
                affiliateSystem = licensee.AffiliateSystem,
                contractStart   = Format.FormatDate(licensee.ContractStart, false),
                contractEnd     = licensee.ContractEnd.HasValue ? Format.FormatDate(licensee.ContractEnd, false) : null,
                email           = licensee.Email,
                timeZone        = TimeZoneInfo.FindSystemTimeZoneById(licensee.TimezoneId).DisplayName,
                contractStatus  = _licenseeQueries.GetContractStatus(licensee.Contracts.Single(x => x.IsCurrentContract))
            };

            return(SerializeJson(data));
        }