Skip to content

Instantly share code, notes, and snippets.

View robdmoore's full-sized avatar

Rob Moore (MakerX) robdmoore

View GitHub Profile
@robdmoore
robdmoore / gist:4618493
Last active December 11, 2015 15:08
Understanding the impact of NSubstitute's .Returns() static stack implementation
using System;
using NSubstitute;
using NSubstitute.Exceptions;
using NUnit.Framework;
namespace Tests
{
public class Class1
{
public interface Interface
@robdmoore
robdmoore / gist:5280124
Last active December 15, 2015 15:09
Error when executing via msdeploy 3 to a fresh msdeploy 3 install via WebPiCmd.exe

Command on the remote web server (Windows Server 2012 Web Role VM in Windows Azure):

Webpicmd.exe /install /products:WDeployNoSMO /AcceptEula /Log:"%~dp0WebPI.log"

Contents of WebPI.log

WebPiCmd Information: 0 : 
        DateTime=2013-03-31T08:27:12.7576854Z
WebPiCmd Warning: 0 : The software that you obtain using the Web Plaform Installer Command Line Tool is licensed to you by its owner.    Microsoft grants you no rights for third party software.

DateTime=2013-03-31T08:27:12.7576854Z

@robdmoore
robdmoore / gist:5475809
Last active December 16, 2015 18:09
Sample app to test Azure Web Farm background worker
using System;
using System.Threading;
using AzureToolkit;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.StorageClient;
namespace ConsoleApplication1
{
public class ConsoleResult : TableServiceEntity
{
@robdmoore
robdmoore / init.ps1
Last active November 2, 2020 11:22
Prototyping NuGet install.ps1 script to install chrome driver as embedded .exe to project
param($installPath, $toolsPath, $package, $project)
Import-Module (Join-Path $toolsPath "webdriver_installs.psm1")
@robdmoore
robdmoore / ParseTrelloExport.linq
Created August 12, 2013 02:48
Linqpad script to quickly parse trello story map board
<Query Kind="Program">
<Reference>&lt;RuntimeDirectory&gt;\System.Collections.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Linq.dll</Reference>
<NuGetReference>Newtonsoft.Json</NuGetReference>
<Namespace>Newtonsoft.Json</Namespace>
<Namespace>Newtonsoft.Json.Bson</Namespace>
<Namespace>Newtonsoft.Json.Converters</Namespace>
<Namespace>Newtonsoft.Json.Linq</Namespace>
<Namespace>Newtonsoft.Json.Schema</Namespace>
<Namespace>Newtonsoft.Json.Serialization</Namespace>
@robdmoore
robdmoore / Program.cs
Last active December 21, 2015 03:18
Playing with sync context and async
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace SyncContext
{
class Program
{
static void Main()
@robdmoore
robdmoore / gist:6794397
Created October 2, 2013 14:12
Multi-step form controller code idea
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Linq;
using System.Web.Mvc;
using Newtonsoft.Json;
namespace Web.Controllers
{
@robdmoore
robdmoore / one_builder.cs
Last active December 29, 2015 12:29
NTestDataBuilder with inheritance within the classes being built
// Simpler, but you get all methods and get's unwieldy as the number of differences between the / number of sub classes grows
using System;
using NTestDataBuilder;
namespace ConsoleApplication4
{
class Program
{
static void Main()
@robdmoore
robdmoore / 01_Implementation.cs
Last active January 4, 2016 14:28
Test Structure
public class MeasuredInput
{
public string Identifier { get; set; }
public int MeasuredValue { get; set; }
public double Confidence { get; set; }
}
public class Measurement
{
public Measurement(string primaryId, string secondaryId, int value, double adjustedMeasurement)
@robdmoore
robdmoore / gist:8644975
Created January 27, 2014 08:36
Data-driven tests with NUnit and XUnit when you have a Specification base class
public abstract class Specification
{
[Test]
public virtual void Run()
{
this.BDDfy();
}
[Fact]
public void RunX()