Breaking News

Editors Picks

Friday, June 11, 2010

Events and Delegates and Debugging and Testing and XML Documentation Questions

1.    What’s a delegate? 
A delegate object encapsulates a reference to a method.
 
2.    What’s a multicast delegate? 
A delegate that has multiple handlers assigned to it.  Each assigned handler (method) is called.
 
XML Documentation Questions
1.    Is XML case-sensitive? 
Yes.
 
2.    What’s the difference between // comments, /* */ comments and /// comments? 
Single-line comments, multi-line comments, and XML documentation comments.
 
3.    How do you generate documentation from the C# file commented properly with a command-line compiler? 
Compile it with the /doc switch.
 
Debugging and Testing Questions
1.    What debugging tools come with the .NET SDK?
1.  
 CorDBG – command-line debugger.  To use CorDbg, you must compile the original C# file using the /debug switch.
2.  
 DbgCLR – graphic debugger.  Visual Studio .NET uses the DbgCLR.
 
2.    What does assert() method do? 
In debug compilation, assert takes in a Boolean condition as a parameter, and shows the error dialog if the condition is false.  The program proceeds without any interruption if the condition is true.
 
3.    What’s the difference between the Debug class and Trace class? 
Documentation looks the same.  Use Debug class for debug builds, use Trace class for both debug and release builds.
 
4.    Why are there five tracing levels in System.Diagnostics.TraceSwitcher? 
The tracing dumps can be quite verbose.  For applications that are constantly running you run the risk of overloading the machine and the hard drive.  Five levels range from None to Verbose, allowing you to fine-tune the tracing activities.
 
5.    Where is the output of TextWriterTraceListener redirected? 
To the Console or a text file depending on the parameter passed to the constructor.
 
6.    How do you debug an ASP.NET Web application? 
Attach the aspnet_wp.exe process to the DbgClr debugger.
 
7.    What are three test cases you should go through in unit testing? 
1.       Positive test cases (correct data, correct output).
2.      
 Negative test cases (broken or missing data, proper handling).
3.      
 Exception test cases (exceptions are thrown and caught properly).
 
Can you change the value of a variable while debugging a C# application? 
Yes.  If you are debugging via Visual Studio.NET, just go to Immediate window. 

No comments :

Post a Comment

Contact Us

Name

Email *

Message *