c# - Assert.AreEqual failed. Expected: <(Null)> -
i'm working on coded ui test. when run test:
public partial class uimap { public uimap() { this.testinit(); } private handlingunitdatacontroller hudc = new handlingunitdatacontroller(); public datatransferhandlingunit testhu = new datatransferhandlingunit(); public void pressenter3() { list<datatransferhandlingunit> datalist; datalist = hudc.gethandlingunits(null); foreach (datatransferhandlingunit hu in datalist) { if (hu.idlabel == this.idlabelinputparams.uiscannboxedit2text) { testhu = hu; break; } } assert.areequal(testhu.idlabel,this.idlabelinputparams.uiscannboxedit2text); } occurs error:
assert.areequal failed expected:<(null)>
what do wrong? thanks.
my guess
if (hu.idlabel == this.idlabelinputparams.uiscannboxedit2text) does not evaluate true therefore
public datatransferhandlingunit testhu = new datatransferhandlingunit(); is still in testhu reference , testhu.idlabel null
Comments
Post a Comment