forked from machine/machine.specifications
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Work on Distribution stuff for Specifications.
Adding Gallio apache license stuff for the code I "borrowed".
- Loading branch information
1 parent
9e47b79
commit 8f354e3
Showing
21 changed files
with
394 additions
and
58 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@echo off & if not "%ECHO%"=="" echo %ECHO% | ||
|
||
setlocal | ||
set LOCALDIR=%~dp0 | ||
|
||
echo Windows Registry Editor Version 5.00 > MSpecTDNet.reg | ||
echo [HKEY_CURRENT_USER\Software\MutantDesign\TestDriven.NET\TestRunners\MSpec] >> MSpecTDNet.reg | ||
echo "Application"="" >> MSpecTDNet.reg | ||
echo "AssemblyPath"="%LOCALDIR:\=\\%Machine.Specifications.TDNetRunner.dll" >> MSpecTDNet.reg | ||
echo "TargetFrameworkAssemblyName"="Machine.Specifications" >> MSpecTDNet.reg | ||
echo "TypeName"="Machine.Specifications.TDNetRunner.SpecificationRunner" >> MSpecTDNet.reg | ||
echo @="5" >> MSpecTDNet.reg | ||
|
||
regedit MSpecTDNet.reg | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@echo off & if not "%ECHO%"=="" echo %ECHO% | ||
|
||
setlocal | ||
set LOCALDIR=%~dp0 | ||
|
||
echo Windows Registry Editor Version 5.00 > MSpecTDNet.reg | ||
echo [HKEY_CURRENT_USER\Software\MutantDesign\TestDriven.NET\TestRunners\MSpec] >> MSpecTDNet.reg | ||
echo "Application"="" >> MSpecTDNet.reg | ||
echo "AssemblyPath"="%LOCALDIR:\=\\%Machine.Specifications.TDNetRunner.dll" >> MSpecTDNet.reg | ||
echo "TargetFrameworkAssemblyName"="Machine.Specifications" >> MSpecTDNet.reg | ||
echo "TypeName"="Machine.Specifications.TDNetRunner.SpecificationRunner" >> MSpecTDNet.reg | ||
echo @="5" >> MSpecTDNet.reg | ||
|
||
regedit /s MSpecTDNet.reg | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright (c) 2008 Machine Project | ||
Portions Copyright (c) 2008 Jacob Lewallen, Aaron Jensen | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
29 changes: 29 additions & 0 deletions
29
Distribution/Specifications/Machine.Specifications.Example/Account.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace Machine.Specifications.Example | ||
{ | ||
public class Account | ||
{ | ||
private decimal _balance; | ||
|
||
public decimal Balance | ||
{ | ||
get { return _balance; } | ||
set { _balance = value; } | ||
} | ||
|
||
public void Transfer(decimal amount, Account toAccount) | ||
{ | ||
if (amount > _balance) | ||
{ | ||
throw new Exception(String.Format("Cannot transfer ${0}. The available balance is ${1}.", amount, _balance)); | ||
} | ||
|
||
_balance -= amount; | ||
toAccount.Balance += amount; | ||
} | ||
} | ||
} |
82 changes: 82 additions & 0 deletions
82
Distribution/Specifications/Machine.Specifications.Example/BankingSpecs.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace Machine.Specifications.Example | ||
{ | ||
[Description] | ||
public class Transferring_between_from_account_and_to_account | ||
{ | ||
static Account fromAccount; | ||
static Account toAccount; | ||
|
||
Context before_each =()=> | ||
{ | ||
fromAccount = new Account {Balance = 1m}; | ||
toAccount = new Account {Balance = 1m}; | ||
}; | ||
|
||
When the_transfer_is_made =()=> | ||
{ | ||
fromAccount.Transfer(1m, toAccount); | ||
}; | ||
|
||
It should_debit_the_from_account_by_the_amount_transferred =()=> | ||
{ | ||
fromAccount.Balance.ShouldEqual(0m); | ||
}; | ||
|
||
It should_credit_the_to_account_by_the_amount_transferred =()=> | ||
{ | ||
toAccount.Balance.ShouldEqual(2m); | ||
}; | ||
} | ||
|
||
public abstract class with_from_account_and_to_account | ||
{ | ||
protected static Account fromAccount; | ||
protected static Account toAccount; | ||
|
||
Context before_each =()=> | ||
{ | ||
fromAccount = new Account {Balance = 1m}; | ||
toAccount = new Account {Balance = 1m}; | ||
}; | ||
} | ||
|
||
[Description] | ||
public class Transferring_between_two_accounts | ||
: with_from_account_and_to_account | ||
{ | ||
When the_transfer_is_made =()=> | ||
{ | ||
fromAccount.Transfer(1m, toAccount); | ||
}; | ||
|
||
It should_debit_the_from_account_by_the_ammount_transferred =()=> | ||
{ | ||
fromAccount.Balance.ShouldEqual(0m); | ||
}; | ||
|
||
It should_credit_the_to_account_by_the_amount_transferred =()=> | ||
{ | ||
toAccount.Balance.ShouldEqual(2m); | ||
}; | ||
} | ||
|
||
[Description] | ||
public class Transferring_an_amount_greater_than_the_balance_of_the_from_account | ||
: with_from_account_and_to_account | ||
{ | ||
When the_transfer_is_made =()=> | ||
{ | ||
fromAccount.Transfer(2m, toAccount); | ||
}; | ||
|
||
It_should_throw a_System_Exception =x=> | ||
{ | ||
x.ShouldBeOfType<Exception>(); | ||
}; | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
...ution/Specifications/Machine.Specifications.Example/Machine.Specifications.Example.csproj
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProductVersion>9.0.21022</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{2C28C643-31A2-44CA-B762-953A963F6F61}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>Machine.Specifications.Example</RootNamespace> | ||
<AssemblyName>Machine.Specifications.Example</AssemblyName> | ||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Machine.Specifications, Version=0.1.0.0, Culture=neutral, processorArchitecture=MSIL"> | ||
<SpecificVersion>False</SpecificVersion> | ||
<HintPath>..\Machine.Specifications.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core"> | ||
<RequiredTargetFramework>3.5</RequiredTargetFramework> | ||
</Reference> | ||
<Reference Include="System.Xml.Linq"> | ||
<RequiredTargetFramework>3.5</RequiredTargetFramework> | ||
</Reference> | ||
<Reference Include="System.Data.DataSetExtensions"> | ||
<RequiredTargetFramework>3.5</RequiredTargetFramework> | ||
</Reference> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Account.cs" /> | ||
<Compile Include="BankingSpecs.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<!-- 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"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
36 changes: 36 additions & 0 deletions
36
Distribution/Specifications/Machine.Specifications.Example/Properties/AssemblyInfo.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("Machine.Specifications.Example")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("Microsoft")] | ||
[assembly: AssemblyProduct("Machine.Specifications.Example")] | ||
[assembly: AssemblyCopyright("Copyright © Microsoft 2008")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("01cb66b4-916d-46d3-a63e-afd05644228e")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Build and Revision Numbers | ||
// by using the '*' as shown below: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
This file contains 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
19 changes: 18 additions & 1 deletion
19
Source/Specifications/Machine.Specifications.GallioAdapter.Tests/BaseTestFrameworkTest.cs
This file contains 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
19 changes: 18 additions & 1 deletion
19
Source/Specifications/Machine.Specifications.GallioAdapter.Tests/FrameworkTests.cs
This file contains 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
14 changes: 14 additions & 0 deletions
14
Source/Specifications/Machine.Specifications.GallioAdapter.Tests/Gallio License.txt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Copyright 2005-2008 Gallio Project - http://www.gallio.org/ | ||
Portions Copyright 2000-2004 Jonathan De Halleux, Jamie Cansdale | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
14 changes: 14 additions & 0 deletions
14
Source/Specifications/Machine.Specifications.GallioAdapter/Gallio License.txt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Copyright 2005-2008 Gallio Project - http://www.gallio.org/ | ||
Portions Copyright 2000-2004 Jonathan De Halleux, Jamie Cansdale | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
This file contains 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
This file contains 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
Oops, something went wrong.