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
namespace Tests.UnitTests | |
{ | |
using AutoFixture; | |
using AutoFixture.AutoMoq; | |
using AutoFixture.Xunit2; | |
using System; | |
public class InlineAutoMoqDataAttribute : InlineAutoDataAttribute | |
{ | |
public InlineAutoMoqDataAttribute(params object[] objects) |
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
alias cls=clear | |
alias gohome='cd $USERPROFILE && clear' | |
alias godev='cd c:/foo && clear' | |
alias exp='explorer .' | |
alias gs='git status' | |
alias gss='git status -s' | |
alias gco='git commit -a -m $1' | |
alias gl='git log --oneline --graph --all --decorate' | |
alias gm='git merge --no-ff' | |
alias az='az.cmd' |
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.Concurrent; | |
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Running; | |
namespace ConsoleApp2 | |
{ | |
public class Program |
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.Threading.Tasks; | |
using Autofac; | |
using Routemeister; | |
using Routemeister.Routers; | |
namespace ConsoleApplication2 | |
{ | |
class Program | |
{ |
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
(function (exports) { | |
var app = exports.app = { | |
bindingContext: { | |
domnode: null, | |
model: null, | |
loadTemplate: function (templateName) { | |
return document.getElementById(templateName).innerHTML; | |
}, | |
bind: function (templateName, vm) { | |
this.domnode.innerHTML = this.loadTemplate(templateName); |
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
class Program { | |
static void Main(string[] args) | |
{ | |
const string subject = "test"; | |
var cnInfo = new ConnectionInfo(new Host("demo.nats.io")) { | |
AutoRespondToPing = true | |
}; | |
Action<MsgOp> handler = msg => { | |
Console.WriteLine("R:" + Encoding.UTF8.GetString(msg.Payload)); |
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 Task Alternative1() { | |
var consumer = new NatsConsumer(client); | |
var subscription = await consumer.SubscribeAsync("mySubject", msg => { | |
//do something with the message | |
}); | |
//time goes by | |
subscription.Dispose(); //issues client.Unsub(subject) against NATS broker as well as removes handler | |
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.Threading.Tasks; | |
using Autofac; | |
using Autofac.Features.Variance; | |
using MediatR; | |
namespace ConsoleApplication2 | |
{ | |
class Program |
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.Threading.Tasks; | |
namespace ConsoleApplication1 | |
{ | |
public class MessageEnvelope | |
{ | |
public object Message { get; } |
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
[Fact] | |
public void Can_search_on_default_index() | |
{ | |
var searchRequest = new SearchIndexRequest(CloudantTestData.Views.Views101AnimalsSearchIndexId) | |
.Configure(q => q.Expression("kookaburra")); | |
var response = SUT.SearchAsync(searchRequest).Result; | |
response.Should().BeSuccessfulGet(numOfRows: 1); | |
response.Bookmark.Should().NotBeNullOrEmpty(); |
NewerOlder