Skip to content

Commit

Permalink
Merge pull request #6 from JaySmith/master
Browse files Browse the repository at this point in the history
Updated to use nUnit
  • Loading branch information
trayburn committed Jul 28, 2011
2 parents fe08727 + 46f4008 commit fc18bfa
Show file tree
Hide file tree
Showing 19 changed files with 172 additions and 104 deletions.
8 changes: 7 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
This work is licensed under the following license:
http://creativecommons.org/licenses/by-nc-sa/3.0/
http://creativecommons.org/licenses/by-nc-sa/3.0/

ShareDevelop Research

Download SharpDevelop from http://www.icsharpcode.net/OpenSource/SD/
Download nUnit from http://nunit.org/index.php?p=download

8 changes: 5 additions & 3 deletions src/Squire.sln
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Squire", "Squire\Squire.csproj", "{912DC9CB-8F72-4EE2-99F9-64F8592C85CE}"
EndProject
# SharpDevelop 4.0.0.7070
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{367740AC-F554-4B7D-89E5-13F5422A9B09}"
ProjectSection(SolutionItems) = preProject
Local.testsettings = Local.testsettings
Squire.vsmdi = Squire.vsmdi
TraceAndTestImpact.testsettings = TraceAndTestImpact.testsettings
..\README.txt = ..\README.txt
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Squire", "Squire\Squire.csproj", "{912DC9CB-8F72-4EE2-99F9-64F8592C85CE}"
EndProject
Global
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = Squire.vsmdi
Expand All @@ -28,6 +30,6 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(SpecExplorer.ActivityCompletionStatus) = preSolution
SpecExplorer.ActivityCompletionStatus = TestExisting: ;ModelFromScratch:
SpecExplorer.ActivityCompletionStatus = TestExisting: ;ModelFromScratch:
EndGlobalSection
EndGlobal
4 changes: 2 additions & 2 deletions src/Squire/ConsoleKihon.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NUnit.Framework;
using Squire.Framework;
using Squire.Framework.Abstractions;

