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
// Example test that spies on SocketStream.publish.channel() calls | |
// Using Mocha to drive: http://visionmedia.github.com/mocha/ | |
// sinon.js for stubs/mocks/spies: http://sinonjs.org | |
// should.js for assertions: https://github.com/visionmedia/should.js | |
var sinon = require('sinon') | |
, should = require('should') | |
, ss = require('socketstream').start(); | |
describe("Spying on SocketStream for testing", function() { |
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
////////////////////////////////// | |
// A more updated version of this code could be found here: | |
// https://github.com/ServiceStack/ServiceStack.Contrib/blob/master/src/ServiceStack.Authentication.MongoDB/MongoDBAuthRepository.cs | |
/////////////////// | |
using System; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
using ServiceStack.Common; |
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 class ServiceClient<TRequest, TResponse> | |
where TRequest : class | |
where TResponse : class | |
{ | |
private readonly string _baseUri; | |
private ISubject<TResponse> completionChannel; | |
public ServiceClient(string baseUri = "/api") | |
{ | |
// make sure the base uri is set appropriately |
NewerOlder