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 WindsorTests | |
{ | |
public interface ISomeServiceConsumer { } | |
public interface ISomeService { } | |
public class SomeServiceConsumer : ISomeServiceConsumer | |
{ | |
public SomeServiceConsumer(ISomeService someService) { } | |
} |
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
namespace Domain.Tests | |
{ | |
using Castle.MicroKernel.Registration; | |
using Castle.Windsor; | |
using Xunit; | |
public class ChildContainerResolveTests | |
{ | |
public interface IService1 { } |
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
bool CanConvert(Type source, Type destination) | |
{ | |
try | |
{ | |
Expression.Convert(Expression.Default(source), destination); | |
return true; | |
} | |
catch (InvalidOperationException) | |
{ | |
return false; |
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
@{ | |
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 | |
} |
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 Tests | |
{ | |
[Fact] | |
public void Tax10() | |
{ | |
var calc = new TaxCalculator(); | |
decimal tax = calc.Tax(5000); | |
Assert.Equal(500, tax); | |
} |
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
<?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"/> |
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.Diagnostics; | |
using Castle.Facilities.TypedFactory; | |
using Castle.MicroKernel.Registration; | |
using Castle.Windsor; | |
using Xunit; | |
public class LifestileTests | |
{ | |
[Fact] | |
public void TestForTypedFactories() |
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 static class ExpressionExtensions | |
{ | |
public static TResult Invoke<TResult>(this Expression<Func<TResult>> expression) | |
{ | |
return expression.Compile().Invoke(); | |
} | |
public static TResult Invoke<T1, TResult>(this Expression<Func<T1, TResult>> expression, T1 arg1) | |
{ | |
return expression.Compile().Invoke(arg1); |
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
FOR /R . %%G IN (*.cs) DO ( | |
"C:\Program Files\GnuWin32\bin\expand" --tabs=4 --initial "%%G">"%%G.1" | |
del "%%G" | |
move "%%G.1" "%%G" ) |
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
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Table_1]') AND type in (N'U')) | |
DROP TABLE [dbo].[Table_1] | |
GO | |
CREATE TABLE [dbo].[Table_1] ([Name] [nvarchar](max) NULL) | |
GO | |
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[proc1]') AND type in (N'P', N'PC')) | |
DROP PROCEDURE [dbo].[proc1] | |
GO |
OlderNewer