LingoUnit FAQ

[ English | Japanese || Home | Project Summary ]
Last updated: Sat, 3 Nov 2001 10:59:22 GMT

Sorry, now writing. Japanese version is available.
I'm not good at English, and I'm waiting for your feedback. (mail/forum)


Contents


My TestCase using global variables failed. Why?


on setUp me
  global gValue
  gValue = 3
end

on testGlobalValue me
  global gValue
  me.assertEquals(6, gValue * 2)
end


My TestCase didn't appear in the list of the Tests. Why?


My Test member's name includes dot(".").

CastlibName.MemberName

put member(1).name
-- "MyTest.1"
put castlib(member(1, "LingoUnit").castlibNum).name
-- "Castlib.5"
script("TestRunner").run("Castlib\.5.MyTest\.1")


Error wasn't counted when I opened debugger. Why?


on debuggerTest
  put "main start"
  debuggerTestSub()
  put "main end"
end


on debuggerTestSub
  put "sub start"
  a = 1 / 0
  put "sub end"
end


What is the difference between addTest and addTestSuite?


script("TestSuite", "LingoUnit").new(member("MyTest", "Main"))


aTestSuite.addTestSuite(member("MyTest", "Main"))
aTestSuite.addTest(script("TestSuite", "LingoUnit").new(member("MyTest", "Main")))


How do I setup only once at the beginning of the test suite?


property ancestor


on new me, aTest
  ancestor = script("TestSetup", "LingoUnit").new(aTest)
  return me
end


on suite thisScript
  aTestSuite = script("TestSuite", "LingoUnit").new()
  -- add your tests and suites here.
  aTestSuite.addTest(script("AllTests", "LingoUnitTests").suite())

  aTestSetup = thisScript.new(aTestSuite)
  return aTestSetup
end


on setUp me
  -- write your additional setUp code here.
  -- (This runs at the begining of the suite.)
  put "setup"
end


on tearDown me
  -- write your additional tearDown code.
  -- (This runs at the end of the suite.)
  put "teardown"
end


How do I repeat a Test?


on suite thisScript
  timesRepeat = 3
  aTest = script("AllTests", "LingoUnitTests").suite()

  aRepeatedTest = script("RepeatedTest", "LingoUnit").new(aTest, timesRepeat)
  aTestSuite = script("TestSuite", "LingoUnit").new()
  aTestSuite.addTest(aRepeatedTest)
  return aTestSuite
end


I couldn't re-run my failed TestCase. Why?


How do I change the default status of the "Show error dialog" checkbox?

script("TestRunner").run(script("MyTest").new("test1"))
aTestSuite.addTest(script("MyTest").new("test1"))

-- string
script("TestRunner").run("MyTest")

-- member
script("TestRunner").run(member("MyTest"))
aTestSuite.addTestSuite(member("MyTest"))


I want to run my tests in my own scripts.


aTestResult = script("MyTest", "Castlib").run()
if aTestResult.wasSuccessful() then
  put "OK"
end if


aTestResult = script("AllTests", "Castlib").suite().run()
if aTestResult.wasSuccessful() then
  put "OK"
end if


aTestResult = script("TestResult", "LingoUnit").new()
script("MyTest", "Castlib").run(aTestResult)
script("AllTests", "Castlib").suite().run(aTestResult)
if aTestResult.wasSuccessful() then
  put "OK"
end if


How do I create an original Report?


property ancestor


on new me, aWriter
  ancestor = script("BaseReport", "LingoUnit").new(aWriter)
  return me
end


on startTest me, aTest
  me.println("Running: " & aTest.toString())
end


on addError me, aTest, anExceptionError
  me.println("Error: " & aTest.toString() & ": " & anExceptionError.toString())
end


on addFailure me, aTest, anExceptionFailure
  me.println("Failure: " & aTest.toString() & ": " & anExceptionFailure.toString())
end


GUITestRunner freezed.

script("WindowProxy", "LingoUnit").kill("GUITestRunner")

How do I build Shockwave version?


What is "me.__abstruct__()"?


What is "thisScript"?


Koseki Kengo <kengo@tt.rim.or.jp>