initial commit of Gregorian/IFC date conversion tools and unit tests
This commit is contained in:
35
test_isLeap.m
Normal file
35
test_isLeap.m
Normal file
@@ -0,0 +1,35 @@
|
||||
classdef test_isLeap < matlab.unittest.TestCase
|
||||
|
||||
methods(TestClassSetup)
|
||||
% Shared setup for the entire test class
|
||||
end
|
||||
|
||||
methods(TestMethodSetup)
|
||||
% Setup for each test
|
||||
end
|
||||
|
||||
methods(Test)
|
||||
% Test methods
|
||||
|
||||
function test_basic_2001(testCase)
|
||||
testCase.verifyFalse(isLeap(2001));
|
||||
end
|
||||
|
||||
function test_basic_1996(testCase)
|
||||
testCase.verifyTrue(isLeap(1996));
|
||||
end
|
||||
|
||||
function test_exception1_2100(testCase)
|
||||
testCase.verifyFalse(isLeap(2100));
|
||||
end
|
||||
|
||||
function test_exception2_2000(testCase)
|
||||
testCase.verifyTrue(isLeap(2000));
|
||||
end
|
||||
|
||||
function test_vectorized_all(testCase)
|
||||
testCase.verifyEqual([true; false; false; false; true; false], isLeap([2000; 1999; 1998; 1997; 1996; 2100]));
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user