Skip to content

Instantly share code, notes, and snippets.

View lars-erik's full-sized avatar

Lars-Erik Aabech lars-erik

View GitHub Profile
@lars-erik
lars-erik / Category.aspx
Created May 29, 2013 10:36
UCommerce Datatypes Category picker with stores
<%@ Control Language="C#" AutoEventWireup="true" Inherits="This.Web.usercontrols.Administrative.UCommerceDataTypesCategory" %>
<asp:UpdateProgress ID="UpdateProgress1"
runat="server"
AssociatedUpdatePanelID="CategoryPanel">
<ProgressTemplate>
<img src="/umbraco/images/throbber.gif" alt="Loading"/>
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel runat="server" UpdateMode="Always" ID="CategoryPanel">
<ContentTemplate>
@lars-erik
lars-erik / BusinessTests.cs
Created November 30, 2012 14:49
UOW & Repo template
[TestFixture]
public class BusinessTests
{
private IRepository<Entity> repo;
private ConcreteService service;
[SetUp]
public void SetUp()
{
repo = MockRepository.GenerateStub<IRepository<Entity>>();
@lars-erik
lars-erik / ControlRenderer.cs
Created July 25, 2012 14:16
ASP.NET Control Snapshot Renderer
public class ControlRenderer : IDisposable
{
public static string RenderContents(Control control)
{
using (var renderer = new ControlRenderer(control))
{
return renderer.Render();
}
}
@lars-erik
lars-erik / TestStub.cs
Created May 24, 2012 11:07
Umbraco Test Helpers
[TestFixture]
public class TestStub: UmbracoTestBase
{
[SetUp]
public void Setup()
{
SetupFakeEnvironment();
SetupRootContent();
}
@lars-erik
lars-erik / RandomPassword.cs
Created April 30, 2012 11:30
Random Password Generators
using System;
public class RandomPassword
{
private static Random random = new Random();
public static string Create(int length = 8, float charRatio = .8f)
{
string password = "";
@lars-erik
lars-erik / gist:2365774
Created April 12, 2012 09:16
HttpClient testwrapper
using System;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace AHttpClientTestWrapper
{
public class HttpClientWrapper