Esempio n. 1
0
 public DiaryPresenter(IClock clock, Diary diary, License license)
 {
     this.clock = clock;
     this.diary = diary;
     this.license = license;
     Debug.WriteLine("DiaryPresenter Constructor");
 }
Esempio n. 2
0
 public void LicenseIsValid()
 {
     var expiry = Instant.FromUtc(2000, 1, 1, 0, 0, 0);
     var clock = new StubClock(expiry - Duration.One);
     var license = new License(expiry, clock);
     Debug.WriteLine("License valid");
     Assert.IsFalse(license.HasExpired);
 }
Esempio n. 3
0
 public void ExpiredLicense()
 {
     var expiry = Instant.FromUtc(2000, 1, 1, 0, 0, 0);
     var clock = new StubClock(expiry + Duration.One);
     var license = new License(expiry, clock);
     Debug.WriteLine("License expired");
     Assert.IsTrue(license.HasExpired);
 }
Esempio n. 4
0
 private static void LicenseTest()
 {
     var x = new License(Instant.FromUtc(2012, 10, 17, 0, 0, 0), SystemClock.Instance);
     if (x.HasExpired)
     {
         Debug.WriteLine("Program License Expired");
     }
 }
Esempio n. 5
0
        /// <summary>
        /// The main.
        /// </summary>
        /// <param name="args">
        /// The args. 
        /// </param>
        private static void Main(string[] args)
        {
            var c = new SingletonClient();
            c.UseSingleton();

            var d = new LicenseClient();
            d.ExpiredLicense();
            d.LicenseIsValid();

            var x = new License(Instant.FromUtc(2012, 10, 17, 0, 0, 0), SystemClock.Instance);
            if (x.HasExpired)
            {
                Debug.WriteLine("Program License Expired");
            }

            var y = new DiaryClient();
            y.FormatTodayIsoUtc();
        }
Esempio n. 6
0
 private static void ManualDependencyInjectionTest()
 {
     var c = SystemClock.Instance;
     var l = new License(Instant.UnixEpoch, c);
     var d = new Diary(c, CalendarSystem.Iso, DateTimeZone.GetSystemDefault());
     var p = new DiaryPresenter(c, d, l);
     p.Start();
 }