Skip to content

Instantly share code, notes, and snippets.

View DavidSSL's full-sized avatar
💭
Set the status

DavidSSL

💭
Set the status
View GitHub Profile
class Program
{
static void Main()
{
Person.Eats();
}
}
public class Person
{
class Program
{
// 1 Declaration of a delegate type
public delegate void PersonEatsDelegate();
static void Main()
{
// 3 Instantiation of a delegate (short form)
PersonEatsDelegate personEatsDelegate = Person.Eats;
.class private auto ansi sealed StartApp.PersonEatsDelegate
extends [mscorlib]System.MulticastDelegate
{
// Methods
.method public hidebysig specialname rtspecialname
instance void .ctor (
object 'object',
native int 'method'
) runtime managed
{
Interface IMyInterface
{
void SomeMethod();
}
class Person
{
public static void Eats()
{
// Some implementation
}
public static void Says(string message)
{
// Some implementation
public ActionResult Send()
{
_logger.Info("In Send method");
...
}
private ILogger _logger = NullLogger.Instance;
public ILogger Logger
{
get { return _logger; }
set { _logger = value; }
}
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!--
See http://nlog-project.org/wiki/Configuration_file
for information on customizing logging rules and outputs.
-->
<targets>
<!-- add your targets here -->
@DavidSSL
DavidSSL / Semantic comparison test
Last active December 16, 2015 09:19
Correct implementation of Parser Test
[Theory, AutoFixture]
public void ParseValidInputShouldReturnCorrectResult(
PatientReportParser sut)
{
const string argsString = @"-o=C:\Temp\someFile -p=1 -d";
var args = new string[0];
IResult actualResult = null;
var expectedResult =
new Likeness<CreateReportResult, CreateReportResult>(new CreateReportResult(@"C:\Temp\someFile", "1", "database"));
@DavidSSL
DavidSSL / IResultTest
Created April 18, 2013 10:42
Problem IResult
[Theory, AutoFixture]
public void ParseValidInputShouldReturnCorrectResult(
PatientReportParser sut)
{
const string argsString = @"-o=C:\Temp\someFile -p=1 -d";
var args = new string[0];
IResult actualResult = null;
"Given valid arguments"
.Given(() => args = argsString.Split(' '));