Sha256: 655467e5c7c82c09941fa56c0cc5e107eac342fad99449b79e0d103999ee0487

Contents?: true

Size: 1.67 KB

Versions: 151

Compression:

Stored size: 1.67 KB

Contents

unit uLeapTests;

interface
uses
  DUnitX.TestFramework;

type

  [TestFixture]
  YearTest = class(TObject)
  public
    [Test]
//  [Ignore('Comment the "[Ignore]" statement to run the test')]
    procedure test_leap_year;

    [Test]
    [Ignore]
    procedure test_standard_and_odd_year;

    [Test]
    [Ignore]
    procedure test_standard_even_year;

    [Test]
    [Ignore]
    procedure test_standard_nineteenth_century;

    [Test]
    [Ignore]
    procedure test_standard_eighteenth_century;

    [Test]
    [Ignore]
    procedure test_leap_twenty_fourth_century;

    [Test]
    [Ignore]
    procedure test_leap_y2k;
  end;

implementation
uses uLeap;

procedure YearTest.test_leap_year;
begin
  assert.IsTrue(TYear.IsLeap(1996), 'Expected ''true'', 1996 is a leap year.');
end;

procedure YearTest.test_standard_and_odd_year;
begin
  assert.IsFalse(TYear.IsLeap(1997), 'Expected ''false'', 1997 is not a leap year.');
end;

procedure YearTest.test_standard_even_year;
begin
  assert.IsFalse(TYear.IsLeap(1998), 'Expected ''false'', 1998 is not a leap year.');
end;

procedure YearTest.test_standard_nineteenth_century;
begin
  assert.IsFalse(TYear.IsLeap(1900), 'Expected ''false'', 1900 is not a leap year.');
end;

procedure YearTest.test_standard_eighteenth_century;
begin
  assert.IsFalse(TYear.IsLeap(1800), 'Expected ''false'', 1800 is not a leap year.');
end;

procedure YearTest.test_leap_twenty_fourth_century;
begin
  assert.IsTrue(TYear.IsLeap(2400), 'Expected ''true'', 2400 is a leap year.');
end;

procedure YearTest.test_leap_y2k;
begin
  assert.IsTrue(TYear.IsLeap(2000), 'Expected ''true'', 2000 is a leap year.');
end;

initialization
  TDUnitX.RegisterTestFixture(YearTest);
end.

Version data entries

151 entries across 151 versions & 1 rubygems

Version Path
trackler-2.2.1.46 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.2.1.45 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.2.1.44 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.2.1.43 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.2.1.42 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.2.1.41 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.2.1.40 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.2.1.39 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.2.1.38 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.2.1.37 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.2.1.36 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.2.1.35 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.2.1.34 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.2.1.33 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.2.1.32 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.2.1.31 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.2.1.30 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.2.1.29 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.2.1.28 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.2.1.27 tracks/delphi/exercises/leap/uLeapTests.pas