Skip to content

Instantly share code, notes, and snippets.

@nvg
Last active February 24, 2022 03:31
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nvg/656f0882a2319b4061458faf0db6aa92 to your computer and use it in GitHub Desktop.
Save nvg/656f0882a2319b4061458faf0db6aa92 to your computer and use it in GitHub Desktop.
peoplecode: PSUnit base
import TTS_UNITTEST:TestBase;
class Test extends TTS_UNITTEST:TestBase
method Test();
method Run();
method Setup();
protected
private
instance string &someValue;
end-class;
Component string &messages;
method Test
%Super = create TTS_UNITTEST:TestBase("Test");
&someValue = "";
end-method;
method Setup
/+ Extends/implements TTS_UNITTEST:TestBase.Setup +/
end-method;
method Run
/+ Extends/implements TTS_UNITTEST:TestBase.Run +/
&messages = "";
%This.Msg("Starting Run()");
/*
Local Record &recSomeRecord = CreateRecord(Record.SOME_RECORD);
SQLExec("SELECT * FROM SOME_RECORD WHERE SOME_VALUE = :1", &someValue, &recSomeRecord);
Local Record &recSomeOtherRecord = CreateRecord(Record.SOME_OTHER_RECORD);
SQLExec("SELECT * FROM SOME_OTHER_RECORD WHERE SOME_VALUE = :1", &someValue, &recSomeOtherRecord);
%This.AssertStringsEqual(&someRec.GetField(Field.NAME).Value, &someOtherRec.GetField(Field.NAME).Value, "Names don't match!");
*/
%This.Msg("Finished Run()");
end-method;
@david-hall-uwex
Copy link

Do you have a copy of the original PSUnit project you can share? The original has been dropped from the Oracle website, and I haven't found anyplace else it's available online...

@nvg
Copy link
Author

nvg commented Nov 6, 2018

Thank you for your interest, a copy should be available here: http://blog.psdev.ca/2017/09/psunit.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment