Коммит
4d2a134a3b
|
@ -13,3 +13,6 @@ obj
|
|||
|
||||
# mstest test results
|
||||
TestResults
|
||||
|
||||
# NuGet
|
||||
packages
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
<AssemblyName>money</AssemblyName>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
<Name>money</Name>
|
||||
<TargetFSharpCoreVersion>2.3.0.0</TargetFSharpCoreVersion>
|
||||
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
@ -31,18 +33,35 @@
|
|||
<WarningLevel>3</WarningLevel>
|
||||
<DocumentationFile>bin\Release\money.XML</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="FSharp.Core" />
|
||||
<Reference Include="nunit.framework, Version=2.6.1.12217, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" />
|
||||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
<Choose>
|
||||
<When Condition="'$(VisualStudioVersion)' == '11.0'">
|
||||
<PropertyGroup>
|
||||
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
|
||||
</PropertyGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
<Import Project="$(FSharpTargetsPath)" Condition="Exists('$(FSharpTargetsPath)')" />
|
||||
<ItemGroup>
|
||||
<Compile Include="Money.fs" />
|
||||
<Compile Include="MoneyTest.fs" />
|
||||
<Content Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="FSharp.Core, Version=$(TargetFSharpCoreVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="nunit.framework">
|
||||
<HintPath>packages\NUnit.3.0.0-alpha-3\lib\net20\nunit.framework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath32)\FSharp\1.0\Microsoft.FSharp.Targets" Condition="!Exists('$(MSBuildBinPath)\Microsoft.Build.Tasks.v4.0.dll')" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft F#\v4.0\Microsoft.FSharp.Targets" Condition=" Exists('$(MSBuildBinPath)\Microsoft.Build.Tasks.v4.0.dll')" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.31101.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "fs-money", "fs-money.fsproj", "{3F6B1A52-B393-4218-9293-BE3F1701B6B6}"
|
||||
EndProject
|
||||
Global
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="NUnit" version="3.0.0-alpha-3" targetFramework="net20" />
|
||||
</packages>
|
|
@ -105,31 +105,31 @@ let SubstringTests() =
|
|||
let array = [| "abc"; "bad"; "dba" |]
|
||||
StringAssert.Contains("World", phrase)
|
||||
Assert.That(phrase, Contains.Substring("World"))
|
||||
Assert.That(phrase, Is.Not.StringContaining("goodbye"))
|
||||
Assert.That(phrase, Does.Not.Contain("goodbye"))
|
||||
Assert.That(phrase, Contains.Substring("WORLD").IgnoreCase)
|
||||
Assert.That(phrase, Is.Not.StringContaining("BYE").IgnoreCase)
|
||||
Assert.That(array, Has.All.StringContaining( "b" ) )
|
||||
Assert.That(phrase, Does.Not.Contain("BYE").IgnoreCase)
|
||||
Assert.That(array, Has.All.Contains( "b" ) )
|
||||
|
||||
[<Test>]
|
||||
let StartsWithTests() =
|
||||
let phrase = "Hello World!"
|
||||
let greetings = [| "Hello!"; "Hi!"; "Hola!" |]
|
||||
StringAssert.StartsWith("Hello", phrase);
|
||||
Assert.That(phrase, Is.StringStarting("Hello"))
|
||||
Assert.That(phrase, Is.Not.StringStarting("Hi!"))
|
||||
Assert.That(phrase, Is.StringStarting("HeLLo").IgnoreCase)
|
||||
Assert.That(phrase, Is.Not.StringStarting("HI").IgnoreCase)
|
||||
Assert.That(greetings, Is.All.StringStarting("h").IgnoreCase)
|
||||
Assert.That(phrase, Does.StartWith("Hello"))
|
||||
Assert.That(phrase, Does.Not.StartWith("Hi!"))
|
||||
Assert.That(phrase, Does.StartWith("HeLLo").IgnoreCase)
|
||||
Assert.That(phrase, Does.Not.StartWith("HI").IgnoreCase)
|
||||
Assert.That(greetings, Is.All.StartsWith("h").IgnoreCase)
|
||||
|
||||
[<Test>]
|
||||
let EndsWithTests() =
|
||||
let phrase = "Hello World!"
|
||||
let greetings = [| "Hello!"; "Hi!"; "Hola!" |];
|
||||
StringAssert.EndsWith("!", phrase)
|
||||
Assert.That(phrase, Is.StringEnding("!"))
|
||||
Assert.That(phrase, Is.Not.StringEnding("?"))
|
||||
Assert.That(phrase, Is.StringEnding("WORLD!").IgnoreCase)
|
||||
Assert.That(greetings, Is.All.StringEnding("!"))
|
||||
Assert.That(phrase, Does.EndWith("!"))
|
||||
Assert.That(phrase, Does.Not.EndWith("?"))
|
||||
Assert.That(phrase, Does.EndWith("WORLD!").IgnoreCase)
|
||||
Assert.That(greetings, Is.All.EndsWith("!"))
|
||||
|
||||
[<Test>]
|
||||
let EqualIgnoringCaseTests() =
|
||||
|
@ -148,11 +148,11 @@ let RegularExpressionTests() =
|
|||
let quotes = [| "Never say never"; "It's never too late"; "Nevermore!" |]
|
||||
StringAssert.IsMatch( "all good men", phrase )
|
||||
StringAssert.IsMatch( "Now.*come", phrase )
|
||||
Assert.That( phrase, Is.StringMatching( "all good men" ) )
|
||||
Assert.That( phrase, Is.StringMatching( "Now.*come" ) )
|
||||
Assert.That( phrase, Is.Not.StringMatching("all.*men.*good") )
|
||||
Assert.That( phrase, Is.StringMatching("ALL").IgnoreCase )
|
||||
Assert.That( quotes, Is.All.StringMatching("never").IgnoreCase )
|
||||
Assert.That( phrase, Does.Match( "all good men" ) )
|
||||
Assert.That( phrase, Does.Match( "Now.*come" ) )
|
||||
Assert.That( phrase, Does.Not.Match("all.*men.*good") )
|
||||
Assert.That( phrase, Does.Match("ALL").IgnoreCase )
|
||||
Assert.That( quotes, Is.All.Matches("never").IgnoreCase )
|
||||
|
||||
[<Test>]
|
||||
let EqualityTests() =
|
||||
|
@ -254,7 +254,7 @@ let AllItemsTests() =
|
|||
Assert.That(ints, Is.All.GreaterThan(0))
|
||||
Assert.That(ints, Has.All.GreaterThan(0));
|
||||
Assert.That(ints, Has.None.LessThanOrEqualTo(0))
|
||||
Assert.That(strings, Is.All.StringContaining( "a" ) )
|
||||
Assert.That(strings, Is.All.Contains( "a" ) )
|
||||
Assert.That(strings, Has.All.Contains( "a" ) )
|
||||
Assert.That(strings, Has.Some.StartsWith( "ba" ) )
|
||||
Assert.That( strings, Has.Some.Property( "Length" ).EqualTo( 3 ) )
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
<AssemblyName>syntax</AssemblyName>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
<Name>syntax</Name>
|
||||
<TargetFSharpCoreVersion>2.3.0.0</TargetFSharpCoreVersion>
|
||||
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
@ -31,17 +33,34 @@
|
|||
<WarningLevel>3</WarningLevel>
|
||||
<DocumentationFile>bin\Release\syntax.XML</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="FSharp.Core" />
|
||||
<Reference Include="nunit.framework, Version=2.6.1.12217, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" />
|
||||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
<Choose>
|
||||
<When Condition="'$(VisualStudioVersion)' == '11.0'">
|
||||
<PropertyGroup>
|
||||
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
|
||||
</PropertyGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
<Import Project="$(FSharpTargetsPath)" Condition="Exists('$(FSharpTargetsPath)')" />
|
||||
<ItemGroup>
|
||||
<Compile Include="AssertSyntaxTests.fs" />
|
||||
<Content Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="FSharp.Core, Version=$(TargetFSharpCoreVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="nunit.framework">
|
||||
<HintPath>packages\NUnit.3.0.0-alpha-3\lib\net20\nunit.framework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath32)\FSharp\1.0\Microsoft.FSharp.Targets" Condition="!Exists('$(MSBuildBinPath)\Microsoft.Build.Tasks.v4.0.dll')" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft F#\v4.0\Microsoft.FSharp.Targets" Condition=" Exists('$(MSBuildBinPath)\Microsoft.Build.Tasks.v4.0.dll')" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.31101.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "fs-syntax", "fs-syntax.fsproj", "{5DE001E7-2606-4DFE-8C03-90C70D2C3805}"
|
||||
EndProject
|
||||
Global
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="NUnit" version="3.0.0-alpha-3" targetFramework="net20" />
|
||||
</packages>
|
Загрузка…
Ссылка в новой задаче