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 Parent | |
{ | |
public Parent() | |
{ | |
Children = new HashSet<Child>(); | |
} | |
public int ParentId { get; set; } | |
public string Name { get; set; } | |
public ICollection<Child> Children { get; set; } | |
} |
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
using System; | |
using System.Collections.Generic; | |
using System.Data.Entity; | |
namespace EFConsoleApplication.Basic | |
{ | |
public class Parent | |
{ | |
public Parent() | |
{ |
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
void Main() | |
{ | |
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; }; | |
var results = from project in TeamCityWebRequest.GetTeamCityProjects() | |
from build in TeamCityWebRequest.GetTeamCityBuilds(project) | |
select new {project, build}; | |
results.Dump(); | |
} | |
public class TeamCityWebRequest |
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 dt = DateTime.UtcNow; | |
var utcOffset = new DateTimeOffset(dt, TimeSpan.Zero); | |
//TimeZoneInfo.GetSystemTimeZones() - provides timezone identifiers | |
(from t in new []{ | |
new {Name = "UK", TimeZoneId= "GMT Standard Time"}, | |
new {Name = "WA", TimeZoneId= "W. Australia Standard Time"}, | |
new {Name = "NT", TimeZoneId= "AUS Central Standard Time"}, | |
new {Name = "NSW", TimeZoneId= "E. Australia Standard Time"}, | |
new {Name = "VIC", TimeZoneId= "E. Australia Standard Time"}, | |
new {Name = "ACT", TimeZoneId= "E. Australia Standard Time"}, |
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
$ErrorActionPreference = "Stop" | |
Set-ExecutionPolicy RemoteSigned | |
ECHO "Installing PsGet and PS plugins" | |
iex ((new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1")) | |
Install-Module pscx | |
Install-Module psake | |
ECHO "FINISHED - Installing PsGet and PS plugins - FINISHED" |
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
Properties { | |
$build_dir = Split-Path $psake.build_script_file | |
$build_artifacts_dir = "$build_dir\..\BuildArtifacts\" | |
$code_dir = "$build_dir\..\" | |
$soln = "$build_dir\..\AgentHoney.Azure.sln" | |
$nuget_package_dir = "$build_dir\..\..\Packages" | |
$database_server = ".\SqlExpress" | |
$database_instance = "AgentHoney_AutoTestDb" | |
$ef_tools_ouput = "$build_artifacts_dir\Tools\EF\" | |
} |
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 RouteFixture | |
{ | |
private readonly HttpContextBase _httpContextMock; | |
private readonly RouteCollection _routes; | |
public RouteFixture() | |
{ | |
_routes = new RouteCollection(); | |
RouteConfig.RegisterRoutes(_routes); |
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 PesonalDetailsFixture | |
{ | |
[Fact] | |
public void RequiredPropertiesAreMarkedAsSo() | |
{ | |
PropertyOn<PersonalData, string>(x => x.Title).Has<RequiredAttribute>(); | |
PropertyOn<PersonalData, string>(x => x.FirstName).Has<RequiredAttribute>(); | |
PropertyOn<PersonalData, string>(x => x.LastName).Has<RequiredAttribute>(); | |
PropertyOn<PersonalData, DateTime>(x => x.DateOfBirth).Has<RequiredAttribute>(); | |
PropertyOn<PersonalData, string>(x => x.Email).Has<RequiredAttribute>(); |
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
using System; | |
using System.Dynamic; | |
using System.Collections.Generic; | |
using System.Collections; | |
using System.IO; | |
using Xunit; | |
namespace YourNamespace | |
{ | |
public class DynamicCsv : DynamicObject |
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
//Will need some rework and some decent test runs. IDeally generate the start of the csv too. | |
public class PageFormTestInput<T> where T : new() | |
{ | |
private const string isFormValidFieldName = "IsFormValid"; | |
private readonly dynamic input; | |
public PageFormTestInput(dynamic input) | |
{ | |
this.input = input; | |
} | |