Skip to content

Commit

Permalink
Work on Distribution stuff for Specifications.
Browse files Browse the repository at this point in the history
Adding Gallio apache license stuff for the code I "borrowed".
  • Loading branch information
aaronjensen committed May 8, 2008
1 parent 9e47b79 commit 8f354e3
Show file tree
Hide file tree
Showing 21 changed files with 394 additions and 58 deletions.
15 changes: 15 additions & 0 deletions Distribution/Specifications/InstallTDNetRunner.bat
@@ -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

15 changes: 15 additions & 0 deletions Distribution/Specifications/InstallTDNetRunnerSilent.bat
@@ -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

20 changes: 20 additions & 0 deletions Distribution/Specifications/License.txt
@@ -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.
@@ -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;
}
}
}
@@ -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>();
};
}
}
@@ -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>
@@ -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")]
3 changes: 2 additions & 1 deletion License.txt
@@ -1,4 +1,5 @@
Copyright (c) 2008 Jacob Lewallen, Aaron Jensen
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
Expand Down
@@ -1,4 +1,21 @@
using System;
// 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.
//
// Modified by and Portions Copyright 2008 Machine Project

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
Expand Down
@@ -1,4 +1,21 @@
using System;
// 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.
//
// Modified by and Portions Copyright 2008 Machine Project

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down
@@ -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.
@@ -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.
Expand Up @@ -49,6 +49,9 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Machine.Specifications\Properties\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Model\MachineTest.cs" />
<Compile Include="Services\MachineSpecificationsExplorer.cs" />
<Compile Include="MachineSpecificationsFramework.cs" />
Expand Down
Expand Up @@ -8,10 +8,7 @@
[assembly: AssemblyTitle("Machine.SpecificationsAdapter")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Machine.SpecificationsAdapter")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2008")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
Expand All @@ -20,17 +17,4 @@
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("236ba289-a746-4be6-90b4-739ff11054d6")]

// 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")]
[assembly: Guid("236ba289-a746-4be6-90b4-739ff11054d6")]

0 comments on commit 8f354e3

Please sign in to comment.