User FAQs

If you have a question, please send it to us.


1) How do you rename a Solution ?
Close the solution
Move the solution source files to a different folder is needed
Rename the ".sln" file
Open Visual Studio


2) How do you rename a Project ?
Open the solution
Right mouse click on the project and select Rename
Enter the new name and press Enter


3) What is a Namespace ?
A namespace provides a way of organising and grouping your classes.


4) What is Reflection ?
This is a technique that allows you to fetch type (assembly) information at runtime programmatically. You can also achieve late binding using Reflection.
This allows you to examine or modify the meta data from assemblies at runtime.
This is useful for:
Viewing metadata -
Type discovery - examine the types in other assemblies
Late binding - based on Type discovery
Creating new types at runtime (Reflection Emit) Creating custom classes at runtime which will run significantly faster than a more generic class created at compile time


Reflection can be used to adapt a program execution at run-time
This is the process by which a program can read its own meta-data
A program is said to reflect on itself extracting metadata from its assembly and using that metadata to either inform the user or modify its behaviour


5) If you pass an object into a method and you want to find out what type it is - how can you do this ?
Declare the members you need in a class or interface and cast to that using Reflection.

public static T Cast<T>(object obj) 
{
   return (T)obj;
}

This method can then be invoked using Reflection.

methodInfo castMethod = this.GetType().GetMethod("Cast").MakeGenericMethod(t) : 
object castedobject = castmethod.Invoke(null, new object[] {obj});

6) Write code that will resize a System.Drawing.Rectangle by reducing its height and width by 5 points ?

System.Drawing.Rectangle myRectangle = new System.Drawing.Rectangle(100,100); 
myRectangle.Inflate(-5,-5);

7) What is Unit Testing ?



8) Can you give some examples of different types of test cases ?
Positive test cases - correct data, correct output
Negative test cases - incorrect / missing / invalid data, proper handling
Exception test cases - exceptions are thrown and handled properly



© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext