<commit_before>"
I represent one of several Sunit test Cases intentended to provide complete coverage for the Chronology set of classes as part of the external testing. tlk.
My fixtures are:
aDateAndTime = February 29, 2004 1:33 PM with offset: 2 hours
aDuration = 15 days, 14 hours, 13 minutes, 12 seconds and 11 nano seconds.
aTimeZone =  Grenwhich Meridian (local offset = 0 hours) 
"
Class {
	#name : #DateAndTimeLeapTest,
	#superclass : #TestCase,
	#instVars : [
		'aDateAndTime',
		'aDuration',
		'aTimeZone',
		'localTimeZoneToRestore'
	],
	#category : #'Kernel-Tests-Chronology'
}

{ #category : #running }
DateAndTimeLeapTest >> setUp [
	super setUp.
	aDateAndTime := (DateAndTime 
		year: 2004 month: 2 day: 29 
		hour: 13 minute: 33 second: 0 
		offset: 2 hours).
	aTimeZone := TimeZone default.
	aDuration := Duration days: 0 hours: 13 minutes: 33 seconds: 0 nanoSeconds: 0

]

{ #category : #tests }
DateAndTimeLeapTest >> testAsDate [
	self assert: aDateAndTime asDate equals:  ('February 29, 2004' asDate translateTo: 2 hours).
]

{ #category : #tests }
DateAndTimeLeapTest >> testAsDuration [
	self assert: aDateAndTime asDuration equals: aDuration
	

]

{ #category : #tests }
DateAndTimeLeapTest >> testAsLocal [
	self assert: aDateAndTime asLocal =  aDateAndTime.
	self assert: aDateAndTime asLocal = (aDateAndTime offset: aDateAndTime class localOffset)

	

]

{ #category : #tests }
DateAndTimeLeapTest >> testAsMonth [
	self
		assert: aDateAndTime asMonth
		equals: (Month year: 2004 month: 'February').

]

{ #category : #tests }<commit_msg>20700: Fix DateAndTimeLeapTest>>testAsMonth          The test used a DateAndTime with an offset of 2 hours, but the compared it to a month on UTC.  This previoiusly worked due to a bug in ignoring the offset when creating a Month.          Modify the test to use an offset of 2 hours.<commit_after>"
I represent one of several Sunit test Cases intentended to provide complete coverage for the Chronology set of classes as part of the external testing. tlk.
My fixtures are:
aDateAndTime = February 29, 2004 1:33 PM with offset: 2 hours
aDuration = 15 days, 14 hours, 13 minutes, 12 seconds and 11 nano seconds.
aTimeZone =  Grenwhich Meridian (local offset = 0 hours) 
"
Class {
	#name : #DateAndTimeLeapTest,
	#superclass : #TestCase,
	#instVars : [
		'aDateAndTime',
		'aDuration',
		'aTimeZone',
		'localTimeZoneToRestore'
	],
	#category : #'Kernel-Tests-Chronology'
}

{ #category : #running }
DateAndTimeLeapTest >> setUp [
	super setUp.
	aDateAndTime := (DateAndTime 
		year: 2004 month: 2 day: 29 
		hour: 13 minute: 33 second: 0 
		offset: 2 hours).
	aTimeZone := TimeZone default.
	aDuration := Duration days: 0 hours: 13 minutes: 33 seconds: 0 nanoSeconds: 0

]

{ #category : #tests }
DateAndTimeLeapTest >> testAsDate [
	self assert: aDateAndTime asDate equals:  ('February 29, 2004' asDate translateTo: 2 hours).
]

{ #category : #tests }
DateAndTimeLeapTest >> testAsDuration [
	self assert: aDateAndTime asDuration equals: aDuration
	

]

{ #category : #tests }
DateAndTimeLeapTest >> testAsLocal [
	self assert: aDateAndTime asLocal =  aDateAndTime.
	self assert: aDateAndTime asLocal = (aDateAndTime offset: aDateAndTime class localOffset)

	

]

{ #category : #tests }
DateAndTimeLeapTest >> testAsMonth [
	self
		assert: aDateAndTime asMonth
		equals: ((Month year: 2004 month: 'February') translateTo: 2 hours).

]

{ #category : #tests }
{'fraction_non_alphanumeric': 0.09351256575102279, 'fraction_numerical': 0.03272939801285798, 'mean_word_length': 4.32348367029549, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2226478', 'n_tokens_mistral': 1257, 'n_tokens_neox': 1098, 'n_words': 390}