This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// declaration | |
public class ServiceLogger : IServiceLogger | |
{ | |
private readonly ILog log; | |
public ServiceLogger(object o) | |
{ | |
log = LogManager.GetLogger(o.GetType().Name); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data = PersonHelper.SortPersonsByAge(data, Constants.MinAge, Constants.MaxAge); | |
// .... | |
/// <summary> | |
/// Sorts list of persons | |
/// </summary> | |
public static List<Person> SortPersonsByAge(IList<Person> persons, int minAge, int maxAge) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Sort(List<Person> data) | |
{ | |
Person tmp = null; | |
for(int i = 0; i<data.Count; i++) | |
{ | |
for(int j = i; j<data.Count; j++) | |
{ | |
if(data[j].Compare(data[i])) | |
{ | |
tmp = data[j]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Fact] | |
public void should_throw_exception_for_negatives() | |
{ | |
// act | |
Action c = () => calculator.Add("-1,2"); | |
// assert | |
c.ShouldThrow<Exception>().WithMessage("negatives are not allowed"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.IO; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
using FluentAssertions; | |
using NUnit.Framework; | |
using Nancy.Helpers; | |
namespace NancySelfHosting |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Fact] | |
public void selectManyTest() | |
{ | |
var s = "2#3,4%5"; | |
var delimiters = "#,%"; | |
var e = delimiters | |
.Aggregate(Enumerable.Repeat(s, 1), (current, delimiter) => | |
current.SelectMany(s1 => s1.Split(delimiter))); | |
e.Should().Equal(new[] {"2", "3", "4", "5"}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using FluentAssertions; | |
using Xunit; | |
namespace StringCalculatorKata | |
{ | |
public class StringCalculatorKata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.Linq; | |
using System.Text; | |
using FluentAssertions; | |
using Xunit; | |
namespace StringCalculatorKata | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
For more information on how to configure your ASP.NET application, please visit | |
http://go.microsoft.com/fwlink/?LinkId=169433 | |
--> | |
<configuration> | |
<configSections> | |
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> | |
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" /> | |
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative" |
OlderNewer