Compile function Test_WO_MAT_SERVICES(@Test)
#pragma precomp SRP_PreCompiler

$Insert LOGICAL

Declare function WO_MAT_Services, Error_Services
Declare subroutine WO_MAT_Services, Error_Services

GotoTest

Error_Services('Clear')

Return TestResult or 1

//-----------------------------------------------------------------------------
// TESTS
//-----------------------------------------------------------------------------

Test CassetteIsLastInWoWithEmptyWoMatKeyShouldThrowError
	WO_MAT_Services('CassetteIsLastInWo', '')
	
	ErrorWasThrown = Error_Services('HasError')
	
	Assert ErrorWasThrown equals True$
End Test

Test CassetteIsLastInWoWithFirstCassetteShouldReturnFalse
	IsLastCassette = WO_MAT_Services('CassetteIsLastInWo', '173137*1')
	
	Assert Error_Services('NoError')
	
	Assert IsLastCassette EQ False$
end test

Test CassetteIsLastInWoWithLastCassetteShouldReturnTrue
	IsLastCassette = WO_MAT_Services('CassetteIsLastInWo', '173137*66')
	
	Assert Error_Services('NoError')
	
	Assert IsLastCassette EQ True$
end test

