Question
· Dec 4, 2018

%Unit Test Case

This is the class which I want to test.

Class GSK.MyTestUnit Extends %RegisteredObject
{

ClassMethod Add(num1 As %Integer, num2 As %Integer)
{
s res=num1+num2
q res
}
}

This is my testing class.

Class GSK.TestingClass Extends %UnitTest.TestCase
{

Method test()
{
Do $$$AssertEquals(##class(GSK.MyTestUnit).Add(3,8),41, "Test Add(2,2)=4 passed ")
do $$$AssertNotEquals(##class(GSK.MyTestUnit).Add(3,8),11,"pass/fail")
}

}

The test cases are passed even though they should fail.

s ^UnitTestRoot="C:\TestSuite1"
d ##class(%UnitTest.Manager).RunTest("Test2")

Here TestSuite1 is my parent directory and Test2 is the folder which contains the test case file
please can anybody help me in this issue

Discussion (1)1
Log in or sign up to continue