This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace HttpTest | |
{ | |
using System.Diagnostics; | |
using System.Threading; | |
using HttpTest.HttpClient; | |
public class HttpTester | |
{ | |
private int iterations; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace AgilityTests | |
{ | |
using Xunit; | |
using Xunit.Sdk; | |
public class FunctionalTests | |
{ | |
[Fact] | |
public void Should_allow_chaining_of_asserts_and_still_pass() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Fact] | |
public void Should_display_error_message_when_error_passed() | |
{ | |
// Given, When | |
var context = browser.Get("/login", (with) => | |
{ | |
with.HttpRequest(); | |
with.QueryString("?error=true"); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class IndexHelper<TKey, TValue> | |
{ | |
private Func<TKey, TValue> indexDelegate; | |
public TValue this[TKey key] | |
{ | |
get | |
{ | |
return this.indexDelegate(key); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Nancy.Demo.Authentication.Forms.TestingDemo | |
{ | |
using System; | |
using System.IO; | |
using System.Text; | |
using Testing; | |
using Tests; | |
using Xunit; | |
public class LoginFixture |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace HtmlTesting | |
{ | |
using System.Collections.Generic; | |
public interface IHtmlNode | |
{ | |
string GetAttributeValue(string attribute); | |
IHtmlNode Parent { get; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | |
} |