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.1.0.28 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.1.0.27 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.1.0.26 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.1.0.25 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.1.0.24 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.1.0.23 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.1.0.22 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.1.0.21 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.1.0.20 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.1.0.19 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.1.0.18 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.1.0.17 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.1.0.16 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.1.0.15 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.1.0.14 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.1.0.13 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.1.0.12 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.1.0.11 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.1.0.10 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.1.0.9 tracks/delphi/exercises/leap/uLeapTests.pas