Expand All @@ -13,7 +13,7 @@ namespace Squire
* methods and properties as System.Console, so anything you can
* do to one, you can do to the other.
*/
[TestClass]
[TestFixture]
public class ConsoleKihon : ConsoleKihonBase
{
protected override void Write_FooBar_To_The_Console(IConsoleWrapper console)
Expand Down
4 changes: 2 additions & 2 deletions src/Squire/ControlStructureKihon.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NUnit.Framework;
using Squire.Framework;
using System.Collections.Generic;

namespace Squire
{
[TestClass]
[TestFixture]
public class ControlStructureKihon : ControlStructuresKihonBase
{
/*
Expand Down
4 changes: 2 additions & 2 deletions src/Squire/Framework/BaseDataKihon.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Transactions;
using System.Data.SQLite;
using System.Text;
using System.Data;
using NUnit.Framework;

namespace Squire.Framework
{

[TestClass]
[TestFixture]
public abstract class BaseDataKihon : BaseKihon, IDisposable
{
protected SQLiteConnection dbConn;
Expand Down
8 changes: 4 additions & 4 deletions src/Squire/Framework/BaseKihon.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Castle.Windsor;
using NUnit.Framework;

namespace Squire.Framework
{

[TestClass]
[TestFixture]
public abstract class BaseKihon
{
private IWindsorContainer container;

[TestInitialize]
[SetUp]
public void Initialize()
{
container = new WindsorContainer();
RegisterComponents(container);
BeforeEachTest();
}

[TestCleanup]
[TearDown]
public void Cleanup()
{
AfterEachTest();
Expand Down
13 changes: 7 additions & 6 deletions src/Squire/Framework/ConsoleKihonBase.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

using NUnit.Framework;
using Squire.Framework.Abstractions;
using Rhino.Mocks;

namespace Squire.Framework
{
[TestClass]
[TestFixture]
public abstract class ConsoleKihonBase : BaseKihon
{
private IConsoleWrapper console;
Expand All @@ -15,7 +16,7 @@ protected override void BeforeEachTest()
base.BeforeEachTest();
console = MockRepository.GenerateMock<IConsoleWrapper>();
}
[TestMethod]
[Test]
public void Write_FooBar_To_The_Console()
{
// Arrange
Expand All @@ -28,7 +29,7 @@ public void Write_FooBar_To_The_Console()
console.AssertWasCalled(c => c.Write("FooBar"));
}

[TestMethod]
[Test]
public void WriteLine_FooBar_To_The_Console()
{
// Arrange
Expand All @@ -41,7 +42,7 @@ public void WriteLine_FooBar_To_The_Console()
console.AssertWasCalled(c => c.WriteLine("FooBar"));
}

[TestMethod]
[Test]
public void Write_Foo_In_Blue_To_The_Console()
{
// Arrange
Expand All @@ -55,7 +56,7 @@ public void Write_Foo_In_Blue_To_The_Console()
console.AssertWasCalled(c => c.Write("Foo"));
}

[TestMethod]
[Test]
public void Read_Line_From_Console_And_Return_Value()
{
// Arrange
Expand Down
17 changes: 9 additions & 8 deletions src/Squire/Framework/ControlStructuresKihonBase.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

using NUnit.Framework;
using Rhino.Mocks;
using System.Collections.Generic;

Expand All @@ -11,10 +12,10 @@ public interface ITarget
bool IsValid { get; }
}

[TestClass]
[TestFixture]
public abstract class ControlStructuresKihonBase : BaseKihon
{
[TestMethod]
[Test]
public void Call_Hit_On_a_If_val_Is_True_Else_Call_Hit_On_b_V1()
{
// Arrange
Expand All @@ -30,7 +31,7 @@ public void Call_Hit_On_a_If_val_Is_True_Else_Call_Hit_On_b_V1()
b.AssertWasNotCalled(t => t.Hit());
}

[TestMethod]
[Test]
public void Call_Hit_On_a_If_val_Is_True_Else_Call_Hit_On_b_V2()
{
// Arrange
Expand All @@ -46,7 +47,7 @@ public void Call_Hit_On_a_If_val_Is_True_Else_Call_Hit_On_b_V2()
b.AssertWasCalled(t => t.Hit());
}

[TestMethod]
[Test]
public void Call_Hit_On_a_Once_For_Each_Member_Of_list()
{
// Arrange
Expand All @@ -60,7 +61,7 @@ public void Call_Hit_On_a_Once_For_Each_Member_Of_list()
a.AssertWasCalled(m => m.Hit(), mo => mo.Repeat.Times(4));
}

[TestMethod]
[Test]
public void Call_Hit_On_a_While_a_IsValid_Is_True()
{
// Arrange
Expand All @@ -75,7 +76,7 @@ public void Call_Hit_On_a_While_a_IsValid_Is_True()
a.AssertWasCalled(m => m.Hit(), mo => mo.Repeat.Times(4));
}

[TestMethod]
[Test]
public void n_Times_Call_Hit_On_a()
{
// Arrange
Expand All @@ -89,7 +90,7 @@ public void n_Times_Call_Hit_On_a()
a.AssertWasCalled(m => m.Hit(), mo => mo.Repeat.Times(n));
}

[TestMethod]
[Test]
public void Call_Hit_On_a_Once_And_Continue_Until_IsValid_Is_False()
{
// Arrange
Expand Down
12 changes: 6 additions & 6 deletions src/Squire/Framework/LinqKihonBase.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NUnit.Framework;

namespace Squire.Framework
{
[TestClass]
[TestFixture]
public abstract class LinqKihonBase : BaseKihon
{
[TestMethod]
[Test]
public void Select_the_Something_property_from_list_test()
{
//arrange
Expand All @@ -27,7 +27,7 @@ public void Select_the_Something_property_from_list_test()
Assert.AreEqual(product.Something ,item.SingleOrDefault());
}

[TestMethod]
[Test]
public void Filter_the_products_where_something_is_equal_to_2_from_list_test()
{
//arrange
Expand All @@ -47,7 +47,7 @@ public void Filter_the_products_where_something_is_equal_to_2_from_list_test()
Assert.AreEqual(1, item.Count());
}

[TestMethod]
[Test]
public void Order_the_list_by_the_something_property_test()
{
//arrange
Expand All @@ -69,7 +69,7 @@ public void Order_the_list_by_the_something_property_test()
}


[TestMethod]
[Test]
public void Order_the_list_by_the_something_property_descending_test()
{
//arrange
Expand Down
26 changes: 13 additions & 13 deletions src/Squire/Framework/NumbersKihonBase.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NUnit.Framework;

namespace Squire.Framework
{
[TestClass]
[TestFixture]
public abstract class NumbersKihonBase : BaseKihon
{
[TestMethod]
[Test]
public void Return_The_Maximum_Value_Of_Int32_Test()
{
// Arrange
Expand All @@ -19,7 +19,7 @@ public void Return_The_Maximum_Value_Of_Int32_Test()
Assert.AreEqual(Int32.MaxValue, result);
}

[TestMethod]
[Test]
public void Return_The_Minimum_Value_Of_Int32_Test()
{
// Arrange
Expand All @@ -32,7 +32,7 @@ public void Return_The_Minimum_Value_Of_Int32_Test()
Assert.AreEqual(int.MinValue, result);
}

[TestMethod]
[Test]
public void Return_The_Remainder_Of_a_Divided_By_b()
{
// Arrange
Expand All @@ -46,7 +46,7 @@ public void Return_The_Remainder_Of_a_Divided_By_b()
Assert.AreEqual(a % b, remainder);
}

[TestMethod]
[Test]
public void Return_The_Maximum_Value_Of_Double_Test()
{
// Arrange
Expand All @@ -59,7 +59,7 @@ public void Return_The_Maximum_Value_Of_Double_Test()
Assert.AreEqual(double.MaxValue, actual);
}

[TestMethod]
[Test]
public void Return_The_Minimum_Value_Of_Double_Test()
{
// Arrange
Expand All @@ -72,7 +72,7 @@ public void Return_The_Minimum_Value_Of_Double_Test()
Assert.AreEqual(double.MinValue, actual);
}

[TestMethod]
[Test]
public void Return_True_If_a_Is_Not_A_Number_Test1()
{
// Arrange
Expand All @@ -85,7 +85,7 @@ public void Return_True_If_a_Is_Not_A_Number_Test1()
Assert.AreEqual(double.IsNaN(a), result);
}

[TestMethod]
[Test]
public void Return_True_If_a_Is_Not_A_Number_Test2()
{
// Arrange
Expand All @@ -98,7 +98,7 @@ public void Return_True_If_a_Is_Not_A_Number_Test2()
Assert.AreEqual(double.IsNaN(a), result);
}

[TestMethod]
[Test]
public void Return_True_If_a_Is_Not_A_Number_Test3()
{
// Arrange
Expand All @@ -111,7 +111,7 @@ public void Return_True_If_a_Is_Not_A_Number_Test3()
Assert.AreEqual(double.IsNaN(a), result);
}

[TestMethod]
[Test]
public void Return_True_If_a_Is_An_Infinity_Test1()
{
// Arrange
Expand All @@ -124,7 +124,7 @@ public void Return_True_If_a_Is_An_Infinity_Test1()
Assert.AreEqual(double.IsInfinity(a), actual);
}

[TestMethod]
[Test]
public void Return_True_If_a_Is_An_Infinity_Test2()
{
// Arrange
Expand All @@ -137,7 +137,7 @@ public void Return_True_If_a_Is_An_Infinity_Test2()
Assert.AreEqual(double.IsInfinity(a), actual);
}

[TestMethod]
[Test]
public void Return_True_If_a_Is_An_Infinity_Test3()
{
// Arrange
Expand Down
Loading

0 comments on commit fc18bfa

Please sign in to comment.