From 18f5e6162ea100e153dd7e8fd136ee5f7a5fa24e Mon Sep 17 00:00:00 2001 From: Adam Ralph Date: Fri, 27 Dec 2013 18:57:55 +0000 Subject: [PATCH] close #111 removed samples close #117 upgraded to VS2013 --- rakefile.rb | 10 - .../ComputationBuilder.fs | 46 ----- .../CustomOperator.fs | 57 ------ .../DirectConversion.fs | 33 ---- src/Xbehave.Samples.FSharp.Net45/Pipes.fs | 40 ---- .../Xbehave.Samples.FSharp.Net45.fsproj | 83 -------- .../packages.config | 5 - src/Xbehave.Samples.Net40/Backgrounds.cs | 178 ------------------ src/Xbehave.Samples.Net40/Examples.cs | 34 ---- .../Fixtures/Calculator.cs | 18 -- .../Fixtures/Disposable.cs | 28 --- src/Xbehave.Samples.Net40/FluentSyntax.cs | 24 --- src/Xbehave.Samples.Net40/IsolatedSteps.cs | 36 ---- .../Properties/AssemblyInfo.cs | 11 -- src/Xbehave.Samples.Net40/Scenarios.cs | 32 ---- src/Xbehave.Samples.Net40/Settings.StyleCop | 14 -- src/Xbehave.Samples.Net40/SkippedSteps.cs | 33 ---- src/Xbehave.Samples.Net40/Synonyms.cs | 63 ------- src/Xbehave.Samples.Net40/TheLot.cs | 59 ------ .../Xbehave.Samples.Net40.csproj | 118 ------------ src/Xbehave.Samples.Net40/packages.config | 7 - src/Xbehave.sln | 20 +- .../Xbehave.Features.Net35.csproj | 3 + .../Xbehave.Features.Net40.csproj | 3 + .../Xbehave.Sdk.Specifications.Net35.csproj | 3 + .../Xbehave.Sdk.Specifications.Net40.csproj | 3 + .../Xbehave.Specifications.Net35.csproj | 3 + .../Xbehave.Specifications.Net40.csproj | 3 + 28 files changed, 21 insertions(+), 946 deletions(-) delete mode 100644 src/Xbehave.Samples.FSharp.Net45/ComputationBuilder.fs delete mode 100644 src/Xbehave.Samples.FSharp.Net45/CustomOperator.fs delete mode 100644 src/Xbehave.Samples.FSharp.Net45/DirectConversion.fs delete mode 100644 src/Xbehave.Samples.FSharp.Net45/Pipes.fs delete mode 100644 src/Xbehave.Samples.FSharp.Net45/Xbehave.Samples.FSharp.Net45.fsproj delete mode 100644 src/Xbehave.Samples.FSharp.Net45/packages.config delete mode 100644 src/Xbehave.Samples.Net40/Backgrounds.cs delete mode 100644 src/Xbehave.Samples.Net40/Examples.cs delete mode 100644 src/Xbehave.Samples.Net40/Fixtures/Calculator.cs delete mode 100644 src/Xbehave.Samples.Net40/Fixtures/Disposable.cs delete mode 100644 src/Xbehave.Samples.Net40/FluentSyntax.cs delete mode 100644 src/Xbehave.Samples.Net40/IsolatedSteps.cs delete mode 100644 src/Xbehave.Samples.Net40/Properties/AssemblyInfo.cs delete mode 100644 src/Xbehave.Samples.Net40/Scenarios.cs delete mode 100644 src/Xbehave.Samples.Net40/Settings.StyleCop delete mode 100644 src/Xbehave.Samples.Net40/SkippedSteps.cs delete mode 100644 src/Xbehave.Samples.Net40/Synonyms.cs delete mode 100644 src/Xbehave.Samples.Net40/TheLot.cs delete mode 100644 src/Xbehave.Samples.Net40/Xbehave.Samples.Net40.csproj delete mode 100644 src/Xbehave.Samples.Net40/packages.config diff --git a/rakefile.rb b/rakefile.rb index 9e558f1c..d2681d50 100644 --- a/rakefile.rb +++ b/rakefile.rb @@ -20,11 +20,6 @@ { :command => xunit_command_net40, :assembly => "src/test/Xbehave.Features.Net40/bin/Debug/Xbehave.Features.Net40.dll" } ] -samples = [ - { :command => xunit_command_net20, :assembly => "src/Xbehave.Samples.Net35/bin/Debug/Xbehave.Samples.Net35.dll" }, - { :command => xunit_command_net40, :assembly => "src/Xbehave.Samples.Net40/bin/Debug/Xbehave.Samples.Net40.dll" } -] - nuspec = "src/Xbehave.nuspec" Albacore.configure do |config| @@ -66,11 +61,6 @@ cmd.parameters "pack " + nuspec + " -Version " + version + " -OutputDirectory " + output end -desc "Execute samples" -task :sample => [:build] do - execute_xunit samples -end - def execute_xunit(tests) tests.each do |test| xunit = XUnitTestRunner.new diff --git a/src/Xbehave.Samples.FSharp.Net45/ComputationBuilder.fs b/src/Xbehave.Samples.FSharp.Net45/ComputationBuilder.fs deleted file mode 100644 index b6bb197e..00000000 --- a/src/Xbehave.Samples.FSharp.Net45/ComputationBuilder.fs +++ /dev/null @@ -1,46 +0,0 @@ -// -// Copyright (c) xBehave.net contributors. All rights reserved. -// - -// Quickstart sample conversion using a custom F# computation builder for steps and custom functions for Given/When/Then/And/But -// based on http://fssnip.net/kq by Tomas Petricek http://tomasp.net/blog -namespace Xbehave.Samples.FSharp - -module ComputationBuilder = - open Xbehave - open Xunit - - // computation builder - type StepBuilder(text:string) = - member x.Zero() = () - member x.Delay(f) = f - member x.Run(f) = text.f(System.Action< >(f)) |> ignore - - // helper functions - let Given text = StepBuilder("Given " + text) - let When text = StepBuilder("When " + text) - let Then text = StepBuilder("Then " + text) - let And text = StepBuilder("And " + text) - let But text = StepBuilder("But " + text) - - // SUT - type Calculator () = member __.Add(x,y) = x + y - - [] - let addition(x:int, y:int, calculator:Calculator, answer:int) = - let x, y, calculator, answer = ref x, ref y, ref calculator, ref answer - - Given "the number 1" - { x := 1 } - - And "the number 2" - { y := 2 } - - And "a calculator" - { calculator := Calculator() } - - When "I add the numbers together" - { answer := (!calculator).Add(!x, !y) } - - Then "the answer is 3" - { Assert.Equal(3, !answer) } diff --git a/src/Xbehave.Samples.FSharp.Net45/CustomOperator.fs b/src/Xbehave.Samples.FSharp.Net45/CustomOperator.fs deleted file mode 100644 index d9bad9a6..00000000 --- a/src/Xbehave.Samples.FSharp.Net45/CustomOperator.fs +++ /dev/null @@ -1,57 +0,0 @@ -// -// Copyright (c) xBehave.net contributors. All rights reserved. -// - -// Quickstart sample conversion in F# using a custom operator -// based on http://fssnip.net/ko by Phillip Trelford http://trelford.com/blog -namespace Xbehave.Samples.FSharp - -module CustomOperator = - open Xbehave - open Xunit - - // custom operator - let (-->) (s:string) f = s.f(System.Action< >(f)) |> ignore - - // SUT - type Calculator () = member __.Add(x,y) = x + y - - [] - let addition(x:int, y:int, calculator:Calculator, answer:int) = - let x, y, calculator, answer = ref x, ref y, ref calculator, ref answer - - "Given the number 1" - --> fun () -> x := 1 - - "And the number 2" - --> fun () -> y := 2 - - "And a calculator" - --> fun () -> calculator := Calculator() - - "When I add the numbers together" - --> fun () -> answer := (!calculator).Add(!x, !y) - - "Then the answer is 3" - --> fun () -> Assert.Equal(3, !answer) - - [] - [] - [] - let additionWithExamples(x:int, y:int, expectedAnswer:int, calculator:Calculator, answer:int) = - let calculator, answer = ref calculator, ref answer - - "Given the number {0}" - --> id - - "And the number {1}" - --> id - - "And a calculator" - --> fun () -> calculator := Calculator() - - "When I add the numbers together" - --> fun () -> answer := (!calculator).Add(x, y) - - "Then the answer is {2}" - --> fun () -> Assert.Equal(expectedAnswer, !answer) diff --git a/src/Xbehave.Samples.FSharp.Net45/DirectConversion.fs b/src/Xbehave.Samples.FSharp.Net45/DirectConversion.fs deleted file mode 100644 index f95bc8e2..00000000 --- a/src/Xbehave.Samples.FSharp.Net45/DirectConversion.fs +++ /dev/null @@ -1,33 +0,0 @@ -// -// Copyright (c) xBehave.net contributors. All rights reserved. -// - -// QuickStart sample direct conversion to F# from C# -// based on http://fssnip.net/km by Phillip Trelford http://trelford.com/blog -namespace Xbehave.Samples.FSharp - -module DirectConversion = - open Xbehave - open Xunit - - // SUT - type Calculator () = member __.Add(x,y) = x + y - - [] - let addition(x:int, y:int, calculator:Calculator, answer:int) = - let x, y, calculator, answer = ref x, ref y, ref calculator, ref answer - - "Given the number 1" - .Given(fun () -> x := 1) |> ignore - - "And the number 2" - .And(fun () -> y := 2) |> ignore - - "And a calculator" - .And(fun () -> calculator := Calculator()) |> ignore - - "When I add the numbers together" - .When(fun () -> answer := (!calculator).Add(!x, !y)) |> ignore - - "Then the answer is 3" - .Then(fun () -> Assert.Equal(3, !answer)) diff --git a/src/Xbehave.Samples.FSharp.Net45/Pipes.fs b/src/Xbehave.Samples.FSharp.Net45/Pipes.fs deleted file mode 100644 index 01ec1d82..00000000 --- a/src/Xbehave.Samples.FSharp.Net45/Pipes.fs +++ /dev/null @@ -1,40 +0,0 @@ -// -// Copyright (c) xBehave.net contributors. All rights reserved. -// - -// QuickStart sample conversion to F# from C# with some helper functions -// based on http://fssnip.net/kn by Phillip Trelford http://trelford.com/blog -namespace Xbehave.Samples.FSharp - -module Pipes = - open Xbehave - open Xunit - - // helper functions - let Given f (s:string) = s.Given(System.Action< >(f)) |> ignore - let And f (s:string) = s.And(System.Action< >(f)) |> ignore - let But f (s:string) = s.But(System.Action< >(f)) |> ignore - let When f (s:string) = s.When(System.Action< >(f)) |> ignore - let Then f (s:string) = s.Then(System.Action< >(f)) |> ignore - - // SUT - type Calculator () = member __.Add(x,y) = x + y - - [] - let addition(x:int, y:int, calculator:Calculator, answer:int) = - let x, y, calculator, answer = ref x, ref y, ref calculator, ref answer - - "Given the number 1" - |> Given (fun () -> x := 1) - - "And the number 2" - |> And (fun () -> y := 2) - - "And a calculator" - |> And (fun () -> calculator := Calculator()) - - "When I add the numbers together" - |> When (fun () -> answer := (!calculator).Add(!x, !y)) - - "Then the answer is 3" - |> Then (fun () -> Assert.Equal(3, !answer)) diff --git a/src/Xbehave.Samples.FSharp.Net45/Xbehave.Samples.FSharp.Net45.fsproj b/src/Xbehave.Samples.FSharp.Net45/Xbehave.Samples.FSharp.Net45.fsproj deleted file mode 100644 index 6e53035c..00000000 --- a/src/Xbehave.Samples.FSharp.Net45/Xbehave.Samples.FSharp.Net45.fsproj +++ /dev/null @@ -1,83 +0,0 @@ - - - - - Debug - AnyCPU - 2.0 - 410529e9-b417-44d0-a48e-b3009e16783e - Library - Xbehave.Samples.FSharp.Net45 - Xbehave.Samples.FSharp - v4.5 - Xbehave.Samples.FSharp.Net45 - - - true - full - false - false - bin\Debug\ - DEBUG;TRACE - 3 - - - true - - - - pdbonly - true - true - bin\Release\ - TRACE - 3 - - - true - - - - 11 - - - - - - - - - - - - - - True - - - - - - - - Xbehave.Net40 - {93b47a03-8382-4e25-b800-f6bdce6b9c6b} - True - - - ..\..\packages\xunit.1.9.2\lib\net20\xunit.dll - True - - - ..\..\packages\xunit.extensions.1.9.2\lib\net20\xunit.extensions.dll - True - - - - \ No newline at end of file diff --git a/src/Xbehave.Samples.FSharp.Net45/packages.config b/src/Xbehave.Samples.FSharp.Net45/packages.config deleted file mode 100644 index ca453f76..00000000 --- a/src/Xbehave.Samples.FSharp.Net45/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/Xbehave.Samples.Net40/Backgrounds.cs b/src/Xbehave.Samples.Net40/Backgrounds.cs deleted file mode 100644 index 436b2d8d..00000000 --- a/src/Xbehave.Samples.Net40/Backgrounds.cs +++ /dev/null @@ -1,178 +0,0 @@ -// -// Copyright (c) xBehave.net contributors. All rights reserved. -// - -namespace Xbehave.Samples -{ - using FluentAssertions; - - // Feature: Multiple site support - //// In order to make gigantic piles of money - //// As a Mephisto site owner - //// I want to host blogs for different people - public static class Backgrounds - { - [Background] - public static void Background() - { - "Given a global administrator named \"Greg\"" - .Given(() => Users.Save(new GlobalAdministrator { Name = "Greg", Password = "apples" })) - .Teardown(() => Users.Remove("Greg")); - - "And a blog named \"Greg's anti-tax rants\" owned by \"Greg\"" - .And(() => Blogs.Save(new Blog { Name = "Greg's anti-tax rants", Owner = Users.Get("Greg") })) - .Teardown(() => Blogs.Remove("Greg's anti-tax rants")); - - "And a customer named \"Dr. Bill\"" - .And(() => Users.Save(new Customer { Name = "Dr. Bill", Password = "oranges" })) - .Teardown(() => Users.Remove("Dr. Bill")); - - "And a blog named \"Expensive Therapy\" owned by \"Dr. Bill\"" - .And(() => Blogs.Save(new Blog { Name = "Expensive Therapy", Owner = Users.Get("Dr. Bill") })) - .Teardown(() => Blogs.Remove("Expensive Therapy")); - } - - [Scenario] - public static void DoctorBillPostsToHisOwnBlog() - { - "Given I am logged in as Dr. Bill" - .Given(() => Site.Login("Dr. Bill", "oranges")); - - "When I try to post to \"Expensive Therapy\"" - .When(() => Blogs.Get("Expensive Therapy").Post(new Article { Body = "This is a great blog!" })); - - "Then I should see \"Your article was published.\"" - .Then(() => Site.CurrentPage.Body.Should().Contain("Your article was published.")); - } - - [Scenario] - public static void DoctorBillTriesToPostToSomebodyElsesBlogAndFails() - { - "Given I am logged in as Dr. Bill" - .Given(() => Site.Login("Dr. Bill", "oranges")); - - "When I try to post to \"Greg's anti-tax rants\"" - .When(() => Blogs.Get("Greg's anti-tax rants").Post(new Article { Body = "This is a great blog!" })); - - "Then I should see \"Hey! That's not your blog!\"" - .Then(() => Site.CurrentPage.Body.Should().Contain("Hey! That's not your blog!")); - } - - [Scenario] - public static void GregPostsToAClientBlog() - { - "Given I am logged in as Greg" - .Given(() => Site.Login("Greg", "apples")); - - "When I try to post to \"Expensive Therapy\"" - .When(() => Blogs.Get("Expensive Therapy").Post(new Article { Body = "This is a great blog!" })); - - "Then I should see \"Your article was published.\"" - .Then(() => Site.CurrentPage.Body.Should().Contain("Your article was published.")); - } - - private static class Site - { - public static User CurrentUser { get; private set; } - - public static Page CurrentPage { get; set; } - - public static void Login(string username, string password) - { - var user = Users.Get(username); - if (password == user.Password) - { - CurrentUser = user; - } - else - { - throw new System.InvalidOperationException("Invalid credentials."); - } - } - } - - private static class Users - { - private static readonly System.Collections.Generic.Dictionary Datastore = new System.Collections.Generic.Dictionary(); - - public static void Save(User user) - { - Datastore[user.Name] = user; - } - - public static User Get(string name) - { - return Datastore[name]; - } - - public static void Remove(string name) - { - Datastore.Remove(name); - } - } - - private static class Blogs - { - private static readonly System.Collections.Generic.Dictionary Datastore = new System.Collections.Generic.Dictionary(); - - public static void Save(Blog blog) - { - Datastore[blog.Name] = blog; - } - - public static Blog Get(string name) - { - return Datastore[name]; - } - - public static void Remove(string name) - { - Datastore.Remove(name); - } - } - - private class Page - { - public string Body { get; set; } - } - - private abstract class User - { - public string Name { get; set; } - - public string Password { get; set; } - } - - private class GlobalAdministrator : User - { - } - - private class Customer : User - { - } - - private class Blog - { - public string Name { get; set; } - - public User Owner { get; set; } - - public void Post(Article article) - { - if (Site.CurrentUser == this.Owner || Site.CurrentUser is GlobalAdministrator) - { - Site.CurrentPage = new Page { Body = "Your article was published.\n" + article.Body }; - } - else - { - Site.CurrentPage = new Page { Body = "Hey! That's not your blog!" }; - } - } - } - - private class Article - { - public string Body { get; set; } - } - } -} diff --git a/src/Xbehave.Samples.Net40/Examples.cs b/src/Xbehave.Samples.Net40/Examples.cs deleted file mode 100644 index 2138b537..00000000 --- a/src/Xbehave.Samples.Net40/Examples.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// Copyright (c) xBehave.net contributors. All rights reserved. -// - -namespace Xbehave.Samples -{ - using FluentAssertions; - using Xbehave; - using Xbehave.Samples.Fixtures; - - public class Examples - { - [Scenario] - [Example(1, 2, 3)] - [Example(2, 3, 5)] - public void Addition(int x, int y, int expectedAnswer, Calculator calculator, int answer) - { - "Given the number {0}" - .Given(() => { }); - - "And the number {1}" - .And(() => { }); - - "And a calculator" - .And(() => calculator = new Calculator()); - - "When I add the numbers together" - .When(() => answer = calculator.Add(x, y)); - - "Then the answer is {2}" - .Then(() => answer.Should().Be(expectedAnswer)); - } - } -} diff --git a/src/Xbehave.Samples.Net40/Fixtures/Calculator.cs b/src/Xbehave.Samples.Net40/Fixtures/Calculator.cs deleted file mode 100644 index 23f8ea86..00000000 --- a/src/Xbehave.Samples.Net40/Fixtures/Calculator.cs +++ /dev/null @@ -1,18 +0,0 @@ -// -// Copyright (c) xBehave.net contributors. All rights reserved. -// - -namespace Xbehave.Samples.Fixtures -{ - public class Calculator - { - public int Add(int x, int y) - { - return x + y; - } - - public void CoolDown() - { - } - } -} diff --git a/src/Xbehave.Samples.Net40/Fixtures/Disposable.cs b/src/Xbehave.Samples.Net40/Fixtures/Disposable.cs deleted file mode 100644 index d4963ef8..00000000 --- a/src/Xbehave.Samples.Net40/Fixtures/Disposable.cs +++ /dev/null @@ -1,28 +0,0 @@ -// -// Copyright (c) xBehave.net contributors. All rights reserved. -// - -namespace Xbehave.Samples.Fixtures -{ - using System; - - public sealed class Disposable : IDisposable - { - private readonly string id = Guid.NewGuid().ToString(); - - public Disposable() - { - Console.WriteLine("CREATED: {0}", this.id); - } - - public void Use() - { - Console.WriteLine("USED: {0}", this.id); - } - - public void Dispose() - { - Console.WriteLine("DISPOSED: {0}", this.id); - } - } -} diff --git a/src/Xbehave.Samples.Net40/FluentSyntax.cs b/src/Xbehave.Samples.Net40/FluentSyntax.cs deleted file mode 100644 index d083e0a8..00000000 --- a/src/Xbehave.Samples.Net40/FluentSyntax.cs +++ /dev/null @@ -1,24 +0,0 @@ -// -// Copyright (c) xBehave.net contributors. All rights reserved. -// - -namespace Xbehave.Samples -{ - using FluentAssertions; - using Xbehave; - using Xbehave.Samples.Fixtures; - - public class FluentSyntax - { - [Scenario] - public void Addition(int x, int y, Calculator calculator, int answer) - { - _ - .Given("Given the number 1", () => x = 1) - .And("And the number 2", () => y = 2) - .And("And a calculator", () => calculator = new Calculator()) - .When("When I add the numbers together", () => answer = calculator.Add(x, y)) - .Then("Then the answer is 3", () => answer.Should().Be(3)); - } - } -} diff --git a/src/Xbehave.Samples.Net40/IsolatedSteps.cs b/src/Xbehave.Samples.Net40/IsolatedSteps.cs deleted file mode 100644 index 821fbf11..00000000 --- a/src/Xbehave.Samples.Net40/IsolatedSteps.cs +++ /dev/null @@ -1,36 +0,0 @@ -// -// Copyright (c) xBehave.net contributors. All rights reserved. -// - -namespace Xbehave.Samples -{ - using FluentAssertions; - using Xbehave; - using Xbehave.Samples.Fixtures; - - public class IsolatedSteps - { - [Scenario] - public void Addition(int x, int y, Calculator calculator, int answer) - { - "Given the number 1" - .Given(() => x = 1); - - "And the number 2" - .And(() => y = 2); - - "And a calculator" - .And(() => calculator = new Calculator()); - - "When I add the numbers together" - .When(() => answer = calculator.Add(x, y)); - - "Then the answer is one less than 4" - .Then(() => (++answer).Should().Be(4)) - .InIsolation(); - - "And the answer is 3" - .And(() => answer.Should().Be(3)); - } - } -} diff --git a/src/Xbehave.Samples.Net40/Properties/AssemblyInfo.cs b/src/Xbehave.Samples.Net40/Properties/AssemblyInfo.cs deleted file mode 100644 index 4c46928a..00000000 --- a/src/Xbehave.Samples.Net40/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,11 +0,0 @@ -// -// Copyright (c) xBehave.net contributors. All rights reserved. -// - -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("Xbehave.Samples")] -[assembly: AssemblyDescription("")] - -[assembly: ComVisible(false)] \ No newline at end of file diff --git a/src/Xbehave.Samples.Net40/Scenarios.cs b/src/Xbehave.Samples.Net40/Scenarios.cs deleted file mode 100644 index 7b9c16fc..00000000 --- a/src/Xbehave.Samples.Net40/Scenarios.cs +++ /dev/null @@ -1,32 +0,0 @@ -// -// Copyright (c) xBehave.net contributors. All rights reserved. -// - -namespace Xbehave.Samples -{ - using FluentAssertions; - using Xbehave; - using Xbehave.Samples.Fixtures; - - public class Scenarios - { - [Scenario] - public void Addition(int x, int y, Calculator calculator, int answer) - { - "Given the number 1" - .Given(() => x = 1); - - "And the number 2" - .And(() => y = 2); - - "And a calculator" - .And(() => calculator = new Calculator()); - - "When I add the numbers together" - .When(() => answer = calculator.Add(x, y)); - - "Then the answer is 3" - .Then(() => answer.Should().Be(3)); - } - } -} diff --git a/src/Xbehave.Samples.Net40/Settings.StyleCop b/src/Xbehave.Samples.Net40/Settings.StyleCop deleted file mode 100644 index 3b929943..00000000 --- a/src/Xbehave.Samples.Net40/Settings.StyleCop +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - False - - - - - - - \ No newline at end of file diff --git a/src/Xbehave.Samples.Net40/SkippedSteps.cs b/src/Xbehave.Samples.Net40/SkippedSteps.cs deleted file mode 100644 index 415ae330..00000000 --- a/src/Xbehave.Samples.Net40/SkippedSteps.cs +++ /dev/null @@ -1,33 +0,0 @@ -// -// Copyright (c) xBehave.net contributors. All rights reserved. -// - -namespace Xbehave.Samples -{ - using FluentAssertions; - using Xbehave; - using Xbehave.Samples.Fixtures; - - public class SkippedSteps - { - [Scenario] - public void Addition(int x, int y, Calculator calculator, int answer) - { - "Given the number 1" - .Given(() => x = 1); - - "And the number 2" - .And(() => y = 2); - - "And a calculator" - .And(() => calculator = new Calculator()); - - "When I add the numbers together" - .When(() => answer = calculator.Add(x, y)); - - "Then the answer is 3" - .Then(() => answer.Should().Be(3)) - .Skip("I've almost got this addition thing working, I just can't quite get the right numbers out."); - } - } -} diff --git a/src/Xbehave.Samples.Net40/Synonyms.cs b/src/Xbehave.Samples.Net40/Synonyms.cs deleted file mode 100644 index 07299abc..00000000 --- a/src/Xbehave.Samples.Net40/Synonyms.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -// Copyright (c) xBehave.net contributors. All rights reserved. -// - -namespace Xbehave.Samples.Net40 -{ - using System; - using System.Diagnostics.CodeAnalysis; - using FluentAssertions; - using Xbehave.Fluent; - using Xbehave.Samples.Fixtures; - - public static class Synonyms - { - [SuppressMessage("Microsoft.StyleCop.CSharp.NamingRules", "SA1300:ElementMustBeginWithUpperCaseLetter", Justification = "Fluent API")] - public static IStep x(this string text, Action body) - { - return text.f(body); - } - - [SuppressMessage("Microsoft.StyleCop.CSharp.NamingRules", "SA1300:ElementMustBeginWithUpperCaseLetter", Justification = "Fluent API")] - public static IStep ʃ(this string text, Action body) - { - return text.f(body); - } - - [SuppressMessage("Microsoft.StyleCop.CSharp.NamingRules", "SA1300:ElementMustBeginWithUpperCaseLetter", Justification = "Fluent API")] - public static IStep σʃσ(this string text, Action body) - { - return text.f(body); - } - - public static IStep 梟(this string text, Action body) - { - return text.f(body); - } - - [SuppressMessage("Microsoft.StyleCop.CSharp.NamingRules", "SA1300:ElementMustBeginWithUpperCaseLetter", Justification = "Fluent API")] - public static IStep χ(this string text, Action body) - { - return text.f(body); - } - - [Scenario] - public static void Addition(int x, int y, Calculator calculator, int answer) - { - "Given the number 1" - .x(() => x = 1); - - "And the number 2" - .ʃ(() => y = 2); - - "And a calculator" - .σʃσ(() => calculator = new Calculator()); - - "When I add the numbers together" - .梟(() => answer = calculator.Add(x, y)); - - "Then the answer is 3" - .χ(() => answer.Should().Be(3)); - } - } -} diff --git a/src/Xbehave.Samples.Net40/TheLot.cs b/src/Xbehave.Samples.Net40/TheLot.cs deleted file mode 100644 index 40ccef5d..00000000 --- a/src/Xbehave.Samples.Net40/TheLot.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -// Copyright (c) xBehave.net contributors. All rights reserved. -// - -namespace Xbehave.Samples -{ - using FluentAssertions; - using Xbehave; - using Xbehave.Samples.Fixtures; - - public static class TheLot - { - private static Calculator calculator; - - [Background] - public static void Background() - { - "Given a stack" - .Given(() => calculator = new Calculator()) - .Teardown(() => calculator.CoolDown()); - } - - [Scenario] - [Example(1, 2, 3)] - [Example(2, 3, 5)] - public static void Addition(int x, int y, int expectedAnswer, Calculator calculator, int answer) - { - "Given the number {0}" - .Given(() => { }); - - "And the number {1}" - .And(() => { }); - - "And a calculator" - .And(() => calculator = new Calculator()); - - "And some disposable object" - .And(() => new Disposable().Using()); - - "When I add the numbers together" - .When(() => answer = calculator.Add(x, y)) - .WithTimeout(1000); - - "Then the answer is not more than {2}" - .Then(() => (++answer).Should().Be(expectedAnswer + 1)) - .InIsolation(); - - "And the answer is {2}" - .And(() => answer.Should().Be(expectedAnswer)); - - "And the answer is one more than {2}" - .And(() => answer.Should().Be(expectedAnswer + 1)) - .Skip("because the assertion is nonsense"); - - "But the answer is not one less than {2}" - .But(() => answer.Should().NotBe(expectedAnswer - 1)); - } - } -} diff --git a/src/Xbehave.Samples.Net40/Xbehave.Samples.Net40.csproj b/src/Xbehave.Samples.Net40/Xbehave.Samples.Net40.csproj deleted file mode 100644 index 9f6876aa..00000000 --- a/src/Xbehave.Samples.Net40/Xbehave.Samples.Net40.csproj +++ /dev/null @@ -1,118 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {318A83C1-F734-4612-A04F-9BE0D26657BF} - Library - Properties - Xbehave.Samples.Net40 - Xbehave.Samples.Net40 - v4.0 - 512 - - - - true - full - false - bin\Debug\ - TRACE;DEBUG;NET40 - prompt - 4 - true - true - 612,618 - ..\Xbehave.ruleset - - - true - full - false - bin\Debug\ - TRACE;DEBUG;NET40 - prompt - 4 - false - true - 612,618 - ..\Xbehave.ruleset - - - - False - ..\..\packages\FluentAssertions.2.1.0.0\lib\net40\FluentAssertions.dll - - - - - - - False - ..\..\packages\xunit.1.9.2\lib\net20\xunit.dll - - - False - ..\..\packages\xunit.extensions.1.9.2\lib\net20\xunit.extensions.dll - - - - - Properties\CommonAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - {93B47A03-8382-4E25-B800-F6BDCE6B9C6B} - Xbehave.Net40 - - - - - - ..\..\packages\StyleCop.MSBuild.4.7.45.0\tools\StyleCop.targets - - - - Failed to import StyleCop.MSBuild targets from '$(StyleCopMSBuildTargetsFile)'. The StyleCop.MSBuild package was either missing or incomplete when the project was loaded. Ensure that the package is present and then restart the build. If you are using an IDE (e.g. Visual Studio), reload the project before restarting the build. - Failed to import StyleCop.MSBuild targets from '$(StyleCopMSBuildTargetsFile)'. The StyleCop.MSBuild package was either missing or incomplete when the project was loaded (but is now present). To fix this, restart the build. If you are using an IDE (e.g. Visual Studio), reload the project before restarting the build. - Failed to import StyleCop.MSBuild targets from '$(StyleCopMSBuildTargetsFile)'. The StyleCop.MSBuild package was either missing or incomplete when the project was loaded. To fix this, restore the package and then restart the build. If you are using an IDE (e.g. Visual Studio), you may need to reload the project before restarting the build. Note that regular NuGet package restore (during build) does not work with this package because the package needs to be present before the project is loaded. If this is an automated build (e.g. CI server), you may want to ensure that the build process restores the StyleCop.MSBuild package before the project is built. - Failed to import StyleCop.MSBuild targets from '$(StyleCopMSBuildTargetsFile)'. The StyleCop.MSBuild package was either missing or incomplete when the project was loaded (but is now present). To fix this, restart the build. If you are using an IDE (e.g. Visual Studio), reload the project before restarting the build. Note that when using regular NuGet package restore (during build) the package will not be available for the initial build because the package needs to be present before the project is loaded. If package restore executes successfully in the intitial build then the package will be available for subsequent builds. If this is an automated build (e.g. CI server), you may want to ensure that the build process restores the StyleCop.MSBuild package before the initial build. - - - - - - - - - - - - - StyleCopMSBuildTargetsNotFound;$(PrepareForBuildDependsOn) - - \ No newline at end of file diff --git a/src/Xbehave.Samples.Net40/packages.config b/src/Xbehave.Samples.Net40/packages.config deleted file mode 100644 index 982089ce..00000000 --- a/src/Xbehave.Samples.Net40/packages.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/Xbehave.sln b/src/Xbehave.sln index c3b72c3d..1fdcd285 100644 --- a/src/Xbehave.sln +++ b/src/Xbehave.sln @@ -1,6 +1,8 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xbehave.Net40", "Xbehave.Net40\Xbehave.Net40.csproj", "{93B47A03-8382-4E25-B800-F6BDCE6B9C6B}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionFiles", "SolutionFiles", "{1DAD0ED8-7F96-4299-BEBB-04F3C25BFC76}" @@ -15,15 +17,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionFiles", "SolutionFi Xbehave.snk = Xbehave.snk EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xbehave.Samples.Net40", "Xbehave.Samples.Net40\Xbehave.Samples.Net40.csproj", "{318A83C1-F734-4612-A04F-9BE0D26657BF}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{41BB5C25-6084-4CA2-A9E8-EE35A1CA1DEA}" ProjectSection(SolutionItems) = preProject test\Settings.StyleCop = test\Settings.StyleCop EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{C43DA667-DF59-4438-B3DC-F707DF861043}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xbehave.Specifications.Net40", "test\Xbehave.Specifications.Net40\Xbehave.Specifications.Net40.csproj", "{70E80F2E-D19C-4CA8-AE7F-E9A6953810EF}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{BBC5886B-9456-470B-836F-722154863920}" @@ -51,8 +49,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xbehave.Features.Net40", "t EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xbehave.Features.Net35", "test\Xbehave.Features.Net35\Xbehave.Features.Net35.csproj", "{F64FAC93-8534-4A00-83C6-031C51923BA3}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Xbehave.Samples.FSharp.Net45", "Xbehave.Samples.FSharp.Net45\Xbehave.Samples.FSharp.Net45.fsproj", "{410529E9-B417-44D0-A48E-B3009E16783E}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -63,10 +59,6 @@ Global {93B47A03-8382-4E25-B800-F6BDCE6B9C6B}.Debug|Any CPU.Build.0 = Debug|Any CPU {93B47A03-8382-4E25-B800-F6BDCE6B9C6B}.Release|Any CPU.ActiveCfg = Release|Any CPU {93B47A03-8382-4E25-B800-F6BDCE6B9C6B}.Release|Any CPU.Build.0 = Release|Any CPU - {318A83C1-F734-4612-A04F-9BE0D26657BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {318A83C1-F734-4612-A04F-9BE0D26657BF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {318A83C1-F734-4612-A04F-9BE0D26657BF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {318A83C1-F734-4612-A04F-9BE0D26657BF}.Release|Any CPU.Build.0 = Release|Any CPU {70E80F2E-D19C-4CA8-AE7F-E9A6953810EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {70E80F2E-D19C-4CA8-AE7F-E9A6953810EF}.Debug|Any CPU.Build.0 = Debug|Any CPU {70E80F2E-D19C-4CA8-AE7F-E9A6953810EF}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -103,17 +95,11 @@ Global {F64FAC93-8534-4A00-83C6-031C51923BA3}.Debug|Any CPU.Build.0 = Debug|Any CPU {F64FAC93-8534-4A00-83C6-031C51923BA3}.Release|Any CPU.ActiveCfg = Debug|Any CPU {F64FAC93-8534-4A00-83C6-031C51923BA3}.Release|Any CPU.Build.0 = Debug|Any CPU - {410529E9-B417-44D0-A48E-B3009E16783E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {410529E9-B417-44D0-A48E-B3009E16783E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {410529E9-B417-44D0-A48E-B3009E16783E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {410529E9-B417-44D0-A48E-B3009E16783E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {318A83C1-F734-4612-A04F-9BE0D26657BF} = {C43DA667-DF59-4438-B3DC-F707DF861043} - {410529E9-B417-44D0-A48E-B3009E16783E} = {C43DA667-DF59-4438-B3DC-F707DF861043} {3CE881F9-3E00-4C16-8A90-9C5F57FA9565} = {41BB5C25-6084-4CA2-A9E8-EE35A1CA1DEA} {A763D3CE-3C9C-456D-A758-46C18B31DBD9} = {41BB5C25-6084-4CA2-A9E8-EE35A1CA1DEA} {5CC1C3CC-67FC-4691-83BF-E14B367E06C3} = {3CE881F9-3E00-4C16-8A90-9C5F57FA9565} diff --git a/src/test/Xbehave.Features.Net35/Xbehave.Features.Net35.csproj b/src/test/Xbehave.Features.Net35/Xbehave.Features.Net35.csproj index c71df520..0e92275b 100644 --- a/src/test/Xbehave.Features.Net35/Xbehave.Features.Net35.csproj +++ b/src/test/Xbehave.Features.Net35/Xbehave.Features.Net35.csproj @@ -123,6 +123,9 @@ + + +