コード例 #1
0
        public void FirstRunTrialAndBuyBeforeExpiration()
        {
            var manager = new MockTrialManager();

            manager.DetermineIsTrail();
            Assert.IsFalse(ApplicationState.IsFree);//trial mode is a time limited full application
            Assert.IsNotNull(Settings.TrialStarted);
            Assert.IsTrue(manager.RetrievedFromService);
            Assert.AreEqual(DateTime.UtcNow.Date, Settings.TrialStarted.Value.Date);
            manager.RetrievedFromService = false;
            //buy now
            manager.LicenceTrial = false;
            manager.DetermineIsTrail();
            Assert.IsFalse(manager.RetrievedFromService);
            Assert.IsFalse(ApplicationState.IsFree);
            Assert.IsNull(Settings.TrialStarted);
        }
コード例 #2
0
        public void FirstRunTrialAndBuyAfterExpiration()
        {
            var manager   = new MockTrialManager();
            var startTime = DateTime.UtcNow.AddDays(-300);

            Settings.TrialStarted = startTime;
            manager.DetermineIsTrail();
            Assert.IsTrue(ApplicationState.IsFree);//trial mode after expiration is a free version
            Assert.IsNotNull(Settings.TrialStarted);
            Assert.IsFalse(manager.RetrievedFromService);
            Assert.AreEqual(startTime, Settings.TrialStarted.Value);
            manager.RetrievedFromService = false;
            //buy now
            manager.LicenceTrial = false;
            manager.DetermineIsTrail();
            Assert.IsFalse(manager.RetrievedFromService);
            Assert.IsFalse(ApplicationState.IsFree);
            Assert.IsNull(Settings.TrialStarted);
        }
コード例 #3
0
        public void FirstRunPro()
        {
            var manager = new MockTrialManager();

            manager.LicenceTrial = false;
            manager.DetermineIsTrail();
            Assert.IsFalse(manager.RetrievedFromService);
            Assert.IsFalse(ApplicationState.IsFree);
            Assert.IsNull(Settings.TrialStarted);
        }