Skip to content

Instantly share code, notes, and snippets.

namespace HttpTest
{
using System.Diagnostics;
using System.Threading;
using HttpTest.HttpClient;
public class HttpTester
{
private int iterations;
StandardTest My Testing
Iterations 10000
Method POST
Header Test=blah
ContentType application/x-www-form-urlencoded
Options NoCache
Uri http://localhost/products/[id]
SequenceVariable id ['1','2','3','4','5','6']
RandomVariable name ['Bob', 'Jim', 'Dave']
BeginBody
namespace AgilityTests
{
using Xunit;
using Xunit.Sdk;
public class FunctionalTests
{
[Fact]
public void Should_allow_chaining_of_asserts_and_still_pass()
{
namespace AgilityTests
{
public class AndConnector<TSource>
{
private TSource source;
/// <summary>
/// Initializes a new instance of the <see cref="AndConnector{TSource}"/> class.
/// </summary>
/// <param name="source">
[Fact]
public void Should_display_error_message_when_error_passed()
{
// Given, When
var context = browser.Get("/login", (with) =>
{
with.HttpRequest();
with.QueryString("?error=true");
});
@grumpydev
grumpydev / IndexHelper.cs
Created March 24, 2011 15:31
Generic "named index helper"
public class IndexHelper<TKey, TValue>
{
private Func<TKey, TValue> indexDelegate;
public TValue this[TKey key]
{
get
{
return this.indexDelegate(key);
}
var assemblyPath = Path.GetDirectoryName(typeof(FormsAuthBootstrapper).Assembly.CodeBase).Replace(@"file:\", string.Empty);
var rootPath = PathHelper.GetParent(assemblyPath, 3);
rootPath = Path.Combine(rootPath, @"Nancy.Demo.Authentication.Forms");
namespace Nancy.Demo.Authentication.Forms.TestingDemo
{
using System;
using System.IO;
using System.Text;
using Testing;
using Tests;
using Xunit;
public class LoginFixture
namespace HtmlTesting
{
using System.Collections.Generic;
public interface IHtmlNode
{
string GetAttributeValue(string attribute);
IHtmlNode Parent { get; }
private static FakeNancyModule GenerateNewFakeNancyModuleType()
{
var typeName = String.Format("FakeNancyModule-" + Guid.NewGuid());
var assemblyName = new AssemblyName("NancyDynamic");
var assemblyBuilder = System.Threading.Thread.GetDomain().DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run);
var module = assemblyBuilder.DefineDynamicModule("NancyDynamicModule");
var builder = module.DefineType(typeName, TypeAttributes.Public, typeof(FakeNancyModule));
return Activator.CreateInstance(builder.CreateType());
}