Solved

C# Override referenced method

Posted on 2012-03-29
2
243 Views
Last Modified: 2012-04-17
I'm seeking to extend and existing method that I've referenced in my VS2008 project.  I'm trying to extend the NUnit "Assert.True(Boolean sample)" to incorporate custom reporting functionality.  Where can I find an example doing this?  I've looked on Google and cannot find any great tutorials on this topic.
0
Comment
Question by:Phil5780
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 40

Assisted Solution

by:Kyle Abrahams
Kyle Abrahams earned 250 total points
ID: 37783296
You would have to inherit the class and then override it.  Calling MyBase or base. as needed and adding other functionality.
0
 
LVL 16

Accepted Solution

by:
Easwaran Paramasivam earned 250 total points
ID: 37796960
You can create Extension method to existing class by creating a static method in a static class and passing this ClassName as first parameter. Please do refer http://msdn.microsoft.com/en-us/library/bb383977.aspx. Try to provide your own implementation this way. Otherwise Override the method and after the overriding the method do not forget to call base.Method()
0

Featured Post

RHCE - Red Hat OpenStack Prep Course

This course will provide in-depth training so that students who currently hold the EX200 & EX210 certifications can sit for the EX310 exam. Students will learn how to deploy & manage a full Red Hat environment with Ceph block storage, & integrate Ceph into other OpenStack service

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question