This file contains hidden or 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 fixture = new Fixture(); | |
var model = fixture.CreateAnonymous<MyModel>(); |
This file contains hidden or 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 fixture = new Fixture(); | |
var model = | |
fixture | |
.Build<MyModel>() | |
.Without(x => x.Id) | |
.CreateAnonymous(); |
This file contains hidden or 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
[Test] | |
public void SomeTest() { | |
// Arrange | |
var mock = new Mock<IDependency>(); | |
var sut = new ServiceUnderTest(mock.Object); | |
// Act | |
sut.DoIt(); | |
// Assert |
This file contains hidden or 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
[Test] | |
public void SomeTest() { | |
// Arrange | |
var mock = new Mock<IDependency>(); | |
string string1 = null; | |
string string2 = null; | |
mock | |
.Setup(x => x.AMethodCall(It.IsAny<string>(), It.IsAny<string>())) | |
.Callback<string, string>((s1, s2) => | |
{ |
This file contains hidden or 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
$username = "insert_username_here" | |
$password = ConvertTo-SecureString "insert_password_here" -AsPlainText -Force | |
$credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username,$password | |
$session = New-PSSession "insert_hostname_here" -Credential $credential | |
Invoke-Command -Session $session -ScriptBlock { | |
Set-ExecutionPolicy RemoteSigned | |
Import-Module WebAdministration | |
New-Item iis:\Sites\%teamcity.build.branch%.insert_local_name_here -bindings @{protocol="http";bindingInformation=":80:%teamcity.build.branch%.insert_local_name_here"} -physicalPath c:\inetpub\wwwroot\%teamcity.build.branch%.insert_local_name_here | |
Set-ItemProperty 'IIS:\Sites\%teamcity.build.branch%.insert_local_name_here' ApplicationPool "ASP.NET v4.0" |
This file contains hidden or 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
using System; | |
using System.Collections; | |
using System.Configuration; | |
using System.Globalization; | |
using Nest; | |
namespace Elmah.ElasticSearch | |
{ | |
public class ElasticSearchLog : ErrorLog | |
{ |
This file contains hidden or 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 result = | |
LinkCheck | |
.On(x => x.Url(new Uri("http://www.hippovalidator.com"))) | |
.AsBot(x => x.Google()) | |
.OnRequest(req => ...) | |
.OnResponse(resp => ...) | |
.Start(); |
This file contains hidden or 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 links = | |
LinkCheck | |
.On(x => x.Url(new Uri(context.Url))) | |
.AsBot(bot => bot.Google()) | |
.Start(); | |
.Where(x => (int) x.StatusCode >= 400) | |
.Select(x => new ValidationIssue | |
{ | |
Severity = SeverityEnum.Error, | |
Title = "The following link returned status code " + |
This file contains hidden or 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 IISExpressTest | |
{ | |
[Test] | |
public void IISExpressIsNeverDisabled() | |
{ | |
XNamespace @namespace = "http://schemas.microsoft.com/developer/msbuild/2003"; | |
var document = XDocument.Load("path to your web project (csproj)"); | |
var element = | |
document.Descendants(@namespace + "Project") | |
.First() |
This file contains hidden or 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
// Load the http module to create an http server. | |
var http = require('http'); | |
// Configure our HTTP server to respond with Hello World to all requests. | |
var server = http.createServer(function (request, response) { | |
response.writeHead(200, { "Content-Type": "text/plain" }); | |
response.end("Hello World\n"); | |
}); | |
// Listen on port 8000, IP defaults to 127.0.0.1 |
OlderNewer