This file contains hidden or 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.Linq; | |
using Microsoft.CodeAnalysis; | |
using Microsoft.CodeAnalysis.CSharp; | |
using Microsoft.CodeAnalysis.CSharp.Syntax; | |
using NUnit.Framework; | |
using static Microsoft.CodeAnalysis.CSharp.SyntaxKind; | |
namespace Tests | |
{ |
This file contains hidden or 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 static IEnumerable<TNode> UnfoldTree<TNode>(this TNode root, Func<TNode, IEnumerable<TNode>> getChildren) | |
{ | |
var queue = new Queue<TNode>(new [] { root }); | |
while (queue.Count > 0) | |
{ | |
var node = queue.Dequeue(); | |
yield return node; | |
foreach (var child in getChildren(node)) |
This file contains hidden or 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
fromAll() | |
.when({ | |
$init: function () { | |
return { count: 0 }; // initial state | |
}, | |
$any: function (state, event) { | |
if (event.metadata.EventSourceId.indexOf("$") !== 0) { | |
state.count += 1; | |
} | |
return state; |
This file contains hidden or 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.Net; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using EventStore.ClientAPI; | |
using EventStore.ClientAPI.SystemData; | |
using Nito.AsyncEx; |
This file contains hidden or 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 (var readTimeout = new CancellationTokenSource()) | |
{ | |
readTimeout.CancelAfter(this.defaultTimeout); // not used so far | |
currentSlice = AsyncContext.Run( | |
() => connection.ReadStreamEventsForwardAsync(EventsPrefix + id.FormatGuid(), nextSliceStart, batchSize, false)); | |
} |
This file contains hidden or 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
hg branches | %{ $_.Split(' ')[0] } | group { hgbranchowner $_ } | %{ | |
write $_.Name | |
$_.Group | write | |
write '' | |
} |
This file contains hidden or 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
(( )+/// .*\n)+ |
This file contains hidden or 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
/* | |
Please remove this comment only after placing this template to ReSharper template editor. | |
Existance of this comment during paste will automatically align macroses in shown order. | |
Macroses: | |
$Proxy$ - ProxyName (this one is under test) | |
$ProxyMethod$ - ProxyMethod | |
$proxy$ - proxyName | |
$Result$ - ResultType | |
$Argument$ - ArgumentType (argument of method under test which is supplied to subject method) |
This file contains hidden or 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
/* | |
Please remove this comment only after placing this template to ReSharper template editor. | |
Existance of this comment during paste will automatically align macroses in shown order. | |
Macroses: | |
$Proxy$ - ProxyName (this one is under test) | |
$ProxyMethod$ - ProxyMethod | |
$proxy$ - proxyName | |
$Result$ - ResultType | |
$ISubject$ - SubjectName (this one produces data returned by proxy) |
This file contains hidden or 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
/* | |
Please remove this comment only after placing this template to ReSharper template editor. | |
Existance of this comment during paste will automatically align macroses in shown order. | |
Macroses: | |
$Entity$ - EntityName | |
$entity$ - entityName | |
$entity_in_when_part$ - entity_name | |
$entities_in_when_part$ - entity_name_in_plural | |
$usage_of_initial_parameters_in_ctor$ - arguments of factory method supplied to constructor |