DEFINE CLASS wwHttpTests as FxuTestCase OF FxuTestCase.prg

*** SETUP AND CONFIGURATION *** 

************************************************************************
*  Setup
****************************************
***  Function:
***    Assume:
***      Pass:
***    Return:
************************************************************************
FUNCTION Setup()

	*** Make sure libraries are loaded
	DO wconnect
ENDFUNC
*   Setup

************************************************************************
*  TearDown
****************************************
***  Function:
***    Assume:
***      Pass:
***    Return:
************************************************************************
FUNCTION TearDown()

ENDFUNC
*   TearDown


************************************************************************
*  InternetCrackUrl
****************************************
***  Function:
***    Assume:
***      Pass:
***    Return:
************************************************************************
FUNCTION InternetCrackUrl()

loHttp = CREATEOBJECT("wwHttp")
loUrl = loHttp.InternetCrackUrl("http://west-wind.com:81/asdasdsadasd:test")
THIS.AssertTrue(loUrl.cPort == "81","failed to get port number")

loUrl = loHttp.InternetCrackUrl("http://west-wind.com/asdasdsadasd:test")
THIS.AssertTrue(loUrl.cPort != "test","failed to detect port properly - string instead of port number")
THIS.AssertTrue(ATC(":",loUrl.cPath) > 0,"Path should include the :test string")

loUrl = loHttp.InternetCrackUrl("http://west-wind.com/asdasdsadasd:22test/")
THIS.AssertTrue(loUrl.cPort != "22test","failed to detect port properly - string instead of port number")


loUrl = loHttp.InternetCrackUrl("http://west-wind.com/asdasdsadasd:22/")
THIS.AssertTrue(loUrl.cPort != "22","port number in path is not valid")



ENDFUNC
*   InternetCrackUrl


ENDDEFINE
