473,569 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Jul 21 '05 #1
1 2175
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
-----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 numberof 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, ByValKeyValue As Object) As Boolean
'ColCty procedure
'TODO: Returns a Boolean value indicating whethera 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
.

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
2751
by: Mon | last post by:
I am in the process of reorganizing my code and came across and I came across a problem, as described in the subject line of this posting. I have many classes that have instances of other classes as member variables. So including a forward declaration doesnt help, does it? Faced with these, I had the following options: -Include the...
4
1556
by: Malkocoglu | last post by:
In the good old days , i had a class that had 30 functions (let's say) There was a single include(*.H) file and i could have several implementation(*.CPP) files The reason for doing this is to have some functions grouped so it is easier to read/manage them... Maybe several developers work on the same class but on different parts of it in...
4
1476
by: d0wsdkn02 | last post by:
I need some architecture help. Our app is similar between clients, but every client has specific needs that can require us to change anything. I'll concentrate on one class below, but potentially any number of methods, fields, additional classes, or anything could need to be changed for a client. With two clients, one way to implement this...
4
2839
by: Ray Dukes | last post by:
What I am looking to do is map the implementation of interface properties and functions to an inherited method of the base class. Please see below. '**************************************************************************** ' Issues '****************************************************************************
8
3933
by: Gregory | last post by:
I have a question about using STL containers in C++ class public interface. Lets say that I want to return some container from class method or accept class method parameter as some container. For example: class A { public: const vector<int>& getTable() { return m_table; }
7
1787
by: ankitjain.bvcoe | last post by:
Hi i have the following problem in my design :::: i want to define an abstract class LogBuffer and derive two singleton classes from it i.e AlarmBuffer and FireWallBuffer.For this my design is such that i have to define data members in class LogBuffer.i.e ************************************************************************************...
2
2628
by: Jessica | last post by:
I have a base class and a derived class, but I am getting errors when I try to access functions of the derived class. Simplified version of my code is as follows: //////////////// // test2.hh class BaseClass {
7
10137
by: =?iso-8859-1?Q?S=F8ren_M._Olesen?= | last post by:
Hi How do I pass a complex type to a webservice?? What I have is a Class 'MyComplexClass' which lives in it's own dll/namespace. I'd like to pass this class to my webmethod: <WebMethod()_ Public Sub MyMethod(ByVal arg As MyComplexClass) End Sub
9
5833
by: Steve Richter | last post by:
in a generic class, can I code the class so that I can call a static method of the generic class T? In the ConvertFrom method of the generic TypeConvert class I want to write, I have a call to the static Parse method of the conversion class. if (InValue is string) return T.Parse((string)InValue); else return base.ConvertFrom(context,...
52
20835
by: Ben Voigt [C++ MVP] | last post by:
I get C:\Programming\LTM\devtools\UselessJunkForDissassembly\Class1.cs(360,27): error CS0535: 'UselessJunkForDissassembly.InvocableInternals' does not implement interface member 'UselessJunkForDissassembly.IInvocableInternals.OperationValidate(string)' C:\Programming\LTM\devtools\UselessJunkForDissassembly\Class1.cs(360,27): error CS0535:...
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7679
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5223
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2117
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.