Solved

C# Override referenced method

Posted on 2012-03-29
2
236 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
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now