Class Implementation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rodney

    #1

    Class Implementation

    Hi all,

    Can someone please show me how to unit test this class
    listed below:


    Public MustInherit Class DataCollectionB ase
    Implements IEnumerable, IEnumerator
    Protected m_dv As DataView
    Protected m_iCursor As Integer
    Public ReadOnly Property Count() As Integer
    Get
    'TODO: Return a Count
    'Master-Detail Navigating
    End Get
    End Property
    Public Property Sort() As String
    Get
    'TODO: Gets the sort string for the
    underlying DataView. Uses the same syntax as the
    System.Data.Dat aView class
    End Get
    Set(ByVal Value As String)
    'TODO: Sets the sort string for the
    underlying DataView.
    End Set
    End Property

    Public Function GetEnumerator() As
    System.Collecti ons.IEnumerator Implements
    System.Collecti ons.IEnumerable .GetEnumerator
    'Returns an object implementing the IEnumerator
    interface.
    End Function

    Protected ReadOnly Property Current() As Object
    Implements System.Collecti ons.IEnumerator .Current
    Get
    'TODO: MustInherit method to retrieve the
    current object in the collection for the For Each
    construct.
    End Get
    End Property

    Public Function MoveNext() As Boolean Implements
    System.Collecti ons.IEnumerator .MoveNext
    'TODO: If m_iCursor is less than the total number
    of items in the collection, this function increments
    m_iCursor and returns True. Otherwise, False is returned.
    End Function

    Public Sub Reset() Implements
    System.Collecti ons.IEnumerator .Reset
    'TODO: Reinitializes m_iCursor.
    End Sub
    Public Sub Clear()
    'ColCty procedure
    'TODO: Clears the table underlying the internal
    DataView object.
    End Sub
    Public Function Exists(ByVal KeyName As String, ByVal
    KeyValue As Object) As Boolean
    'ColCty procedure
    'TODO: Returns a Boolean value indicating whether
    a particular item exists in the internal DataView.
    End Function
    Public Sub Remove(ByVal KeyName As String, ByVal
    KeyValue As Object)
    'ColCty procedure
    'TODO: Removes an item from the DataTable
    underlying the internal DataView.
    End Sub

    End Class



    Thanks in advance,
    Rodney
  • Rodney

    #2
    Class Implementation

    Alright, let me start with a simpler question. This was
    given to me in an Implementation Spec and I'm not sure
    how to implement it. I know there's a User Collection
    class that inherits it, as well as an Address Collection
    class.

    Can someone explain to me what this class might be for?
    Also, is anyone available on Messenger to chat with me
    about this class? Just whenever is a good time for me.

    Thanks for any help in advance,
    Rodney[color=blue]
    >-----Original Message-----
    >Hi all,
    >
    >Can someone please show me how to unit test this class
    >listed below:
    >
    >
    >Public MustInherit Class DataCollectionB ase
    > Implements IEnumerable, IEnumerator
    > Protected m_dv As DataView
    > Protected m_iCursor As Integer
    > Public ReadOnly Property Count() As Integer
    > Get
    > 'TODO: Return a Count
    > 'Master-Detail Navigating
    > End Get
    > End Property
    > Public Property Sort() As String
    > Get
    > 'TODO: Gets the sort string for the
    >underlying DataView. Uses the same syntax as the
    >System.Data.Da taView class
    > End Get
    > Set(ByVal Value As String)
    > 'TODO: Sets the sort string for the
    >underlying DataView.
    > End Set
    > End Property
    >
    > Public Function GetEnumerator() As
    >System.Collect ions.IEnumerato r Implements
    >System.Collect ions.IEnumerabl e.GetEnumerator
    > 'Returns an object implementing the IEnumerator
    >interface.
    > End Function
    >
    > Protected ReadOnly Property Current() As Object
    >Implements System.Collecti ons.IEnumerator .Current
    > Get
    > 'TODO: MustInherit method to retrieve the
    >current object in the collection for the For Each
    >construct.
    > End Get
    > End Property
    >
    > Public Function MoveNext() As Boolean Implements
    >System.Collect ions.IEnumerato r.MoveNext
    > 'TODO: If m_iCursor is less than the total[/color]
    number[color=blue]
    >of items in the collection, this function increments
    >m_iCursor and returns True. Otherwise, False is returned.
    > End Function
    >
    > Public Sub Reset() Implements
    >System.Collect ions.IEnumerato r.Reset
    > 'TODO: Reinitializes m_iCursor.
    > End Sub
    > Public Sub Clear()
    > 'ColCty procedure
    > 'TODO: Clears the table underlying the internal
    >DataView object.
    > End Sub
    > Public Function Exists(ByVal KeyName As String,[/color]
    ByVal[color=blue]
    >KeyValue As Object) As Boolean
    > 'ColCty procedure
    > 'TODO: Returns a Boolean value indicating[/color]
    whether[color=blue]
    >a particular item exists in the internal DataView.
    > End Function
    > Public Sub Remove(ByVal KeyName As String, ByVal
    >KeyValue As Object)
    > 'ColCty procedure
    > 'TODO: Removes an item from the DataTable
    >underlying the internal DataView.
    > End Sub
    >
    >End Class
    >
    >
    >
    >Thanks in advance,
    >Rodney
    >.
    >[/color]

    Comment

    Working...