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 TRes Match<T,TRes>(this FSharpOption<T> opt, Func<T,TRes> some, Func<TRes> none) | |
| { | |
| if (FSharpOption<T>.get_IsSome(opt)) | |
| return some.Invoke(opt.Value); | |
| else | |
| return none.Invoke(); | |
| } | |
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
| # TODO dig out of registry instead of cutting and pasting from VS! | |
| $x="*.c;*.cpp;*.cxx;*.cc;*.tli;*.tlh;*.h;*.hh;*.hpp;*.hxx;*.hh;*.inl;*.rc;*.resx;*.idl;*.asm;*.inc;*.tlh;*.h;*.hh;*.hpp;*.hxx;*.hh;*.inl;*.rc;*.resx;*.idl;*.asm;*.inc;*.cs;*.resx;*.resw;*.xsd;*.wsdl;*.xaml;*.xml;*.htm;*.html;*.css;*.vb;*.resx;*.xsd;*.wsdl;*.htm;*.html;*.aspx;*.ascx;*.asmx;*.svc;*.asax;*.config;*.asp;*.asa;*.cshtml;*.vbhtml;*.css;*.xml;*.xml;*.xsl;*.xslt;*.xsd;*.dtd;*.srf;*.htm;*.html;*.xml;*.gif;*.jpg;*.png;*.css;*.disco;*.txt;*.json;*.vb;*.resx;*.xsd;*.wsdl;*.htm;*.html;*.aspx;*.ascx;*.asmx;*.svc;*.asax;*.config;*.asp;*.asa;*.cshtml;*.vbhtml;*.css;*.xml;*.cs;*.resx;*.resw;*.xsd;*.wsdl;*.xaml;*.xml;*.htm;*.html;*.css" | |
| $x+=";*.fs;*.json;*.ts" | |
| # strip *. | |
| $all = $x.Split( ";") | % { $_.Replace("*.","") } | |
| #xml fins too much junk in obj dirs |
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
| open TickSpec | |
| open Features | |
| module DiagnosticFeatures = | |
| [<TickFact>] | |
| let ConnectivityFeature () = | |
| generateScenariosFromEmbeddedFeatureFile "Connectivity" |
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 NinjectScopingLearning | |
| { | |
| public static class InParentScope | |
| { | |
| [Fact] | |
| public static void WorksIffParentScopeAllWayUp() | |
| { | |
| var kernel = new StandardKernel(); | |
| kernel.Bind<Root>().ToSelf().InSingletonScope(); | |
| kernel.Bind<Child>().ToSelf().InParentScope(); |
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.Generic; | |
| using System.Globalization; | |
| using System.Linq; | |
| using System.Reflection; | |
| using Xunit.Extensions; | |
| namespace Prototypes.AutoFixture.Xunit.Extensions | |
| { | |
| public class CompositeDataAttribute : DataAttribute |
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
| /* | |
| output of the row test below | |
| describe AClass | |
| describe many variations | |
| A should equal A | |
| C should equal A - [Failed] | |
| */ | |
| //top level context to describe class | |
| class describe_AClass |
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
| static class Program | |
| { | |
| static void Main() | |
| { | |
| var x = new { a=0, b=1 }; | |
| f( x ); | |
| } | |
| static void f(dynamic x) | |
| { | |
| Console.WriteLine(x.b); |
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 Ploeh.AutoFixture | |
| { | |
| using Kernel; | |
| using System; | |
| public class PostProcessWhereIsACustomization<T> : ICustomization | |
| where T : class | |
| { | |
| readonly PostProcessSpecimensBehavior _behavior; |
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
| [Theory] | |
| [ClassAutoData( typeof( XProvider ) )] | |
| public static void Scenario( X x, string y ) | |
| { | |
| Console.WriteLine( x + "," + y ); | |
| } | |
| public class ClassAutoDataAttribute : CompositeDataAttribute | |
| { | |
| public ClassAutoDataAttribute( Type @class ) |
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
| function Get-ClipboardText { | |
| $command = { | |
| add-type -an system.windows.forms | |
| [System.Windows.Forms.Clipboard]::GetText() | |
| } | |
| powershell -sta -noprofile -command $command | |
| } | |
| function Get-GrepWinClipboardFiles() { | |
| get-ClipboardText | ConvertFrom-Csv -del "`t" | %{ $_.Path+"\"+$_.Name } |