I'm creating my own SortedList collection class that implements IDictionary,
ICollection, and IEnumerable. The code compiles.

I am writing a unit test to exercise it. I can create the object but none
of the methods like Add are available. The only thing that shows in
Intellisense is:

Equals
GetHashCode
GetType
ToString

What am I doing wrong??

Re: Implemented interface methods are not available and do not show in Intellisense? by Jon

Jon
Sun Mar 26 01:28:10 CST 2006

Dave <none@nowhere.com> wrote:
> I'm creating my own SortedList collection class that implements IDictionary,
> ICollection, and IEnumerable. The code compiles.
>
> I am writing a unit test to exercise it. I can create the object but none
> of the methods like Add are available. The only thing that shows in
> Intellisense is:
>
> Equals
> GetHashCode
> GetType
> ToString
>
> What am I doing wrong??

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

If you've implemented the interface explicitly (i.e. your methods look
like void IDictionary.Add (...) etc) then you'll need to cast the
subject of your test to the interfaces before calling the method:

IDictionary dict = sortedList;
dict.Clear (...)

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Re: Implemented interface methods are not available and do not show in Intellisense? by n4ixt

n4ixt
Mon Mar 27 06:29:40 CST 2006

Might help if you posted some code so we could see.

"Dave" <none@nowhere.com> wrote in message
news:%238RAVBGUGHA.5836@TK2MSFTNGP10.phx.gbl...
> I'm creating my own SortedList collection class that implements
> IDictionary, ICollection, and IEnumerable. The code compiles.
>
> I am writing a unit test to exercise it. I can create the object but none
> of the methods like Add are available. The only thing that shows in
> Intellisense is:
>
> Equals
> GetHashCode
> GetType
> ToString
>
> What am I doing wrong??
>
>
>



----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----