'————————————————————————————————————————————— ' Name: Function DoPropertiesConform ' Purpose: Checks if the expected and actual properties match ' Input: ' m_htContextBase (Base Collection - this contains several child collections) ' Output: ' Boolean ' Date: ' Author: Anshoo Arora '————————————————————————————————————————————— Public Function DoPropertiesConform( ByVal m_htContextBase ) '————————————————————————————————————————————— Dim vKeys, intStatus, i, m_ContextTemp, bResult, keysTemp, oTemp, x, sStatus DoPropertiesConform = True vKeys = m_htContextBase.Keys intStatus = micPass For i = 0 to m_htContextBase.Count-1 ' The below will create temporary references to Collection ' In our test, the Collection contains two objects: "Logo" and "UserName" Set m_ContextTemp = m_htContextBase.Item(vKeys(i)) bResult = bResult & "<" keysTemp = m_ContextTemp.Keys If m_ContextTemp.Item(keysTemp(0)).Exist(0) Then ' Create a temporary reference to the object in the base collection ' Key values for these objects must always start with "Me" Set oTemp = m_ContextTemp.Item(keysTemp(0)) For x = 1 to m_ContextTemp.Count - 1 sStatus = "Pass" If Not CStr(oTemp.GetROProperty(keysTemp(x))) = CStr(m_ContextTemp.Item(keysTemp(x))) Then intStatus = micWarning sStatus = "Warning" End If bResult = bResult & "" Next Set m_ContextTemp = Nothing bResult = bResult & "
StatusPropertyExpectedActual
"&sStatus&""&KeysTemp(x)&""&m_ContextTemp.Item(keysTemp(x))&""&oTemp.GetROProperty(keysTemp(x))&"
>" & vbLf End If Next Reporter.ReportEvent intStatus, "DoPropertiesConform", bResult If intStatus <> micPass Then DoPropertiesConform = False Set m_htContextBase = Nothing Set m_ContextTemp = Nothing End Function