|
// Copyright � Keith Barrett 2008.
using System;
using System.Collections.Generic;
using System.Text;
namespace KMB.Library.Collections.Tests
{
/// <summary>
/// Test class for collections.
/// </summary>
public class Customer
{
public Customer(int refNumber, string firstName, string LastName)
{
m_refNumber = refNumber;
m_firstName = firstName;
m_lastName = LastName;
}
private int m_refNumber;
private string m_firstName;
private string m_lastName;
public override string ToString()
{
return string.Format("customer{0}", m_refNumber);
}
// Override the hash function so we get predictability of ordering in hash sets
// (otherwise we get the memory address):
public override int GetHashCode()
{
return m_refNumber;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I have been working in IT since 1975, in various roles from junior programmer to system architect, and with many different languages and platforms. I have written shedloads of code.
I now live in Bedfordshire, England. As well as working full time I am the primary carer for my wife who has MS. I am learning to play the piano. I have three grown up children and a cat.