Sha256: e3eaffaf476280364bdbfcbe8ecfebc4d03da0aa5c9e98c4693c4e44bd957660

Contents?: true

Size: 1.61 KB

Versions: 46

Compression:

Stored size: 1.61 KB

Contents

unit uLeapTests;

interface
uses
  DUnitX.TestFramework;

type

  [TestFixture]
  YearTest = class(TObject)
  public
    [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

46 entries across 46 versions & 1 rubygems

Version Path
trackler-2.0.8.12 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.0.8.11 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.0.8.10 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.0.8.9 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.0.8.8 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.0.8.7 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.0.8.6 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.0.8.5 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.0.8.4 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.0.8.3 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.0.8.2 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.0.8.1 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.0.7.0 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.0.6.44 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.0.6.43 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.0.6.42 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.0.6.41 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.0.6.40 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.0.6.39 tracks/delphi/exercises/leap/uLeapTests.pas
trackler-2.0.6.38 tracks/delphi/exercises/leap/uLeapTests.pas