BlackWaspTM

This web site uses cookies. By using the site you accept the cookie policy.This message is for compliance with the UK ICO law.

<< Previous | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | ... | Next >> |
Moq Partial MocksMoq Partial Mocks
Moq is commonly used to create mock objects based upon interfaces. However, it can also be used to mock classes. This includes the possibility of creating partial mocks, where some members are intercepted with expectations whilst others run as normal.
Generate Return Values Using Lambdas in MoqGenerate Return Values Using Lambdas in Moq
Mock objects and stubs created using the Moq framework are generally used to inject dependencies with expectations that define fixed results. For more complex scenarios, lambda expressions can be used to generate results based on provided arguments.
Trimming Non-Whitespace Characters from StringsTrimming Non-Whitespace Characters from Strings
Often string data is received through a user interface or integration system. This data may include additional characters to the main information, either as a prefix or suffix. Using the String class's Trim method, the unwanted characters can be removed.
Invoking Overloaded Methods Using ReflectionInvoking Overloaded Methods Using Reflection
Static and instance methods can be invoked via reflection by obtaining a MethodInfo object for the desired member and calling the Type class's Invoke method. When invoking overloaded methods, the call to obtain the method information must be modified.
Obtaining Caller InformationObtaining Caller Information
When using the .NET framework version 4.5, it is possible to obtain information about the caller of a method without using a stack trace. This is achieved by decorating method parameters with one of three new caller information attributes.
File and Folder TimestampsFile and Folder Timestamps
Microsoft Windows maintains three timestamps for all files and folders. These are the creation time and the times that the item was last accessed and updated. These timestamps can be accessed and updated using the .NET framework.
Generating Random Numbers in T-SQL QueriesGenerating Random Numbers in T-SQL Queries
There are many reasons for generating random numbers in Transact-SQL (T-SQL) queries but the standard randomisation function will not generate a new value for each row. However, there is a workaround for this problem.
.NET Namespaces.NET Namespaces
The sixteenth part of the C# Object-Oriented Programming tutorial describes the use of namespaces. Namespaces allow classes, structures and other items to be grouped and organised and remove the possibility of class-naming conflicts.
Visual Studio 2010 Parallel Tasks WindowVisual Studio 2010 Parallel Tasks Window
Debugging code that uses parallel programming techniques presents additional difficulties to debugging software that executes on a single thread. Visual Studio provides tools that assist with these problems. One such tool is the Parallel Tasks window.
Regular Expression OptionsRegular Expression Options
The fifteenth part of the Regular Expressions in .NET tutorial continues to looks at options that can be applied to regular expressions when matching and substituting text. This article looks at the use of the RegexOptions enumeration.
<< Previous | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | ... | Next >> |