I have the following code:
<TestMethod()> _
Public Sub GetDirectoryEntryTest()
Dim path As String = runner.getLDAPPath()
Dim expected As DirectoryEntry = runner.GetDirectoryEntry()
Dim actual As DirectoryEntry
actual = LDAPBase.GetDirectoryEntry(path)
Assert.AreEqual(expected, actual)
End Sub
This unit test does not work. Objects are DirectoryEntryexactly the same, but different references to different objects. I come from a Java background where you always have it .equals().
What can I do so that it evaluates correctly and returns true, since for all purposes and objects the objects are equal. Is there something I can do, as in Java, and override equals ()?
source
share