Skip to content

Instantly share code, notes, and snippets.

View hazzik's full-sized avatar

Alex Zaytsev hazzik

  • Brisbane, Australia
View GitHub Profile
@hazzik
hazzik / gist:1389518
Created November 23, 2011 18:46
R# Type Members Layout
<?xml version="1.0" encoding="utf-8" ?>
<Patterns xmlns="urn:shemas-jetbrains-com:member-reordering-patterns">
<!--Do not reorder COM interfaces and structs marked by StructLayout attribute-->
<Pattern>
<Match>
<Or Weight="100">
<And>
<Kind Is="interface"/>
public class Tests
{
[Fact]
public void Tax10()
{
var calc = new TaxCalculator();
decimal tax = calc.Tax(5000);
Assert.Equal(500, tax);
}
@{
Func<ModelMetadata, bool> ShouldShow = metadata =>
metadata.ShowForEdit && !ViewData.TemplateInfo.Visited(metadata);
}
@if (ViewData.TemplateInfo.TemplateDepth > 5) {
if (Model == null) {
@ViewData.ModelMetadata.NullDisplayText
} else {
@ViewData.ModelMetadata.SimpleDisplayText
}
bool CanConvert(Type source, Type destination)
{
try
{
Expression.Convert(Expression.Default(source), destination);
return true;
}
catch (InvalidOperationException)
{
return false;
namespace Domain.Tests
{
using Castle.MicroKernel.Registration;
using Castle.Windsor;
using Xunit;
public class ChildContainerResolveTests
{
public interface IService1 { }
public class WindsorTests
{
public interface ISomeServiceConsumer { }
public interface ISomeService { }
public class SomeServiceConsumer : ISomeServiceConsumer
{
public SomeServiceConsumer(ISomeService someService) { }
}