Skip to content

Instantly share code, notes, and snippets.

@segilbert
segilbert / TestHelper.cs
Last active December 13, 2015 22:08 — forked from sinairv/TestHelper.cs
public static class TestHelpers
{
public static void ShouldEqualWithDiff(this string actualValue, string expectedValue)
{
ShouldEqualWithDiff(actualValue, expectedValue, StringComparison.Ordinal, DiffStyle.Full, Console.Out, string.Empty);
}
public static void ShouldEqualWithDiff(this string actualValue, string expectedValue, string message)
{
ShouldEqualWithDiff(actualValue, expectedValue, StringComparison.Ordinal, DiffStyle.Full, Console.Out, message);
@segilbert
segilbert / CxServices.asmx
Created April 18, 2012 12:53
Quiz Question: How do I use webMethod to call GetMessages?
[WebMethod(true)]
public string GetMessages(string psUserId)
{
List<JxMessage> messages = new List<JxMessage>();
// .... do some logic like get the message list
// Send it back as JSON
return CxJSONHelper.Serialize(messages);
}
@segilbert
segilbert / IdeaStrikeSpecBase.cs
Created April 5, 2012 14:42
IdeaStrike Test Project Nancy Autofac Bootstrapper
//
using System;
using System.Collections.ObjectModel;
using System.Linq;
using System.Linq.Expressions;
using System.Drawing;
using System.IO;
using System.Drawing.Imaging;
//
using Ideastrike;
@segilbert
segilbert / complus_remove_apps
Created January 20, 2012 21:15
Remove COM+ Applications Pro-grammatically from COM+ Services
On Error Resume Next
For Each objItem in colItems
' Create an instance of COMAdmin Catalog
set cat = CreateObject( "COMAdmin.COMAdminCatalog" )
' Reference the Applications Collection
Set apps = cat.GetCollection("Applications")
' Retrieve the data
apps.Populate