Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Maybe None kann erzeugt werden und ist none

  • Loading branch information...
commit cf7aceece4b272f20fa3dafcdf896114d26f93af 1 parent 7c7b1b4
Christian Deger ChristianDeger authored
433 src/CsharpMonads.5.0.ReSharper
View
@@ -0,0 +1,433 @@
+<Configuration>
+ <CodeStyleSettings>
+ <ExternalPath IsNull="False">
+ </ExternalPath>
+ <Sharing>SOLUTION</Sharing>
+ <CSharp>
+ <FormatSettings>
+ <BLANK_LINES_AROUND_SINGLE_LINE_INVOCABLE>1</BLANK_LINES_AROUND_SINGLE_LINE_INVOCABLE>
+ <FORCE_ATTRIBUTE_STYLE>SEPARATE</FORCE_ATTRIBUTE_STYLE>
+ <FORCE_FIXED_BRACES_STYLE>ALWAYS_ADD</FORCE_FIXED_BRACES_STYLE>
+ <FORCE_FOR_BRACES_STYLE>ALWAYS_ADD</FORCE_FOR_BRACES_STYLE>
+ <FORCE_FOREACH_BRACES_STYLE>ALWAYS_ADD</FORCE_FOREACH_BRACES_STYLE>
+ <FORCE_IFELSE_BRACES_STYLE>ALWAYS_ADD</FORCE_IFELSE_BRACES_STYLE>
+ <FORCE_USING_BRACES_STYLE>ALWAYS_ADD</FORCE_USING_BRACES_STYLE>
+ <FORCE_WHILE_BRACES_STYLE>ALWAYS_ADD</FORCE_WHILE_BRACES_STYLE>
+ <KEEP_BLANK_LINES_IN_CODE>1</KEEP_BLANK_LINES_IN_CODE>
+ <KEEP_BLANK_LINES_IN_DECLARATIONS>1</KEEP_BLANK_LINES_IN_DECLARATIONS>
+ <MODIFIERS_ORDER IsNull="False">
+ <Item>public</Item>
+ <Item>protected</Item>
+ <Item>internal</Item>
+ <Item>private</Item>
+ <Item>new</Item>
+ <Item>abstract</Item>
+ <Item>virtual</Item>
+ <Item>override</Item>
+ <Item>sealed</Item>
+ <Item>static</Item>
+ <Item>readonly</Item>
+ <Item>extern</Item>
+ <Item>unsafe</Item>
+ <Item>volatile</Item>
+ </MODIFIERS_ORDER>
+ <PLACE_WHILE_ON_NEW_LINE>True</PLACE_WHILE_ON_NEW_LINE>
+ <SPACE_AFTER_TYPECAST_PARENTHESES>False</SPACE_AFTER_TYPECAST_PARENTHESES>
+ <SPACE_AROUND_MULTIPLICATIVE_OP>True</SPACE_AROUND_MULTIPLICATIVE_OP>
+ <SPACE_BEFORE_TYPEOF_PARENTHESES>False</SPACE_BEFORE_TYPEOF_PARENTHESES>
+ <SPACE_WITHIN_SINGLE_LINE_ARRAY_INITIALIZER_BRACES>True</SPACE_WITHIN_SINGLE_LINE_ARRAY_INITIALIZER_BRACES>
+ <WRAP_AFTER_DECLARATION_LPAR>True</WRAP_AFTER_DECLARATION_LPAR>
+ <WRAP_AFTER_INVOCATION_LPAR>True</WRAP_AFTER_INVOCATION_LPAR>
+ <WRAP_ARGUMENTS_STYLE>CHOP_IF_LONG</WRAP_ARGUMENTS_STYLE>
+ <WRAP_EXTENDS_LIST_STYLE>CHOP_IF_LONG</WRAP_EXTENDS_LIST_STYLE>
+ <WRAP_LIMIT>90</WRAP_LIMIT>
+ <WRAP_PARAMETERS_STYLE>CHOP_IF_LONG</WRAP_PARAMETERS_STYLE>
+ <WRAP_TERNARY_EXPR_STYLE>CHOP_ALWAYS</WRAP_TERNARY_EXPR_STYLE>
+ </FormatSettings>
+ <UsingsSettings>
+ <AddImportsToDeepestScope>True</AddImportsToDeepestScope>
+ <AllowAlias>False</AllowAlias>
+ </UsingsSettings>
+ <Naming2>
+ <EventHandlerPatternLong>$object$_On$event$</EventHandlerPatternLong>
+ <EventHandlerPatternShort>$event$Handler</EventHandlerPatternShort>
+ <ExceptionName IsNull="False">
+ </ExceptionName>
+ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="TypesAndNamespaces" />
+ <PredefinedRule Inspect="True" Prefix="I" Suffix="" Style="AaBb" ElementKind="Interfaces" />
+ <PredefinedRule Inspect="True" Prefix="T" Suffix="" Style="AaBb" ElementKind="TypeParameters" />
+ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="MethodPropertyEvent" />
+ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="Locals" />
+ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="LocalConstants" />
+ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="Parameters" />
+ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="PublicFields" />
+ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="Constants" />
+ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="StaticReadonly" />
+ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="EnumMember" />
+ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="Other" />
+ <PredefinedRule Inspect="True" Prefix="_" Suffix="" Style="aaBb" ElementKind="PrivateInstanceFields" />
+ <PredefinedRule Inspect="True" Prefix="_" Suffix="" Style="aaBb" ElementKind="PrivateStaticFields" />
+ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="PrivateConstants" />
+ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="PrivateStaticReadonly" />
+ </Naming2>
+ <CustomMemberReorderingPatterns><![CDATA[<?xml version="1.0" encoding="utf-8" ?>
+
+<!--
+I. Overall
+
+I.1 Each pattern can have <Match>....</Match> element. For the given type declaration, the pattern with the match, evaluated to 'true' with the largest weight, will be used
+I.2 Each pattern consists of the sequence of <Entry>...</Entry> elements. Type member declarations are distributed between entries
+I.3 If pattern has RemoveAllRegions="true" attribute, then all regions will be cleared prior to reordering. Otherwise, only auto-generated regions will be cleared
+I.4 The contents of each entry is sorted by given keys (First key is primary, next key is secondary, etc). Then the declarations are grouped and en-regioned by given property
+
+II. Available match operands
+
+Each operand may have Weight="..." attribute. This weight will be added to the match weight if the operand is evaluated to 'true'.
+The default weight is 1
+
+II.1 Boolean functions:
+II.1.1 <And>....</And>
+II.1.2 <Or>....</Or>
+II.1.3 <Not>....</Not>
+
+II.2 Operands
+II.2.1 <Kind Is="..."/>. Kinds are: class, struct, interface, enum, delegate, type, constructor, destructor, property, indexer, method, operator, field, constant, event, member
+II.2.2 <Name Is="..." [IgnoreCase="true/false"] />. The 'Is' attribute contains regular expression
+II.2.3 <HasAttribute CLRName="..." [Inherit="true/false"] />. The 'CLRName' attribute contains regular expression
+II.2.4 <Access Is="..."/>. The 'Is' values are: public, protected, internal, protected internal, private
+II.2.5 <Static/>
+II.2.6 <Abstract/>
+II.2.7 <Virtual/>
+II.2.8 <Override/>
+II.2.9 <Sealed/>
+II.2.10 <Readonly/>
+II.2.11 <ImplementsInterface CLRName="..."/>. The 'CLRName' attribute contains regular expression
+II.2.12 <HandlesEvent />
+-->
+
+<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"/>
+ <Or>
+ <HasAttribute CLRName="System.Runtime.InteropServices.InterfaceTypeAttribute"/>
+ <HasAttribute CLRName="System.Runtime.InteropServices.ComImport"/>
+ </Or>
+ </And>
+ <HasAttribute CLRName="System.Runtime.InteropServices.StructLayoutAttribute"/>
+ </Or>
+ </Match>
+ </Pattern>
+
+ <!--Special formatting of NUnit test fixture-->
+ <Pattern RemoveAllRegions="true">
+ <Match>
+ <And Weight="100">
+ <Kind Is="class"/>
+ <HasAttribute CLRName="NUnit.Framework.TestFixtureAttribute" Inherit="true"/>
+ </And>
+ </Match>
+
+ <!--Setup/Teardow-->
+ <Entry>
+ <Match>
+ <And>
+ <Kind Is="method"/>
+ <Or>
+ <HasAttribute CLRName="NUnit.Framework.SetUpAttribute" Inherit="true"/>
+ <HasAttribute CLRName="NUnit.Framework.TearDownAttribute" Inherit="true"/>
+ <HasAttribute CLRName="NUnit.Framework.FixtureSetUpAttribute" Inherit="true"/>
+ <HasAttribute CLRName="NUnit.Framework.FixtureTearDownAttribute" Inherit="true"/>
+ </Or>
+ </And>
+ </Match>
+ <Group Region="Setup/Teardown"/>
+ </Entry>
+
+ <!--All other members-->
+ <Entry/>
+
+ <!--Test methods-->
+ <Entry>
+ <Match>
+ <And Weight="100">
+ <Kind Is="method"/>
+ <HasAttribute CLRName="NUnit.Framework.TestAttribute" Inherit="false"/>
+ </And>
+ </Match>
+ <Sort>
+ <Name/>
+ </Sort>
+ </Entry>
+ </Pattern>
+
+ <!--Default pattern-->
+ <Pattern>
+
+ <!--public delegate-->
+ <Entry>
+ <Match>
+ <And Weight="100">
+ <Access Is="public"/>
+ <Kind Is="delegate"/>
+ </And>
+ </Match>
+ <Sort>
+ <Name/>
+ </Sort>
+ <Group Region="Delegates"/>
+ </Entry>
+
+ <!--public enum-->
+ <Entry>
+ <Match>
+ <And Weight="100">
+ <Access Is="public"/>
+ <Kind Is="enum"/>
+ </And>
+ </Match>
+ <Sort>
+ <Name/>
+ </Sort>
+ <Group>
+ <Name Region="${Name} enum"/>
+ </Group>
+ </Entry>
+
+ <!--static fields and constants-->
+ <Entry>
+ <Match>
+ <Or>
+ <Kind Is="constant"/>
+ <And>
+ <Kind Is="field"/>
+ <Static/>
+ </And>
+ </Or>
+ </Match>
+ <Sort>
+ <Kind Order="constant field"/>
+ </Sort>
+ </Entry>
+
+ <!--instance fields-->
+ <Entry>
+ <Match>
+ <And>
+ <Kind Is="field"/>
+ <Not>
+ <Static/>
+ </Not>
+ </And>
+ </Match>
+ <Sort>
+ <Readonly/>
+ <Name/>
+ </Sort>
+ </Entry>
+
+ <!--Constructors. Place static one first-->
+ <Entry>
+ <Match>
+ <Kind Is="constructor"/>
+ </Match>
+ <Sort>
+ <Static/>
+ </Sort>
+ </Entry>
+
+ <!--properties, indexers-->
+ <Entry>
+ <Match>
+ <Or>
+ <Kind Is="property"/>
+ <Kind Is="indexer"/>
+ </Or>
+ </Match>
+ </Entry>
+
+ <!--interface implementations-->
+ <Entry>
+ <Match>
+ <And Weight="100">
+ <Kind Is="member"/>
+ <ImplementsInterface/>
+ </And>
+ </Match>
+ <Sort>
+ <ImplementsInterface Immediate="true"/>
+ </Sort>
+ </Entry>
+
+ <!--all other members-->
+ <Entry/>
+
+ <!--nested types-->
+ <Entry>
+ <Match>
+ <Kind Is="type"/>
+ </Match>
+ <Sort>
+ <Name/>
+ </Sort>
+ <Group>
+ <Name Region="Nested type: ${Name}"/>
+ </Group>
+ </Entry>
+ </Pattern>
+
+</Patterns>
+]]></CustomMemberReorderingPatterns>
+ </CSharp>
+ <VB>
+ <FormatSettings />
+ <ImportsSettings />
+ <Naming2>
+ <EventHandlerPatternLong>$object$_On$event$</EventHandlerPatternLong>
+ <EventHandlerPatternShort>$event$Handler</EventHandlerPatternShort>
+ </Naming2>
+ </VB>
+ <Web>
+ <Naming2 />
+ </Web>
+ <Xaml>
+ <Naming2 />
+ </Xaml>
+ <XML>
+ <FormatSettings />
+ </XML>
+ <GenerateMemberBody />
+ <Naming2>
+ <EventHandlerPatternLong>$object$_On$event$</EventHandlerPatternLong>
+ <EventHandlerPatternShort>$event$Handler</EventHandlerPatternShort>
+ <ExceptionName IsNull="False">
+ </ExceptionName>
+ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="TypesAndNamespaces" />
+ <PredefinedRule Inspect="True" Prefix="I" Suffix="" Style="AaBb" ElementKind="Interfaces" />
+ <PredefinedRule Inspect="True" Prefix="T" Suffix="" Style="AaBb" ElementKind="TypeParameters" />
+ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="MethodPropertyEvent" />
+ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="Locals" />
+ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="LocalConstants" />
+ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="Parameters" />
+ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="PublicFields" />
+ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="Constants" />
+ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="StaticReadonly" />
+ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="EnumMember" />
+ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="Other" />
+ <PredefinedRule Inspect="True" Prefix="_" Suffix="" Style="aaBb" ElementKind="PrivateInstanceFields" />
+ <PredefinedRule Inspect="True" Prefix="_" Suffix="" Style="aaBb" ElementKind="PrivateStaticFields" />
+ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="PrivateConstants" />
+ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="PrivateStaticReadonly" />
+ <UserRule Inspect="True" Prefix="" Suffix="" Style="aa_bb" StaticnessKind="Static, Instance" AccessRight="Public" Description="BDD Naming">
+ <ElementKinds>
+ <Kind Name="CLASS" />
+ <Kind Name="METHOD" />
+ </ElementKinds>
+ <ExtraRule Prefix="" Suffix="" Style="AaBb" />
+ </UserRule>
+ <Abbreviation Text="UI" />
+ </Naming2>
+ </CodeStyleSettings>
+ <SharedSolutionTemplateManager>
+ <LiveTemplates>
+ <Template uid="5c990fab-0209-4dbb-b66a-5f7fa4da8eb4" shortcut="inpc" description="Property mit private Field, dass beim Setter einen INPC Event aufruft." text="private $TYPE$ _$FIELDNAME$;&#xD;&#xA;&#xD;&#xA;public $TYPE$ $NAME$&#xD;&#xA;{&#xD;&#xA; get { return _$FIELDNAME$; }&#xD;&#xA; &#xD;&#xA; set&#xD;&#xA; {&#xD;&#xA; _$FIELDNAME$ = value;&#xD;&#xA; PropertyChanged.Raise(x =&gt; $NAME$);&#xD;&#xA; }&#xD;&#xA;}" reformat="True" shortenQualifiedReferences="True">
+ <Context>
+ <CSharpContext context="TypeMember" minimumLanguageVersion="2.0" />
+ </Context>
+ <Categories />
+ <Variables>
+ <Variable name="TYPE" expression="constant(&quot;string&quot;)" initialRange="1" />
+ <Variable name="NAME" expression="" initialRange="0" />
+ <Variable name="FIELDNAME" expression="decapitalize(NAME)" initialRange="-1" />
+ </Variables>
+ <CustomProperties />
+ </Template>
+ <Template uid="0843cda6-da1b-4d71-9ed3-7cfba59403d9" shortcut="inpccs" description="" text="[Concern(typeof($ConcernType$))]&#xD;&#xA;public class when_changing_$propertyname$_on_$concerntype$ : InstanceContextSpecification&lt;$ConcernType$&gt;&#xD;&#xA;{&#xD;&#xA; private PropertyChangedTester&lt;$ConcernType$&gt; _tester;&#xD;&#xA;&#xD;&#xA; protected override void Because()&#xD;&#xA; {&#xD;&#xA; _tester = Sut.GetPropertyChangedTester();&#xD;&#xA; }&#xD;&#xA;&#xD;&#xA; [Observation]&#xD;&#xA; public void should_access_be_possible_and_propertychanged_event_be_raised()&#xD;&#xA; {&#xD;&#xA; _tester.CanAccessAndRaisesEvent(x =&gt; x.$PropertyName$).ShouldBeTrue();&#xD;&#xA; }&#xD;&#xA;}" reformat="False" shortenQualifiedReferences="True">
+ <Context>
+ <CSharpContext context="TypeAndNamespace" minimumLanguageVersion="2.0" />
+ </Context>
+ <Categories />
+ <Variables>
+ <Variable name="ConcernType" expression="SuggestBddConcern()" initialRange="0" />
+ <Variable name="PropertyName" expression="" initialRange="0" />
+ <Variable name="propertyname" expression="LowerCase(PropertyName)" initialRange="-1" />
+ <Variable name="concerntype" expression="LowerCase(ConcernType)" initialRange="-1" />
+ </Variables>
+ <CustomProperties />
+ </Template>
+ <Template uid="70c4a28e-422c-4d3e-9cf7-9edf001092c2" shortcut="ob" description="BDD Observation" text=" [Observation]&#xD;&#xA; public void should_$next_observation$()&#xD;&#xA; {&#xD;&#xA; $END$&#xD;&#xA; }" reformat="False" shortenQualifiedReferences="True">
+ <Context>
+ <CSharpContext context="TypeMember" minimumLanguageVersion="2.0" />
+ </Context>
+ <Categories />
+ <Variables>
+ <Variable name="next_observation" expression="" initialRange="0" />
+ </Variables>
+ <CustomProperties />
+ </Template>
+ <Template uid="39e41326-9235-4ea3-a45e-590735d26b76" shortcut="scs" description="BDD StaticContextSpecification" text=" [Concern(typeof($ConcernType$))]&#xD;&#xA; public class when_$context_name$ : StaticContextSpecification&#xD;&#xA; {&#xD;&#xA; protected override void EstablishContext()&#xD;&#xA; {&#xD;&#xA; $END$&#xD;&#xA; }&#xD;&#xA;&#xD;&#xA; protected override void Because()&#xD;&#xA; {&#xD;&#xA; &#xD;&#xA; }&#xD;&#xA;&#xD;&#xA; [Observation]&#xD;&#xA; public void should_$observation$()&#xD;&#xA; {&#xD;&#xA; &#xD;&#xA; }&#xD;&#xA; }" reformat="False" shortenQualifiedReferences="True">
+ <Context>
+ <CSharpContext context="TypeAndNamespace" minimumLanguageVersion="2.0" />
+ </Context>
+ <Categories />
+ <Variables>
+ <Variable name="ConcernType" expression="SuggestBddConcern()" initialRange="0" />
+ <Variable name="context_name" expression="" initialRange="0" />
+ <Variable name="observation" expression="constant(&quot;first_observation&quot;)" initialRange="0" />
+ </Variables>
+ <CustomProperties />
+ </Template>
+ <Template uid="ac06fda1-b4ab-465a-bd22-cfa1a817f26c" shortcut="ics" description="BDD InstanceContextSpecification" text=" [Concern(typeof($ConcernType$))]&#xD;&#xA; public class when_$context_name$ : InstanceContextSpecification&lt;$ConcernType$&gt;&#xD;&#xA; {&#xD;&#xA; protected override void EstablishContext()&#xD;&#xA; {&#xD;&#xA; &#xD;&#xA; }&#xD;&#xA;&#xD;&#xA; protected override $ConcernType$ CreateSut()&#xD;&#xA; {&#xD;&#xA; return $END$&#xD;&#xA; }&#xD;&#xA;&#xD;&#xA; protected override void Because()&#xD;&#xA; {&#xD;&#xA; &#xD;&#xA; }&#xD;&#xA; &#xD;&#xA; [Observation]&#xD;&#xA; public void should_$observation$()&#xD;&#xA; {&#xD;&#xA; &#xD;&#xA; }&#xD;&#xA; }" reformat="False" shortenQualifiedReferences="True">
+ <Context>
+ <CSharpContext context="TypeAndNamespace" minimumLanguageVersion="2.0" />
+ </Context>
+ <Categories />
+ <Variables>
+ <Variable name="ConcernType" expression="SuggestBddConcern()" initialRange="0" />
+ <Variable name="context_name" expression="" initialRange="0" />
+ <Variable name="observation" expression="constant(&quot;first_observation&quot;)" initialRange="0" />
+ </Variables>
+ <CustomProperties />
+ </Template>
+ <Template uid="2f946a0b-8cf9-4852-b5e1-f9892d77aaa6" shortcut="icsa" description="BDD InstanceContextSpecification mit AutoMocking" text=" [Concern(typeof($ConcernType$))]&#xD;&#xA; public class when_$context_name$ : InstanceContextSpecification&lt;$ConcernType$&gt;&#xD;&#xA; {&#xD;&#xA; protected override void EstablishContext()&#xD;&#xA; {&#xD;&#xA; $END$&#xD;&#xA; }&#xD;&#xA;&#xD;&#xA; protected override void PrepareSut()&#xD;&#xA; {&#xD;&#xA; &#xD;&#xA; }&#xD;&#xA;&#xD;&#xA; protected override void Because()&#xD;&#xA; {&#xD;&#xA; &#xD;&#xA; }&#xD;&#xA;&#xD;&#xA; [Observation]&#xD;&#xA; public void should_$observation$()&#xD;&#xA; {&#xD;&#xA; &#xD;&#xA; }&#xD;&#xA; }" reformat="False" shortenQualifiedReferences="True">
+ <Context>
+ <CSharpContext context="TypeAndNamespace" minimumLanguageVersion="2.0" />
+ </Context>
+ <Categories />
+ <Variables>
+ <Variable name="ConcernType" expression="SuggestBddConcern()" initialRange="0" />
+ <Variable name="context_name" expression="" initialRange="0" />
+ <Variable name="observation" expression="constant(&quot;first_observation&quot;)" initialRange="0" />
+ </Variables>
+ <CustomProperties />
+ </Template>
+ <Template uid="96b43c2c-4eda-41a0-942e-2a034b61946f" shortcut="builder" description="TestObjectBuilder" text=" /// &lt;summary&gt;&#xD;&#xA; /// Nur für Tests&#xD;&#xA; /// &lt;/summary&gt;&#xD;&#xA; public class $ClassName$Builder&#xD;&#xA; {&#xD;&#xA; public static $ClassName$Builder Create&#xD;&#xA; {&#xD;&#xA; get { return new $ClassName$Builder(); }&#xD;&#xA; }&#xD;&#xA;&#xD;&#xA; public static implicit operator $ClassName$($ClassName$Builder builder)&#xD;&#xA; {&#xD;&#xA; return builder.Build();&#xD;&#xA; }&#xD;&#xA;&#xD;&#xA; private $ClassName$ Build()&#xD;&#xA; {&#xD;&#xA; return new $ClassName$();&#xD;&#xA; }&#xD;&#xA; }" reformat="True" shortenQualifiedReferences="True">
+ <Context>
+ <CSharpContext context="TypeAndNamespace" minimumLanguageVersion="2.0" />
+ </Context>
+ <Categories />
+ <Variables>
+ <Variable name="ClassName" expression="" initialRange="0" />
+ </Variables>
+ <CustomProperties />
+ </Template>
+ <Template uid="010e316f-1c28-430a-a5f5-a071c1e21194" shortcut="builderwith" description="WithProperty in TestObjectBuilder" text="public $ClassName$ With$Property$($type$ $PropertyLower$)&#xD;&#xA;{&#xD;&#xA; _$PropertyLower$ = $PropertyLower$;&#xD;&#xA; return this;&#xD;&#xA;}" reformat="True" shortenQualifiedReferences="True">
+ <Context>
+ <CSharpContext context="TypeMember" minimumLanguageVersion="2.0" />
+ </Context>
+ <Categories />
+ <Variables>
+ <Variable name="ClassName" expression="typeName()" initialRange="-1" />
+ <Variable name="Property" expression="" initialRange="0" />
+ <Variable name="type" expression="" initialRange="0" />
+ <Variable name="PropertyLower" expression="decapitalize(Property)" initialRange="-1" />
+ </Variables>
+ <CustomProperties />
+ </Template>
+ </LiveTemplates>
+ </SharedSolutionTemplateManager>
+</Configuration>
4 src/CsharpMonads/CsharpMonads.csproj
View
@@ -42,6 +42,10 @@
</Reference>
</ItemGroup>
<ItemGroup>
+ <Compile Include="Maybe.cs" />
+ <Compile Include="MaybeSpecs.cs">
+ <DependentUpon>Maybe.cs</DependentUpon>
+ </Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
24 src/CsharpMonads/Maybe.cs
View
@@ -0,0 +1,24 @@
+namespace CsharpMonads
+{
+ using System;
+
+ public class Maybe<T>
+ {
+ private bool _isNone;
+
+ public Maybe()
+ {
+ _isNone = true;
+ }
+
+ public static Maybe<int> None
+ {
+ get { return new Maybe<int>(); }
+ }
+
+ public bool IsNone
+ {
+ get { return _isNone; }
+ }
+ }
+}
24 src/CsharpMonads/MaybeSpecs.cs
View
@@ -0,0 +1,24 @@
+namespace CsharpMonads
+{
+ using Xunit;
+
+ [Concern(typeof(Maybe<int>))]
+ public class when_creating_a_maybe_monad_without_value : InstanceContextSpecification<Maybe<int>>
+ {
+ protected override Maybe<int> CreateSut()
+ {
+ return Maybe<int>.None;
+ }
+
+ protected override void Because()
+ {
+ // ctor
+ }
+
+ [Observation]
+ public void should_be_none()
+ {
+ Sut.IsNone.ShouldBeTrue();
+ }
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.