Beispiel #1
0
        public void HasExpiredTest()
        {
            var keyInfo = new LicenseKey()
            {
                Expires = DateTime.Today.AddDays(1)
            };


            Assert.IsTrue(keyInfo.HasNotExpired()
                          .IsValid());


            keyInfo.Expires = DateTime.Today;

            Assert.IsTrue(keyInfo.HasNotExpired()
                          .IsValid());

            Assert.IsTrue(keyInfo.HasNotExpired(checkWithInternetTime: true)
                          .IsValid());


            keyInfo.Expires = DateTime.Today.AddDays(-1);

            Assert.IsTrue(!keyInfo.HasNotExpired()
                          .IsValid());
        }