Skip to content

Instantly share code, notes, and snippets.

View NickJosevski's full-sized avatar

Nick Josevski NickJosevski

View GitHub Profile
@NickJosevski
NickJosevski / NSubIssueTests.cs
Created October 19, 2011 01:29
Mocking extension methods
//I saw this and thought there was a simple way around subbing extension methods
//http://blogs.clariusconsulting.net/kzu/how-to-mock-extension-methods/
//My choice of solution was to just refactor the IRepo interface
namespace NSubIssueTests
{
[TestFixture]
public class ExtensionOnInterfaceTests
{
function Select-Folder($message='Select a folder', $path = 0) {
$object = New-Object -comObject Shell.Application
$folder = $object.BrowseForFolder(0, $message, 0, $path)
if ($folder -ne $null) {
$folder.self.Path
}
}
function Add-Zip
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;