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() | |
{ | |
string aclTemplates = @" | |
using System; | |
using Acme.Web.Areas.Area1.Controllers.{0}; | |
using Acme.Web.Infrastructure.Acl; | |
namespace Ltss.Web.Areas.Acme.Acl.{0} | |
{{ | |
public class Acme{0}AclRegistry : AbstractAccessControlRegistry<{0}Controller> |
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 abstract class UnitTestBase : IUseFixture<UnitTestFixture>{ | |
public void SetFixture(UnitTestFixture data){ | |
Fixture = data; | |
AdditionalFixtureConfiguration(); | |
} | |
protected UnitTestFixture Fixture {get;set;} | |
public virtual void AdditionalFixtureConfiguration(){ |
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
<!--BAD--> | |
<!-- The following button tag will submit the form named "formName" TWICE --> | |
<button type="submit" onclick="$('#formName').submit()">Assign</button> | |
<!--Not Bad--> | |
<!-- The following button tag will submit the form named "formName" ONCE --> | |
<button type="button" onclick="$('#formName').submit()">Assign</button> |
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
tell application "Mail" | |
set selectedMessages to selection | |
if (count of selectedMessages) is equal to 0 then | |
display alert "No Messages Selected" message "Select the messages you want to add to 'wedding guests' address book group before running this script." | |
else | |
set weddingGuests to {} | |
repeat with eachMessage in selectedMessages | |
set emailSender to (extract name from sender of eachMessage) as string |
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
int[] numbers = new[] {1, 5, 8, 26, 35, 42}; | |
var result = numbers.Aggregate("", (current, item) => current + item.ToString() + ","); |
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
CREATE PROC test_proc | |
AS | |
SET NOCOUNT ON | |
SELECT TOP 10 id, name FROM employee | |
declare @sometable as table([id] int, name varchar(64)) | |
INSERT INTO @sometable | |
exec test_proc |
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.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Xml.Linq; | |
using Xunit; | |
namespace Isas.Shared.Tests | |
{ |
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 AssertConfigurationIsValid() | |
{ | |
try | |
{ | |
Mapper.AssertConfigurationIsValid(); | |
} | |
catch (AutoMapperConfigurationException amce) | |
{ | |
foreach (var e in amce.Errors) |
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 SomeTypeTest | |
{ | |
/// <summary> | |
/// <remarks>A bit of a hack, but if this test fails, the last type name written to the console/debug output | |
/// is the one missing an explicit public no-arg constructor.</remarks> | |
/// </summary> | |
[Fact] | |
public void AllTypesDerivedFromSomeTypeHavePublicNoArgConstructors() | |
{ | |
var type = typeof(Enumeration); |
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 ValueObjectTest | |
{ | |
[Fact] | |
public void AllValueObjectsImplementIEquatable() | |
{ | |
var typeToFind = typeof (IValueObject); | |
var typesFound = AppDomain.CurrentDomain.GetAssemblies().ToList() | |
.SelectMany(s => s.GetTypes()) | |
.Where(typeToFind.IsAssignableFrom); |