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 FakeItEasy; | |
using Nancy.Owin; | |
using Nancy.Testing; | |
using Nancy.TinyIoc; | |
using Owin; | |
using System; | |
using System.Collections.Generic; |
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 Microsoft.Owin.Testing; | |
using System; | |
using System.Linq; | |
using System.Net.Http; | |
using Xunit; | |
namespace {Your Project}.Tests.Fixtures { | |
[CollectionDefinition("Test Server")] |
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 YourProduct | |
{ | |
/// <summary> | |
/// Task retry logic | |
/// </summary> | |
public static class TaskHelper | |
{ | |
/// <summary> | |
/// Returns a task which retries the task returned by the specified task provider. | |
/// </summary> |
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
<style type="text/css"> | |
#legend { | |
background-color: #3C5A76; | |
border: 2px solid #cccc; | |
color: #EEEEEE; | |
font-weight: bold; | |
position: absolute; | |
right: 50px; | |
top: 50px; | |
padding: 15px; |
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 Your.Product.Namespace | |
{ | |
public class WorkerRole : RoleEntryPoint, IDisposable | |
{ | |
readonly TaskCompletionSource<bool> _endRole = new TaskCompletionSource<bool>(); | |
readonly ManualResetEvent _runCompleteEvent = new ManualResetEvent(false); | |
IDisposable _app; | |
bool _disposed = false; | |
~WorkerRole() |
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 ApplicationSettingsHelper : IApplicationSettingsHelper | |
{ | |
readonly IApplicationSettingRepository _applicationSettingRepository; | |
/// <summary> | |
/// Default constructor | |
/// </summary> | |
public ApplicationSettingsHelper(IApplicationSettingRepository applicationSettingsRepository) | |
{ | |
_applicationSettingRepository = applicationSettingsRepository; |
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
param ( | |
$installPath, | |
$toolsPath, | |
$package, | |
$project | |
) | |
# Find Debug configuration and set debugger settings. | |
Write-Host "`tSetting startup information in Debug configuration" |
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
/// <summary> | |
/// From: http://blogs.msmvps.com/theproblemsolver/2013/05/20/unit-testing-code-depending-on-the-asp-net-webapi-httpclient/ | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
public class TestingDelegatingHandler<T> : DelegatingHandler { | |
private Func<HttpRequestMessage, HttpResponseMessage> _httpResponseMessageFunc; | |
public TestingDelegatingHandler(T value) : this(HttpStatusCode.OK, value) { } | |
public TestingDelegatingHandler(HttpStatusCode statusCode) : this(statusCode, default(T)) { } | |
public TestingDelegatingHandler(HttpStatusCode statusCode, T value) { |
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
# These are project build parameters in TeamCity | |
# Depending on the branch, we will use different major/minor versions | |
$majorMinorVersionMaster = "%system.MajorMinorVersion.Master%" | |
#$majorMinorVersionMaster = "1.9.0" | |
# TeamCity's auto-incrementing build counter; ensures each build is unique | |
$buildCounter = "%build.counter%" | |
#$buildCounter = "999" | |
# This gets the name of the current Git branch. |
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 TokenManager { | |
static readonly ILog _log = LogProvider.For<TokenManager>(); | |
string _clientId = "{your client id}"; | |
string _secret = "{your secret}"; | |
string _scopes = "{claims} offline_access"; // needs the offline_access to get the refresh token. | |
CloudConnectConfiguration _configuration; | |
Task _workerLoop; | |
CancellationTokenSource _cts; |