public DiaryPresenter(IClock clock, Diary diary, License license) { this.clock = clock; this.diary = diary; this.license = license; Debug.WriteLine("DiaryPresenter Constructor"); }
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); }
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); }
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"); } }
/// <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(); }
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(); }