Ejemplo n.º 1
0
        public void Should_not_downgrade_if_ExpirationDate_is_in_future()
        {
            string reason;
            var    expiredLicense = new License
            {
                ExpirationDate = DateTime.UtcNow.AddDays(2)
            };

            Assert.IsFalse(LicenseDowngrader.ShouldLicenseDowngrade(expiredLicense, out reason));
            Assert.IsNull(reason);
        }
Ejemplo n.º 2
0
        public void Should_downgrade_if_ExpirationDate_is_in_past()
        {
            string reason;
            var    expiredLicense = new License
            {
                ExpirationDate = DateTime.UtcNow.AddDays(-2)
            };

            Assert.IsTrue(LicenseDowngrader.ShouldLicenseDowngrade(expiredLicense, out reason));
            Assert.AreEqual("Your license has expired.", reason);
        }
Ejemplo n.º 3
0
        public void Should_downgrade_if_ExpirationDate_is_in_future_and_UpgradeProtection_is_expired()
        {
            string reason;
            var    expiredLicense = new License
            {
                ExpirationDate = DateTime.UtcNow.AddDays(2),
                UpgradeProtectionExpiration = TimestampReader.GetBuildTimestamp().AddDays(-2)
            };

            Assert.IsTrue(LicenseDowngrader.ShouldLicenseDowngrade(expiredLicense, out reason));
            Assert.AreEqual("Your upgrade protection does not cover this version of NServiceBus.", reason);
        }
Ejemplo n.º 4
0
        public void Should_not_downgrade_if_ExpirationDate_is_in_future_and_UpgradeProtection_is_not_expired()
        {
            string reason;
            var    expiredLicense = new License
            {
                ExpirationDate = DateTime.UtcNow.AddDays(2),
                UpgradeProtectionExpiration = TimestampReader.GetBuildTimestamp().AddDays(2)
            };

            Assert.IsFalse(LicenseDowngrader.ShouldLicenseDowngrade(expiredLicense, out reason));
            Assert.IsNull(reason);
        }