diff --git a/.gitignore b/.gitignore index 5e2dfe72fb..ae045d20d0 100644 --- a/.gitignore +++ b/.gitignore @@ -6,9 +6,14 @@ bin/configlet.exe .fake/ .paket/paket.exe .vs/ +.vscode/ tools/ build/ packages/ paket-files TestResult.xml -junit-results.xml \ No newline at end of file +junit-results.xml +obj/ +bin/ +*.userprefs +.idea/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 21ab622e32..131ddc6550 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,33 @@ language: csharp - +sudo: required +dist: trusty +addons: + apt: + sources: ['ubuntu-toolchain-r-test'] + packages: + - gettext + - libcurl4-openssl-dev + - libicu-dev + - libssl-dev + - libunwind8 + - zlib1g + - libstdc++6 +env: + global: + - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + - DOTNET_CLI_TELEMETRY_OPTOUT: 1 +mono: + - 4.0.5 os: - linux - - osx + +before_install: + - curl https://download.microsoft.com/download/B/4/6/B4678511-01F4-4F97-902B-0E58A985932A/dotnet-dev-debian-x64.1.0.0-rc4-004771.tar.gz -o /tmp/dotnet.tar.gz + - sudo mkdir -p /opt/dotnet + - sudo tar zxf /tmp/dotnet.tar.gz -C /opt/dotnet + - sudo ln -s /opt/dotnet/dotnet /usr/local/bin script: - ./bin/fetch-configlet - ./bin/configlet . - - ./build.sh \ No newline at end of file + - ./build.sh diff --git a/Zipper.cs b/Zipper.cs new file mode 100644 index 0000000000..23995d9589 --- /dev/null +++ b/Zipper.cs @@ -0,0 +1,137 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +public class BinTree : IEquatable> +{ + public BinTree(T value, BinTree left, BinTree right) + { + Value = value; + Left = left; + Right = right; + } + + public BinTree(BinTree tree) : this(tree.Value, tree.Left, tree.Right) + { + } + + public T Value { get; } + public BinTree Left { get; } + public BinTree Right { get; } + + public bool Equals(BinTree other) + { + if (other == null || !Equals(Value, other.Value)) + return false; + + if (!ReferenceEquals(Left, other.Left) && (!Left?.Equals(other.Left) ?? false)) + return false; + + if (!ReferenceEquals(Right, other.Right) && (!Right?.Equals(other.Right) ?? false)) + return false; + + return true; + } +} + +public abstract class BinTreeCrumb +{ + public BinTreeCrumb(T value, BinTree tree) + { + Value = value; + Tree = tree; + } + + public T Value { get; } + public BinTree Tree { get; } +} + +public class BinTreeLeftCrumb : BinTreeCrumb +{ + public BinTreeLeftCrumb(T value, BinTree tree) : base(value, tree) + { + } +} + +public class BinTreeRightCrumb : BinTreeCrumb +{ + public BinTreeRightCrumb(T value, BinTree tree) : base(value, tree) + { + } +} + +public class Zipper +{ + private readonly T value; + private readonly BinTree left; + private readonly BinTree right; + private readonly List> crumbs; + + public Zipper(T value, BinTree left, BinTree right, List> crumbs) + { + this.value = value; + this.left = left; + this.right = right; + this.crumbs = crumbs; + } + + public T Value => value; + + public Zipper SetValue(T newValue) => new Zipper(newValue, left, right, crumbs); + + public Zipper SetLeft(BinTree binTree) => new Zipper(value, binTree, right, crumbs); + + public Zipper SetRight(BinTree binTree) => new Zipper(value, left, binTree, crumbs); + + public Zipper Left() + { + if (left == null) + return null; + + var newCrumbs = new[] { new BinTreeLeftCrumb(value, right) }.Concat(crumbs).ToList(); + return new Zipper(left.Value, left.Left, left.Right, newCrumbs); + } + + public Zipper Right() + { + if (right == null) + return null; + + var newCrumbs = new[] { new BinTreeRightCrumb(value, left) }.Concat(crumbs).ToList(); + return new Zipper(right.Value, right.Left, right.Right, newCrumbs); + } + + public Zipper Up() + { + if (crumbs.Count == 0) + return null; + + var firstCrumb = crumbs[0]; + var remainingCrumbs = crumbs.Skip(1).ToList(); + + if (firstCrumb is BinTreeLeftCrumb) + return new Zipper(firstCrumb.Value, new BinTree(value, left, right), firstCrumb.Tree, remainingCrumbs); + + if (firstCrumb is BinTreeRightCrumb) + return new Zipper(firstCrumb.Value, firstCrumb.Tree, new BinTree(value, left, right), remainingCrumbs); + + return null; + } + + public BinTree ToTree() + { + var tree = new BinTree(value, left, right); + + foreach (var crumb in crumbs) + { + if (crumb is BinTreeLeftCrumb) + tree = new BinTree(crumb.Value, new BinTree(tree), crumb.Tree); + if (crumb is BinTreeRightCrumb) + tree = new BinTree(crumb.Value, crumb.Tree, new BinTree(tree)); + } + + return tree; + } + + public static Zipper FromTree(BinTree tree) => new Zipper(tree.Value, tree.Left, tree.Right, new List>()); +} \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 2fe5df9633..4527eb3a9f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,9 @@ +init: +- ps: (New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/5/F/E/5FEB7E95-C643-48D5-8329-9D2C63676CE8/dotnet-dev-win-x64.1.0.0-rc4-004771.exe', "c:/dotnet-install.exe") +- cmd: c:\dotnet-install.exe /install /quiet build_script: - ps: .\build.cmd - +environment: + DOTNET_CLI_TELEMETRY_OPTOUT: true + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true test: off \ No newline at end of file diff --git a/build.fsx b/build.fsx index 3cfffc6e29..425ae5a224 100644 --- a/build.fsx +++ b/build.fsx @@ -1,66 +1,78 @@ -// Include Fake library #r "./packages/FAKE/tools/FakeLib.dll" open Fake -open Fake.Testing.NUnit3 +open Fake.DotNetCli +open System.Text -// Directories -let buildDir = "./build/" -let sourceDir = "./exercises/" +let project = environVarOrDefault "project" "*" +let buildDir = "./build/" +let sourceDir = "./exercises/" +let projectDirs = buildDir @@ project -// Files -let solutionFile = buildDir @@ "/exercises.csproj" -let compiledOutput = buildDir @@ "xcsharp.dll" -let nunitToJunitTransformFile = "./paket-files" @@ "nunit" @@ "nunit-transforms" @@ "nunit3-junit" @@ "nunit3-junit.xslt" +let testFiles = !! (projectDirs @@ "*Test.cs") +let allProjects = !! (projectDirs @@ "*.csproj") +let defaultProjects = + !! (projectDirs @@ "*.csproj") -- + (projectDirs @@ "DotDsl.csproj") -- + (projectDirs @@ "Hangman.csproj") -- + (projectDirs @@ "React.csproj") +let refactoringProjects = + !! (projectDirs @@ "TreeBuilding.csproj") ++ + (projectDirs @@ "Ledger.csproj") ++ + (projectDirs @@ "Markdown.csproj") -// Targets -Target "PrepareUnchanged" (fun _ -> - CleanDirs [buildDir] - CopyDir buildDir sourceDir allFiles -) +let restore project = DotNetCli.Restore (fun p -> { p with Project = project }) +let build project = DotNetCli.Build (fun p -> { p with Project = project }) +let test project = DotNetCli.Test (fun p -> { p with Project = project }) + +let restoreAndBuild project = + restore project + build project -Target "BuildUnchanged" (fun _ -> - MSBuildRelease buildDir "Build" [solutionFile] - |> Log "Build unchanged output: " +let restoreAndTest project = + restore project + test project + +Target "Clean" (fun _ -> + DeleteDir buildDir ) -Target "PrepareTests" (fun _ -> - CleanDirs [buildDir] +Target "CopyExercises" (fun _ -> CopyDir buildDir sourceDir allFiles +) - let ignorePattern = "(\[Ignore\(\"Remove to run test\"\)]|, Ignore = \"Remove to run test case\")" +Target "BuildUsingStubImplementation" (fun _ -> + Seq.iter restoreAndBuild defaultProjects +) + +Target "EnableAllTests" (fun _ -> + let skipProperty = "Skip\s*=\s*\"Remove to run test\"" + RegexReplaceInFilesWithEncoding skipProperty "" Encoding.UTF8 testFiles +) - !! (buildDir @@ "**/*Test.cs") - |> RegexReplaceInFilesWithEncoding ignorePattern "" System.Text.Encoding.UTF8 +Target "TestRefactoringProjects" (fun _ -> + Seq.iter restoreAndTest refactoringProjects ) -Target "BuildTests" (fun _ -> - MSBuildRelease buildDir "Build" [solutionFile] - |> Log "Build tests output: " +Target "ReplaceStubWithExampleImplementation" (fun _ -> + let replaceStubWithExampleImplementation project = + let stubFile = filename project + "" |> changeExt ".cs" + let exampleFile = "Example.cs" + RegexReplaceInFileWithEncoding exampleFile stubFile Encoding.UTF8 project + + Seq.iter replaceStubWithExampleImplementation allProjects ) -Target "Test" (fun _ -> - if getEnvironmentVarAsBool "APPVEYOR" then - [compiledOutput] - |> NUnit3 (fun p -> { p with - ShadowCopy = false - ToolPath = "nunit3-console.exe" }) - else if getEnvironmentVarAsBool "CIRCLECI" then - [compiledOutput] - |> NUnit3 (fun p -> { p with - ShadowCopy = false - ResultSpecs = [sprintf "junit-results.xml;transform=%s" nunitToJunitTransformFile] }) - else - [compiledOutput] - |> NUnit3 (fun p -> { p with ShadowCopy = false }) +Target "TestUsingExampleImplementation" (fun _ -> + Seq.iter restoreAndTest allProjects ) -// Build order -"PrepareUnchanged" - ==> "BuildUnchanged" - ==> "PrepareTests" - ==> "BuildTests" - ==> "Test" +"Clean" + ==> "CopyExercises" + ==> "BuildUsingStubImplementation" + ==> "EnableAllTests" + ==> "TestRefactoringProjects" + ==> "ReplaceStubWithExampleImplementation" + ==> "TestUsingExampleImplementation" -// start build -RunTargetOrDefault "Test" \ No newline at end of file +RunTargetOrDefault "TestUsingExampleImplementation" \ No newline at end of file diff --git a/circle.yml b/circle.yml index a83b9814cb..37e9a84e1c 100644 --- a/circle.yml +++ b/circle.yml @@ -1,16 +1,26 @@ machine: environment: TERM: xterm-256color + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 dependencies: pre: + - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF - echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list - sudo apt-get update - sudo apt-get install mono-complete + - sudo apt-get install gettext + - sudo apt-get install libcurl4-openssl-dev + - sudo apt-get install libicu-dev + - sudo apt-get install libssl-dev + - sudo apt-get install libunwind8 + - sudo apt-get install zlib1g + - sudo apt-get install libstdc++6 + - curl https://download.microsoft.com/download/B/4/6/B4678511-01F4-4F97-902B-0E58A985932A/dotnet-dev-debian-x64.1.0.0-rc4-004771.tar.gz -o /tmp/dotnet.tar.gz + - sudo mkdir -p /opt/dotnet + - sudo tar zxf /tmp/dotnet.tar.gz -C /opt/dotnet + - sudo ln -s /opt/dotnet/dotnet /usr/local/bin test: override: - - ./build.sh - post: - - mkdir -p $CIRCLE_TEST_REPORTS/junit/ - - sed -i '1 s/^\xef\xbb\xbf//' .*/junit-results.xml - - find . -type f -regex ".*/junit-results.xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \; \ No newline at end of file + - ./build.sh \ No newline at end of file diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md index f4eba89f9a..d43ea4f0cd 100644 --- a/docs/INSTALLATION.md +++ b/docs/INSTALLATION.md @@ -1,185 +1,20 @@ -## Installing C# +### Installing .NET Core -* [Windows](#windows) -* [Mac](#mac) -* [Linux](#linux) - -### [Windows](#windows) -There are a couple of different ways to get started using C#. The main way is to -install Visual Studio, the IDE for C# and related projects. - -If you don't want to use the IDE, files can be compiled via command line using the -compiler provided by the .NET framework. - -#### With Visual Studio - -Install [Visual Studio Express 2013 for Windows Desktop](http://www.visualstudio.com/downloads/download-visual-studio-vs#d-express-windows-desktop). This will include the IDE and compiler for C#. - -You can either start by creating your own project for working with the Exercism problems or you can download a Visual Studio solution that is already set up. - -#### Exercism.io Visual Studio Template - -This is a Visual Studio template that comes pre-configured to work on the problems in as many languages as Visual Studio supports. - -![Solution Explorer](http://x.exercism.io/v3/tracks/csharp/docs/img/SolutionExplorer.png) - -1. Download the [Exercism.io Visual Studio Template](https://github.com/rprouse/Exercism.VisualStudio) from GitHub by clicking the Download Zip button on the page. -2. Unzip the template into your exercises directory, for example `C:\src\exercises` -2. Install the [Exercism CLI](http://exercism.io/cli) -3. Open a command prompt to your exercise directory -4. Add your API key to exercism `exercism configure --key=YOUR_API_KEY` -5. Configure your source directory in exercism `exercism configure --dir=C:\src\exercises` -6. [Fetch your first exercise](http://exercism.io/how-it-works/newbie) `exercism fetch csharp` -7. Open the Exercism solution in Visual Studio -8. Expand the Exercism.csharp project -9. Click on **Show All Files** in Solution Explorer (See below) -10. The exercise you just fetched will appear greyed out. Right click on the folder and **Include In Project** -11. Get coding... - -![Add files](http://x.exercism.io/v3/tracks/csharp/docs/img/AddFiles.png) - -The NUnit NuGet package is included in the project, so you will not need to install it. - -If you have a paid version of Visual Studio install the [NUnit Visual Studio Test Adapter](https://visualstudiogallery.msdn.microsoft.com/6ab922d0-21c0-4f06-ab5f-4ecd1fe7175d). This will allow you to run the tests from within Visual Studio. If you have ReSharper installed, you can also [run the tests using ReSharper](https://www.jetbrains.com/resharper/features/unit_testing.html). - -![Test Explorer](http://x.exercism.io/v3/tracks/csharp/docs/img/TestExplorer.png) - -If you are using Visual Studio Express, install [NUnit 3.x](http://www.nunit.org/) and run the tests from the command line (see below). - -#### Create a New Visual Studio Project - -Once installed and started, click on "Create New Project" (alternatively, you can go to File->New->New Project). - -![New Project](http://x.exercism.io/v3/tracks/csharp/docs/img/newProject.png) - -Choose what language and project type (Visual C# and Class Library). Also name your project to whatever you'd like. - -![Create Project](http://x.exercism.io/v3/tracks/csharp/docs/img/createNewProject.png) - -Once created, feel free to drag and drop the C# Exercism folders into the project. - -![Drag and Drop Folders](http://x.exercism.io/v3/tracks/csharp/docs/img/dragDropFolders.png) - -In order to compile, get the [NUnit](http://nunit.org/) assembly referenced for the unit tests. This can be done via [NuGet](http://www.nuget.org/) - a package manager for Visual Studio. The best packages is to get the base [NUnit]() and the [NUnit.Console](https://www.nuget.org/packages/NUnit.Console/) -package since it includes the assemblies needed and a GUI test runner. - -![Nuget](http://x.exercism.io/v3/tracks/csharp/docs/img/nugetMenu.png) - -Two options to use Nuget - the NuGet manager or through the Package Manager Console. - -The manager is the easiest way to get started. - -![Nuget Manager](http://x.exercism.io/v3/tracks/csharp/docs/img/nugetManageNunitRunner.png) - -The project should now be able to compile. - -The next piece required is the NUnit Test Adapter for Visual Studio. The major version of the Test Adapter must match the major version of the NUnit Framework that you installed above, or the Visual Studio Test Explorer window will not detect your unit tests. -- [Adapter Version 3 for NUnit 3.x](https://visualstudiogallery.msdn.microsoft.com/0da0f6bd-9bb6-4ae3-87a8-537788622f2d) -- [Adapter Version 2 for NUnit 2.x](https://visualstudiogallery.msdn.microsoft.com/6ab922d0-21c0-4f06-ab5f-4ecd1fe7175d) - -To start implementing the exercise, in Visual Studio, right click on where you want the file to go to and go to `Add` -> `Class`. Name it what you'd like. - -![New Item](http://x.exercism.io/v3/tracks/csharp/docs/img/addNewClass.png) - -Now you can start coding! - -#### With the command line compiler -The .cs files can also be compiled without Visual Studio. Get the latest version of -[.NET installed](http://msdn.microsoft.com/en-us/library/5a4x27ek(v=vs.110).aspx) and there will be an executable called csc.exe. - -The compiler executable is usually located in the Microsoft.NET\Framework\Version folder under the Windows directory. - -Refer to this [MSDN article](http://msdn.microsoft.com/en-us/library/78f4aasd.aspx) for more information on the command line compiler. - -### [Mac](#mac) - -Install [Xamarin Studio](http://xamarin.com/download). - -While Xamarin is most known for creating iOS and Android applications, it's still a perfect IDE to create C# console -or library projects which is all that's needed for Exercism. - -Once installed and running, click on new solution and you'll find the C# library project to select. - -![Xamarin New Project](http://x.exercism.io/v3/tracks/csharp/docs/img/xamarin-csharp.jpg) - -### [Linux](#linux) - -.NET Core is available for Linux. Follow the [official installation guide](https://www.microsoft.com/net/core#linuxubuntu) to install the .NET Core development tools. - -After installing .NET Core, fetch the first exercise of the csharp-track: - -``` -exercism fetch csharp -``` - -Move into the exercise directory: - -``` -cd ~/exercism/csharp/hello-world -``` - -Initialize a new dotnet project - -``` -dotnet new -``` - -Several new files are created, among them project.json. We have to add nunit as a dependency in order to run the tests provided in the exercise. - -Add the following lines to the dependency block: +The C# track is built on top of the [.NET Core](https://www.microsoft.com/net/core/platform) platform, which runs on Windows, Linux and macOS. To build .NET Core projects, you can use the .NET Core Command Line Interface (CLI). This CLI is part of the .NET Core SDK, which you can install by following the [installation instructions](https://www.microsoft.com/net/download/core). After completing the installation, you can verify if the CLI was installed succesfully by running this command in a terminal: -``` -"dependencies": { - "nunit": "3.6.0", - "dotnet-test-nunit": "3.4.0-*" -} +```bash +dotnet --version ``` -We also have to specify the testrunner, add this line below the dependency block: +It the output is a version greater than or equal to `1.0.0`, the .NET Core SDK has been installed succesfully. -``` -"testRunner":"nunit" -``` - -The complete **project.json** file should look something like this: +### Using an IDE -``` -{ - "version": "1.0.0-*", - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true - }, - "dependencies": { - "nunit": "3.6.0", - "dotnet-test-nunit": "3.4.0-*" - }, - "testRunner":"nunit", - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.0" - } - }, - "imports": "dnxcore50" - } - } -} -``` - -Then we can restore the packages using: - -``` -dotnet restore -``` - -Compile the project and run the tests with this: - -``` -dotnet test -``` +If you want a more full-featured editing experience, you probably want to to use an IDE. These are the most popular IDE's that support building .NET Core projects: +* [Visual Studio 2017](https://www.visualstudio.com/downloads/) +* [Visual Studio Code](https://code.visualstudio.com/download) with the [C# extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp) +* [Visual Studio for Mac](https://www.visualstudio.com/vs/visual-studio-mac/) (still in beta) +* [Project Rider](https://www.jetbrains.com/rider/download/) (still in EAP) -[Mono Develop](http://www.mono-project.com/Mono_For_Linux_Developers) is available for Linux. +Note: as the .NET Core project format differs significantly from earlier versions, older IDE's (like Visual Studio 2015 and Xamarin Studio) are not supported. \ No newline at end of file diff --git a/docs/TESTS.md b/docs/TESTS.md index a3f69ffa2c..231ce97133 100644 --- a/docs/TESTS.md +++ b/docs/TESTS.md @@ -1,50 +1,33 @@ -### Windows -All tests have been ignored except the first one for you to work on. To continue, just remove the ```[Ignore]``` attribute on the test to start working on it. +## Running Tests -Make sure [NUnit](http://nunit.org/?p=download) version 3.x is installed, if not already installed from the setup above. +To run the tests, you first need to restore the project's dependencies using the following command: -This installation should include the NUnit-Gui executable. Run this, and after compiling, open the assembly from the Gui and you are able to run the tests. +```bash +dotnet restore +``` -**Note:** You may need to include the nunit-framework.dll in the same directory as the source code you're compiling if you get an error saying it can't find the ```nunit.framework.dll```. +You can then run the tests by executing the following command: -If you installed the NUnit runner through NuGet, the runner will be located in the ```\packages\NUnit.Console(version number)\tools``` folder where your project is. +```bash +dotnet test +``` -If you installed NUnit manually the runner will be in the ```Program Files (x86)\NUnit(version number)\bin``` folder. +## Solving the exercise -![NUnit Runner](http://x.exercism.io/v3/tracks/csharp/docs/img/nUnitRunner.png) +Solving an exercise means making all its tests pass. By default, only one test (the first one) is executed when you run the tests. This is intentional, as it allows you to focus on just making that one test pass. Once it passes, you can enable the next test by removing `Skip = "Remove to run test"` from the test's `[Fact]` or `[Theory]` attribute. When all tests have been enabled and your implementation makes them all pass, you'll have solved the exercise! -Once you have been able to compile the code it will create a DLL in the ```\bin\Debug``` folder of your project. In the NUnit runner, select "Open Project" and select the DLL that was created from compiling. This will load all the tests and allow you to run them. +To help you get started, each exercise comes with a stub implementation file. You can use this file as a starting point for building your solution. Feel free to remove or change this file if you think it is the right thing to do. -![NUnit Runner Execute Tests](http://x.exercism.io/v3/tracks/csharp/docs/img/nUnitExecuteTests.png) +## Using packages -The NUnit runner will automatically reload the DLL if it has been updated. +You should be able to solve most exercises without using any external packages. However, for the exercises where you do want to use an external package, you can add it to your project by running the following command: -##### Visual Studio Integration +```bash +dotnet add package +``` -Another alternative to running the tests with NUnit-Gui is to run them directly in Visual Studio, which is very convenient if that's your IDE of choice. While the support is natively built in to Visual Studio 2015, for older versions you'll need to install the [NUnit Test Adapter](http://www.nunit.org/index.php?p=vsTestAdapter&r=2.6.2). +Once the package has been added, you need to update the project's dependencies again to use it in your project: -### Mac -Xamarin Studio also ships with NUnit. To set the tests up you will have to add an NUnit library project to your solution, name it correctly and set a reference to your solution. - -This is the example setup for the "leap" exercise. We assume you created a solution called `LeapCalculator`. - -Right-click the solution and choose *Add* -> *Add New Project*. -![Add Xamarin NUnit Test](http://x.exercism.io/v3/tracks/csharp/docs/img/xamarin-add-new-project.png) - -Then from the new project dialog, select an NUnit Library Project. -![Xamarin NUnit](http://x.exercism.io/v3/tracks/csharp/docs/img/xamarin-nunit.jpg) - -For the project name append `.Tests` to the name of your solution. So in our case `LeapCalculator.Tests` -![Xamarin NUnit](http://x.exercism.io/v3/tracks/csharp/docs/img/xamarin-naming.png) - -Set a reference to your solution with right-click on references in your test project. Then choose the Projects tab and tick the box to your solution and click `ok`. - -![Xamarin NUnit](http://x.exercism.io/v3/tracks/csharp/docs/img/xamarin-edit-reference.png) - -![Xamarin NUnit](http://x.exercism.io/v3/tracks/csharp/docs/img/xamarin-add-reference.png) - -Add some of the tests from the exercise or write your own. - -To run the tests open the `Unit Tests` pad within Xamarin (View -> Pads -> Unit Tests) and click `Run All`. - -![Xamarin NUnit](http://x.exercism.io/v3/tracks/csharp/docs/img/xamarin-tests.png) +```bash +dotnet restore +``` \ No newline at end of file diff --git a/docs/img/AddFiles.png b/docs/img/AddFiles.png deleted file mode 100644 index 03e7a9163c..0000000000 Binary files a/docs/img/AddFiles.png and /dev/null differ diff --git a/docs/img/SolutionExplorer.png b/docs/img/SolutionExplorer.png deleted file mode 100644 index e3e57db108..0000000000 Binary files a/docs/img/SolutionExplorer.png and /dev/null differ diff --git a/docs/img/TestExplorer.png b/docs/img/TestExplorer.png deleted file mode 100644 index 1cdc5e84ae..0000000000 Binary files a/docs/img/TestExplorer.png and /dev/null differ diff --git a/docs/img/addNewClass.png b/docs/img/addNewClass.png deleted file mode 100644 index 393120072a..0000000000 Binary files a/docs/img/addNewClass.png and /dev/null differ diff --git a/docs/img/createNewProject.png b/docs/img/createNewProject.png deleted file mode 100644 index c0fa0ee44d..0000000000 Binary files a/docs/img/createNewProject.png and /dev/null differ diff --git a/docs/img/dragDropFolders.png b/docs/img/dragDropFolders.png deleted file mode 100644 index c5f401ec0c..0000000000 Binary files a/docs/img/dragDropFolders.png and /dev/null differ diff --git a/docs/img/nUnitExecuteTests.png b/docs/img/nUnitExecuteTests.png deleted file mode 100644 index b975a238cd..0000000000 Binary files a/docs/img/nUnitExecuteTests.png and /dev/null differ diff --git a/docs/img/nUnitRunner.png b/docs/img/nUnitRunner.png deleted file mode 100644 index 1c10d43af1..0000000000 Binary files a/docs/img/nUnitRunner.png and /dev/null differ diff --git a/docs/img/newProject.png b/docs/img/newProject.png deleted file mode 100644 index 064438a349..0000000000 Binary files a/docs/img/newProject.png and /dev/null differ diff --git a/docs/img/nugetManageNunitRunner.png b/docs/img/nugetManageNunitRunner.png deleted file mode 100644 index f855bd84e7..0000000000 Binary files a/docs/img/nugetManageNunitRunner.png and /dev/null differ diff --git a/docs/img/nugetMenu.png b/docs/img/nugetMenu.png deleted file mode 100644 index 72f2436fdf..0000000000 Binary files a/docs/img/nugetMenu.png and /dev/null differ diff --git a/docs/img/xamarin-add-new-project.png b/docs/img/xamarin-add-new-project.png deleted file mode 100644 index 680f448032..0000000000 Binary files a/docs/img/xamarin-add-new-project.png and /dev/null differ diff --git a/docs/img/xamarin-add-reference.png b/docs/img/xamarin-add-reference.png deleted file mode 100644 index 86939e86c1..0000000000 Binary files a/docs/img/xamarin-add-reference.png and /dev/null differ diff --git a/docs/img/xamarin-csharp.jpg b/docs/img/xamarin-csharp.jpg deleted file mode 100644 index e37c226d43..0000000000 Binary files a/docs/img/xamarin-csharp.jpg and /dev/null differ diff --git a/docs/img/xamarin-edit-reference.png b/docs/img/xamarin-edit-reference.png deleted file mode 100644 index c06b3cfa95..0000000000 Binary files a/docs/img/xamarin-edit-reference.png and /dev/null differ diff --git a/docs/img/xamarin-naming.png b/docs/img/xamarin-naming.png deleted file mode 100644 index 7207b7dae4..0000000000 Binary files a/docs/img/xamarin-naming.png and /dev/null differ diff --git a/docs/img/xamarin-nunit.jpg b/docs/img/xamarin-nunit.jpg deleted file mode 100644 index a0ab5aac42..0000000000 Binary files a/docs/img/xamarin-nunit.jpg and /dev/null differ diff --git a/docs/img/xamarin-tests.png b/docs/img/xamarin-tests.png deleted file mode 100644 index f46d6db184..0000000000 Binary files a/docs/img/xamarin-tests.png and /dev/null differ diff --git a/exercises/accumulate/Accumulate.cs b/exercises/accumulate/Accumulate.cs new file mode 100644 index 0000000000..d5a0aaac1a --- /dev/null +++ b/exercises/accumulate/Accumulate.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; + +public static class AccumulateExtensions +{ + public static IEnumerable Accumulate(this IEnumerable collection, Func func) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/accumulate/Accumulate.csproj b/exercises/accumulate/Accumulate.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/accumulate/Accumulate.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/accumulate/AccumulateTest.cs b/exercises/accumulate/AccumulateTest.cs index c424a87af5..f51ec956b2 100644 --- a/exercises/accumulate/AccumulateTest.cs +++ b/exercises/accumulate/AccumulateTest.cs @@ -1,38 +1,32 @@ using System; using System.Collections.Generic; using System.Linq; -using NUnit.Framework; +using Xunit; -[TestFixture] public class AccumulateTest { - [Test] + [Fact] public void Empty_accumulation_produces_empty_accumulation() { - Assert.That(new int[0].Accumulate(x => x * x), Is.EqualTo(new int[0])); + Assert.Equal(new int[0], new int[0].Accumulate(x => x * x)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Accumulate_squares() { - Assert.That(new[] { 1, 2, 3 }.Accumulate(x => x * x), Is.EqualTo(new[] { 1, 4, 9 })); + Assert.Equal(new[] { 1, 4, 9 }, new[] { 1, 2, 3 }.Accumulate(x => x * x)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Accumulate_upcases() { - Assert.That(new List { "hello", "world" }.Accumulate(x => x.ToUpper()), - Is.EqualTo(new List { "HELLO", "WORLD" })); + Assert.Equal(new List { "HELLO", "WORLD" }, new List { "hello", "world" }.Accumulate(x => x.ToUpper())); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Accumulate_reversed_strings() { - Assert.That("the quick brown fox etc".Split(' ').Accumulate(Reverse), - Is.EqualTo("eht kciuq nworb xof cte".Split(' '))); + Assert.Equal("eht kciuq nworb xof cte".Split(' '), "the quick brown fox etc".Split(' ').Accumulate(Reverse)); } private static string Reverse(string value) @@ -42,33 +36,28 @@ private static string Reverse(string value) return new string(array); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Accumulate_within_accumulate() { var actual = new[] { "a", "b", "c" }.Accumulate(c => string.Join(" ", new[] { "1", "2", "3" }.Accumulate(d => c + d))); - Assert.That(actual, Is.EqualTo(new[] { "a1 a2 a3", "b1 b2 b3", "c1 c2 c3" })); + Assert.Equal(new[] { "a1 a2 a3", "b1 b2 b3", "c1 c2 c3" }, actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Accumulate_is_lazy() { var counter = 0; var accumulation = new[] { 1, 2, 3 }.Accumulate(x => x * counter++); - Assert.That(counter, Is.EqualTo(0)); + Assert.Equal(0, counter); accumulation.ToList(); - Assert.That(counter, Is.EqualTo(3)); + Assert.Equal(3, counter); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Accumulate_allows_different_return_type() { - Assert.That( - new[] { 1, 2, 3 }.Accumulate(x => x.ToString()), - Is.EqualTo(new[] { "1", "2", "3" })); + Assert.Equal(new[] { "1", "2", "3" }, new[] { 1, 2, 3 }.Accumulate(x => x.ToString())); } } \ No newline at end of file diff --git a/exercises/acronym/Acronym.cs b/exercises/acronym/Acronym.cs new file mode 100644 index 0000000000..3251a98aaa --- /dev/null +++ b/exercises/acronym/Acronym.cs @@ -0,0 +1,9 @@ +using System; + +public static class Acronym +{ + public static string Abbreviate(string phrase) + { + throw new NotImplementedException("Please implement this function"); + } +} \ No newline at end of file diff --git a/exercises/acronym/Acronym.csproj b/exercises/acronym/Acronym.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/acronym/Acronym.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/acronym/AcronymTest.cs b/exercises/acronym/AcronymTest.cs index 2aa04a84e5..3ebb91534f 100644 --- a/exercises/acronym/AcronymTest.cs +++ b/exercises/acronym/AcronymTest.cs @@ -1,25 +1,22 @@ -namespace Exercism -{ - using NUnit.Framework; +using Xunit; - [TestFixture] - public class AcronymTest +public class AcronymTest +{ + [Fact] + public void Empty_string_abbreviated_to_empty_string() { - [Test] - public void Empty_string_abbreviated_to_empty_string() - { - Assert.That(Acronym.Abbreviate(string.Empty), Is.EqualTo(string.Empty)); - } + Assert.Equal(string.Empty, Acronym.Abbreviate(string.Empty)); + } - [TestCase("Portable Network Graphics", ExpectedResult = "PNG", Ignore = "Remove to run test case")] - [TestCase("Ruby on Rails", ExpectedResult = "ROR", Ignore = "Remove to run test case")] - [TestCase("HyperText Markup Language", ExpectedResult = "HTML", Ignore = "Remove to run test case")] - [TestCase("First In, First Out", ExpectedResult = "FIFO", Ignore = "Remove to run test case")] - [TestCase("PHP: Hypertext Preprocessor", ExpectedResult = "PHP", Ignore = "Remove to run test case")] - [TestCase("Complementary metal-oxide semiconductor", ExpectedResult = "CMOS", Ignore = "Remove to run test case")] - public string Phrase_abbreviated_to_acronym(string phrase) - { - return Acronym.Abbreviate(phrase); - } + [Theory(Skip = "Remove to run test")] + [InlineData("Portable Network Graphics", "PNG")] + [InlineData("Ruby on Rails", "ROR")] + [InlineData("HyperText Markup Language", "HTML")] + [InlineData("First In, First Out", "FIFO")] + [InlineData("PHP: Hypertext Preprocessor", "PHP")] + [InlineData("Complementary metal-oxide semiconductor", "CMOS")] + public void Phrase_abbreviated_to_acronym(string phrase, string expected) + { + Assert.Equal(expected, Acronym.Abbreviate(phrase)); } } \ No newline at end of file diff --git a/exercises/acronym/Example.cs b/exercises/acronym/Example.cs index 1fe9b634cb..1bb25383b8 100644 --- a/exercises/acronym/Example.cs +++ b/exercises/acronym/Example.cs @@ -1,19 +1,16 @@ -namespace Exercism -{ - using System.Collections.Generic; - using System.Linq; - using System.Text.RegularExpressions; +using System.Collections.Generic; +using System.Linq; +using System.Text.RegularExpressions; - public static class Acronym +public static class Acronym +{ + public static string Abbreviate(string phrase) { - public static string Abbreviate(string phrase) - { - return Words(phrase).Aggregate("", (abbr, word) => abbr + char.ToUpperInvariant(word[0])); - } + return Words(phrase).Aggregate("", (abbr, word) => abbr + char.ToUpperInvariant(word[0])); + } - private static IEnumerable Words(string phrase) - { - return Regex.Matches(phrase, "[A-Z]+[a-z]*|[a-z]+").Cast().Select(m => m.Value); - } + private static IEnumerable Words(string phrase) + { + return Regex.Matches(phrase, "[A-Z]+[a-z]*|[a-z]+").Cast().Select(m => m.Value); } } \ No newline at end of file diff --git a/exercises/all-your-base/AllYourBase.cs b/exercises/all-your-base/AllYourBase.cs new file mode 100644 index 0000000000..503669cd1a --- /dev/null +++ b/exercises/all-your-base/AllYourBase.cs @@ -0,0 +1,9 @@ +using System; + +public static class Base +{ + public static int[] Rebase(int inputBase, int[] inputDigits, int outputBase) + { + throw new NotImplementedException("Please implement this function"); + } +} \ No newline at end of file diff --git a/exercises/all-your-base/AllYourBase.csproj b/exercises/all-your-base/AllYourBase.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/all-your-base/AllYourBase.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/all-your-base/AllYourBaseTest.cs b/exercises/all-your-base/AllYourBaseTest.cs index 21899bc84c..4347393e19 100644 --- a/exercises/all-your-base/AllYourBaseTest.cs +++ b/exercises/all-your-base/AllYourBaseTest.cs @@ -1,98 +1,89 @@ using System; -using NUnit.Framework; +using Xunit; -[TestFixture] public class AllYourBaseTest { - [Test] + [Fact] public void Single_bit_one_to_decimal() { const int inputBase = 2; var inputDigits = new [] { 1 }; const int outputBase = 10; var outputDigits = new [] { 1 }; - Assert.That(Base.Rebase(inputBase, inputDigits, outputBase), Is.EqualTo(outputDigits)); + Assert.Equal(outputDigits, Base.Rebase(inputBase, inputDigits, outputBase)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Binary_to_single_decimal() { const int inputBase = 2; var inputDigits = new [] { 1, 0, 1 }; const int outputBase = 10; var outputDigits = new [] { 5 }; - Assert.That(Base.Rebase(inputBase, inputDigits, outputBase), Is.EqualTo(outputDigits)); + Assert.Equal(outputDigits, Base.Rebase(inputBase, inputDigits, outputBase)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Single_decimal_to_binary() { const int inputBase = 10; var inputDigits = new [] { 5 }; const int outputBase = 2; var outputDigits = new [] { 1, 0, 1 }; - Assert.That(Base.Rebase(inputBase, inputDigits, outputBase), Is.EqualTo(outputDigits)); + Assert.Equal(outputDigits, Base.Rebase(inputBase, inputDigits, outputBase)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Binary_to_multiple_decimal() { const int inputBase = 2; var inputDigits = new [] { 1, 0, 1, 0, 1, 0 }; const int outputBase = 10; var outputDigits = new [] { 4, 2 }; - Assert.That(Base.Rebase(inputBase, inputDigits, outputBase), Is.EqualTo(outputDigits)); + Assert.Equal(outputDigits, Base.Rebase(inputBase, inputDigits, outputBase)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Decimal_to_binary() { const int inputBase = 10; var inputDigits = new [] { 4, 2 }; const int outputBase = 2; var outputDigits = new [] { 1, 0, 1, 0, 1, 0 }; - Assert.That(Base.Rebase(inputBase, inputDigits, outputBase), Is.EqualTo(outputDigits)); + Assert.Equal(outputDigits, Base.Rebase(inputBase, inputDigits, outputBase)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Trinary_to_hexadecimal() { const int inputBase = 3; var inputDigits = new [] { 1, 1, 2, 0 }; const int outputBase = 16; var outputDigits = new [] { 2, 10 }; - Assert.That(Base.Rebase(inputBase, inputDigits, outputBase), Is.EqualTo(outputDigits)); + Assert.Equal(outputDigits, Base.Rebase(inputBase, inputDigits, outputBase)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Hexadecimal_to_trinary() { const int inputBase = 16; var inputDigits = new [] { 2, 10 }; const int outputBase = 3; var outputDigits = new [] { 1, 1, 2, 0 }; - Assert.That(Base.Rebase(inputBase, inputDigits, outputBase), Is.EqualTo(outputDigits)); + Assert.Equal(outputDigits, Base.Rebase(inputBase, inputDigits, outputBase)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Using_15_bit_integer() { const int inputBase = 97; var inputDigits = new [] { 3, 46, 60 }; const int outputBase = 73; var outputDigits = new [] { 6, 10, 45 }; - Assert.That(Base.Rebase(inputBase, inputDigits, outputBase), Is.EqualTo(outputDigits)); + Assert.Equal(outputDigits, Base.Rebase(inputBase, inputDigits, outputBase)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Empty_array() { const int inputBase = 2; @@ -101,8 +92,7 @@ public void Empty_array() Assert.Throws(() => Base.Rebase(inputBase, inputDigits, outputBase)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Single_zero() { const int inputBase = 10; @@ -111,8 +101,7 @@ public void Single_zero() Assert.Throws(() => Base.Rebase(inputBase, inputDigits, outputBase)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Multiple_zeros() { const int inputBase = 10; @@ -121,8 +110,7 @@ public void Multiple_zeros() Assert.Throws(() => Base.Rebase(inputBase, inputDigits, outputBase)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Leading_zeros() { const int inputBase = 7; @@ -131,8 +119,7 @@ public void Leading_zeros() Assert.Throws(() => Base.Rebase(inputBase, inputDigits, outputBase)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Negative_digit() { const int inputBase = 2; @@ -141,8 +128,7 @@ public void Negative_digit() Assert.Throws(() => Base.Rebase(inputBase, inputDigits, outputBase)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Invalid_positive_digit() { const int inputBase = 2; @@ -151,8 +137,7 @@ public void Invalid_positive_digit() Assert.Throws(() => Base.Rebase(inputBase, inputDigits, outputBase)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void First_base_is_one() { const int inputBase = 1; @@ -161,8 +146,7 @@ public void First_base_is_one() Assert.Throws(() => Base.Rebase(inputBase, inputDigits, outputBase)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Second_base_is_one() { const int inputBase = 2; @@ -171,8 +155,7 @@ public void Second_base_is_one() Assert.Throws(() => Base.Rebase(inputBase, inputDigits, outputBase)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void First_base_is_zero() { const int inputBase = 0; @@ -181,8 +164,7 @@ public void First_base_is_zero() Assert.Throws(() => Base.Rebase(inputBase, inputDigits, outputBase)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Second_base_is_zero() { const int inputBase = 10; @@ -191,8 +173,7 @@ public void Second_base_is_zero() Assert.Throws(() => Base.Rebase(inputBase, inputDigits, outputBase)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void First_base_is_negative() { const int inputBase = -2; @@ -201,8 +182,7 @@ public void First_base_is_negative() Assert.Throws(() => Base.Rebase(inputBase, inputDigits, outputBase)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Second_base_is_negative() { const int inputBase = 2; @@ -211,8 +191,7 @@ public void Second_base_is_negative() Assert.Throws(() => Base.Rebase(inputBase, inputDigits, outputBase)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Both_bases_are_negative() { const int inputBase = -2; diff --git a/exercises/allergies/Allergies.cs b/exercises/allergies/Allergies.cs new file mode 100644 index 0000000000..a659885c88 --- /dev/null +++ b/exercises/allergies/Allergies.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +public class Allergies +{ + public Allergies(int mask) + { + } + + public bool AllergicTo(string allergy) + { + throw new NotImplementedException("You need to implement this function."); + } + + public IList List() + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/allergies/Allergies.csproj b/exercises/allergies/Allergies.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/allergies/Allergies.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/allergies/AllergiesTest.cs b/exercises/allergies/AllergiesTest.cs index 98c3284e36..7f1cde649d 100644 --- a/exercises/allergies/AllergiesTest.cs +++ b/exercises/allergies/AllergiesTest.cs @@ -1,84 +1,73 @@ using System.Collections.Generic; -using NUnit.Framework; +using Xunit; -[TestFixture] public class AllergiesTest { - [Test] + [Fact] public void No_allergies_means_not_allergic() { var allergies = new Allergies(0); - Assert.That(allergies.AllergicTo("peanuts"), Is.False); - Assert.That(allergies.AllergicTo("cats"), Is.False); - Assert.That(allergies.AllergicTo("strawberries"), Is.False); + Assert.False(allergies.AllergicTo("peanuts")); + Assert.False(allergies.AllergicTo("cats")); + Assert.False(allergies.AllergicTo("strawberries")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Allergic_to_eggs() { var allergies = new Allergies(1); - Assert.That(allergies.AllergicTo("eggs"), Is.True); + Assert.True(allergies.AllergicTo("eggs")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Allergic_to_eggs_in_addition_to_other_stuff() { var allergies = new Allergies(5); - Assert.That(allergies.AllergicTo("eggs"), Is.True); - Assert.That(allergies.AllergicTo("shellfish"), Is.True); - Assert.That(allergies.AllergicTo("strawberries"), Is.False); + Assert.True(allergies.AllergicTo("eggs")); + Assert.True(allergies.AllergicTo("shellfish")); + Assert.False(allergies.AllergicTo("strawberries")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void No_allergies_at_all() { var allergies = new Allergies(0); - Assert.That(allergies.List(), Is.Empty); + Assert.Empty(allergies.List()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Allergic_to_just_eggs() { var allergies = new Allergies(1); - Assert.That(allergies.List(), Is.EqualTo(new List { "eggs" })); + Assert.Equal(new List { "eggs" }, allergies.List()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Allergic_to_just_peanuts() { var allergies = new Allergies(2); - Assert.That(allergies.List(), Is.EqualTo(new List { "peanuts" })); + Assert.Equal(new List { "peanuts" }, allergies.List()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Allergic_to_eggs_and_peanuts() { var allergies = new Allergies(3); - Assert.That(allergies.List(), Is.EqualTo(new List { "eggs", "peanuts" })); + Assert.Equal(new List { "eggs", "peanuts" }, allergies.List()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Allergic_to_lots_of_stuff() { var allergies = new Allergies(248); - Assert.That(allergies.List(), - Is.EqualTo(new List { "strawberries", "tomatoes", "chocolate", "pollen", "cats" })); + Assert.Equal(new List { "strawberries", "tomatoes", "chocolate", "pollen", "cats" }, allergies.List()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Allergic_to_everything() { var allergies = new Allergies(255); - Assert.That(allergies.List(), - Is.EqualTo(new List + Assert.Equal(new List { "eggs", "peanuts", @@ -88,16 +77,15 @@ public void Allergic_to_everything() "chocolate", "pollen", "cats" - })); + }, + allergies.List()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Ignore_non_allergen_score_parts() { var allergies = new Allergies(509); - Assert.That(allergies.List(), - Is.EqualTo(new List + Assert.Equal(new List { "eggs", "shellfish", @@ -106,6 +94,6 @@ public void Ignore_non_allergen_score_parts() "chocolate", "pollen", "cats" - })); + }, allergies.List()); } } \ No newline at end of file diff --git a/exercises/alphametics/Alphametics.cs b/exercises/alphametics/Alphametics.cs new file mode 100644 index 0000000000..a135482b40 --- /dev/null +++ b/exercises/alphametics/Alphametics.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; + +public static class Alphametics +{ + public static IDictionary Solve(string equation) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/alphametics/Alphametics.csproj b/exercises/alphametics/Alphametics.csproj new file mode 100644 index 0000000000..c826cd5794 --- /dev/null +++ b/exercises/alphametics/Alphametics.csproj @@ -0,0 +1,19 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + + diff --git a/exercises/alphametics/AlphameticsTest.cs b/exercises/alphametics/AlphameticsTest.cs index 20c6b840e1..1648a3e1b8 100644 --- a/exercises/alphametics/AlphameticsTest.cs +++ b/exercises/alphametics/AlphameticsTest.cs @@ -1,9 +1,10 @@ -using NUnit.Framework; +using Xunit; using System.Collections.Generic; +using System; public class AlphameticsTest { - [Test] + [Fact] public void Puzzle_with_three_letters() { var actual = Alphametics.Solve("I + BB == ILL"); @@ -13,25 +14,22 @@ public void Puzzle_with_three_letters() ['B'] = 9, ['L'] = 0 }; - Assert.That(actual, Is.EqualTo(expected)); + Assert.Equal(expected, actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Solution_must_have_unique_value_for_each_letter() { - Assert.That(() => Alphametics.Solve("A == B"), Throws.Exception); + Assert.Throws(() => Alphametics.Solve("A == B")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Leading_zero_solution_is_invalid() { - Assert.That(() => Alphametics.Solve("ACA + DD == BD"), Throws.Exception); + Assert.Throws(() => Alphametics.Solve("ACA + DD == BD")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Puzzle_with_four_letters() { var actual = Alphametics.Solve("AS + A == MOM"); @@ -42,11 +40,10 @@ public void Puzzle_with_four_letters() ['M'] = 1, ['O'] = 0 }; - Assert.That(actual, Is.EqualTo(expected)); + Assert.Equal(expected, actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Puzzle_with_six_letters() { var actual = Alphametics.Solve("NO + NO + TOO == LATE"); @@ -59,11 +56,10 @@ public void Puzzle_with_six_letters() ['A'] = 0, ['E'] = 2 }; - Assert.That(actual, Is.EqualTo(expected)); + Assert.Equal(expected, actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Puzzle_with_seven_letters() { var actual = Alphametics.Solve("HE + SEES + THE == LIGHT"); @@ -77,11 +73,10 @@ public void Puzzle_with_seven_letters() ['S'] = 9, ['T'] = 7, }; - Assert.That(actual, Is.EqualTo(expected)); + Assert.Equal(expected, actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Puzzle_with_eight_letters() { var actual = Alphametics.Solve("SEND + MORE == MONEY"); @@ -96,11 +91,10 @@ public void Puzzle_with_eight_letters() ['R'] = 8, ['Y'] = 2, }; - Assert.That(actual, Is.EqualTo(expected)); + Assert.Equal(expected, actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Puzzle_with_ten_letters() { var actual = Alphametics.Solve("AND + A + STRONG + OFFENSE + AS + A + GOOD == DEFENSE"); @@ -117,6 +111,6 @@ public void Puzzle_with_ten_letters() ['S'] = 6, ['T'] = 9, }; - Assert.That(actual, Is.EqualTo(expected)); + Assert.Equal(expected, actual); } } diff --git a/exercises/alphametics/Example.cs b/exercises/alphametics/Example.cs index 0630272fa6..c3fe804e87 100644 --- a/exercises/alphametics/Example.cs +++ b/exercises/alphametics/Example.cs @@ -10,7 +10,12 @@ public static IDictionary Solve(string equation) var expression = ExpressionParser.Equation.Parse(equation); var maps = GetValidMaps(expression.Chars, expression.StartChars); - return maps.First(map => expression.Solve(map) == 0); + var solution = maps.FirstOrDefault(map => expression.Solve(map) == 0); + + if (solution == null) + throw new ArgumentException(nameof(equation)); + + return solution; } private static IEnumerable> GetValidMaps(HashSet chars, HashSet startChars) diff --git a/exercises/anagram/Anagram.cs b/exercises/anagram/Anagram.cs new file mode 100644 index 0000000000..9f79929499 --- /dev/null +++ b/exercises/anagram/Anagram.cs @@ -0,0 +1,14 @@ +using System; + +public class Anagram +{ + public Anagram (string baseWord) + { + throw new NotImplementedException("You need to implement this function."); + } + + public string[] Match (string[] potentialMatches) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/anagram/Anagram.csproj b/exercises/anagram/Anagram.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/anagram/Anagram.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/anagram/AnagramTest.cs b/exercises/anagram/AnagramTest.cs index b34dce32f7..c2e4ccb07a 100644 --- a/exercises/anagram/AnagramTest.cs +++ b/exercises/anagram/AnagramTest.cs @@ -1,95 +1,86 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class AnagramTest { - [Test] + [Fact] public void No_matches() { var detector = new Anagram("diaper"); var words = new[] { "hello", "world", "zombies", "pants" }; var results = new string[0]; - Assert.That(detector.Match(words), Is.EquivalentTo(results)); + Assert.Equal(results, detector.Match(words)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Detect_simple_anagram() { var detector = new Anagram("ant"); var words = new[] { "tan", "stand", "at" }; var results = new[] { "tan" }; - Assert.That(detector.Match(words), Is.EquivalentTo(results)); + Assert.Equal(results, detector.Match(words)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Detect_multiple_anagrams() { var detector = new Anagram("master"); var words = new[] { "stream", "pigeon", "maters" }; var results = new[] { "maters", "stream" }; - Assert.That(detector.Match(words), Is.EquivalentTo(results)); + Assert.Equal(results, detector.Match(words)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Does_not_confuse_different_duplicates() { var detector = new Anagram("galea"); var words = new[] { "eagle" }; var results = new string[0]; - Assert.That(detector.Match(words), Is.EquivalentTo(results)); + Assert.Equal(results, detector.Match(words)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Identical_word_is_not_anagram() { var detector = new Anagram("corn"); var words = new[] { "corn", "dark", "Corn", "rank", "CORN", "cron", "park" }; var results = new[] { "cron" }; - Assert.That(detector.Match(words), Is.EquivalentTo(results)); + Assert.Equal(results, detector.Match(words)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Eliminate_anagrams_with_same_checksum() { var detector = new Anagram("mass"); var words = new[] { "last" }; var results = new string[0]; - Assert.That(detector.Match(words), Is.EquivalentTo(results)); + Assert.Equal(results, detector.Match(words)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Eliminate_anagram_subsets() { var detector = new Anagram("good"); var words = new[] { "dog", "goody" }; var results = new string[0]; - Assert.That(detector.Match(words), Is.EquivalentTo(results)); + Assert.Equal(results, detector.Match(words)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Detect_anagrams() { var detector = new Anagram("allergy"); var words = new[] { "gallery", "ballerina", "regally", "clergy", "largely", "leading" }; var results = new[] { "gallery", "largely", "regally" }; - Assert.That(detector.Match(words), Is.EquivalentTo(results)); + Assert.Equal(results, detector.Match(words)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Anagrams_are_case_insensitive() { var detector = new Anagram("Orchestra"); var words = new[] { "cashregister", "Carthorse", "radishes" }; var results = new[] { "Carthorse" }; - Assert.That(detector.Match(words), Is.EquivalentTo(results)); + Assert.Equal(results, detector.Match(words)); } } \ No newline at end of file diff --git a/exercises/atbash-cipher/AtbashCipher.cs b/exercises/atbash-cipher/AtbashCipher.cs new file mode 100644 index 0000000000..827d56037a --- /dev/null +++ b/exercises/atbash-cipher/AtbashCipher.cs @@ -0,0 +1,9 @@ +using System; + +public static class Atbash +{ + public static string Encode(string value) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/atbash-cipher/AtbashCipher.csproj b/exercises/atbash-cipher/AtbashCipher.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/atbash-cipher/AtbashCipher.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/atbash-cipher/AtbashTest.cs b/exercises/atbash-cipher/AtbashTest.cs index 5f197fe2c5..9f663c4e02 100644 --- a/exercises/atbash-cipher/AtbashTest.cs +++ b/exercises/atbash-cipher/AtbashTest.cs @@ -1,17 +1,17 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class AtbashTest { - [TestCase("no", ExpectedResult = "ml")] - [TestCase("yes", ExpectedResult = "bvh", Ignore = "Remove to run test case")] - [TestCase("OMG", ExpectedResult = "lnt", Ignore = "Remove to run test case")] - [TestCase("mindblowingly", ExpectedResult = "nrmwy oldrm tob", Ignore = "Remove to run test case")] - [TestCase("Testing, 1 2 3, testing.", ExpectedResult = "gvhgr mt123 gvhgr mt", Ignore = "Remove to run test case")] - [TestCase("Truth is fiction.", ExpectedResult = "gifgs rhurx grlm", Ignore = "Remove to run test case")] - [TestCase("The quick brown fox jumps over the lazy dog.", ExpectedResult = "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt", Ignore = "Remove to run test case")] - public string Encodes_words_using_atbash_cipher(string words) + [Theory] + [InlineData("no", "ml")] + [InlineData("yes", "bvh")] + [InlineData("OMG", "lnt")] + [InlineData("mindblowingly", "nrmwy oldrm tob")] + [InlineData("Testing, 1 2 3, testing.", "gvhgr mt123 gvhgr mt")] + [InlineData("Truth is fiction.", "gifgs rhurx grlm")] + [InlineData("The quick brown fox jumps over the lazy dog.", "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt")] + public void Encodes_words_using_atbash_cipher(string words, string expected) { - return Atbash.Encode(words); + Assert.Equal(expected, Atbash.Encode(words)); } } \ No newline at end of file diff --git a/exercises/atbash-cipher/Example.cs b/exercises/atbash-cipher/Example.cs index a918218e63..6885c8e753 100644 --- a/exercises/atbash-cipher/Example.cs +++ b/exercises/atbash-cipher/Example.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; -public class Atbash +public static class Atbash { private const string PLAIN = "abcdefghijklmnopqrstuvwxyz"; private const string CIPHER = "zyxwvutsrqponmlkjihgfedcba"; diff --git a/exercises/bank-account/BankAccount.cs b/exercises/bank-account/BankAccount.cs new file mode 100644 index 0000000000..d8009e44d2 --- /dev/null +++ b/exercises/bank-account/BankAccount.cs @@ -0,0 +1,27 @@ +using System; + +public class BankAccount +{ + public void Open() + { + throw new NotImplementedException("You need to implement this function."); + } + + public void Close() + { + throw new NotImplementedException("You need to implement this function."); + } + + public float Balance + { + get + { + throw new NotImplementedException("You need to implement this property."); + } + } + + public void UpdateBalance(float change) + { + throw new NotImplementedException("You need to implement this function."); + } +} diff --git a/exercises/bank-account/BankAccount.csproj b/exercises/bank-account/BankAccount.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/bank-account/BankAccount.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/bank-account/BankAccountTest.cs b/exercises/bank-account/BankAccountTest.cs index b82a44003b..d001d043b8 100644 --- a/exercises/bank-account/BankAccountTest.cs +++ b/exercises/bank-account/BankAccountTest.cs @@ -1,21 +1,20 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using NUnit.Framework; +using Xunit; public class BankAccountTest { - [Test] + [Fact] public void Returns_empty_balance_after_opening() { var account = new BankAccount(); account.Open(); - Assert.That(account.Balance, Is.EqualTo(0)); + Assert.Equal(0, account.Balance); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Check_basic_balance() { var account = new BankAccount(); @@ -26,12 +25,11 @@ public void Check_basic_balance() account.UpdateBalance(10); var updatedBalance = account.Balance; - Assert.That(openingBalance, Is.EqualTo(0)); - Assert.That(updatedBalance, Is.EqualTo(10)); + Assert.Equal(0, openingBalance); + Assert.Equal(10, updatedBalance); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Balance_can_increment_and_decrement() { var account = new BankAccount(); @@ -44,24 +42,22 @@ public void Balance_can_increment_and_decrement() account.UpdateBalance(-15); var subtractedBalance = account.Balance; - Assert.That(openingBalance, Is.EqualTo(0)); - Assert.That(addedBalance, Is.EqualTo(10)); - Assert.That(subtractedBalance, Is.EqualTo(-5)); + Assert.Equal(0, openingBalance); + Assert.Equal(10, addedBalance); + Assert.Equal(-5, subtractedBalance); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Closed_account_throws_exception_when_checking_balance() { var account = new BankAccount(); account.Open(); account.Close(); - Assert.That(() => account.Balance, Throws.InvalidOperationException); + Assert.Throws(() => account.Balance); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Change_account_balance_from_multiple_threads() { var account = new BankAccount(); @@ -84,6 +80,6 @@ public void Change_account_balance_from_multiple_threads() } Task.WaitAll(tasks.ToArray()); - Assert.That(account.Balance, Is.EqualTo(0)); + Assert.Equal(0, account.Balance); } } diff --git a/exercises/beer-song/BeerSong.cs b/exercises/beer-song/BeerSong.cs new file mode 100644 index 0000000000..60636cbcdb --- /dev/null +++ b/exercises/beer-song/BeerSong.cs @@ -0,0 +1,14 @@ +using System; + +public static class Beer +{ + public static string Verse(int number) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static string Sing(int start, int stop) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/beer-song/BeerSong.csproj b/exercises/beer-song/BeerSong.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/beer-song/BeerSong.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/beer-song/BeerTest.cs b/exercises/beer-song/BeerTest.cs index d66f4c51b7..cbdb2d6f29 100644 --- a/exercises/beer-song/BeerTest.cs +++ b/exercises/beer-song/BeerTest.cs @@ -1,20 +1,22 @@ -using NUnit.Framework; +using Xunit; public class BeerTests { - [TestCase(8, ExpectedResult = "8 bottles of beer on the wall, 8 bottles of beer.\nTake one down and pass it around, 7 bottles of beer on the wall.\n")] - [TestCase(2, ExpectedResult = "2 bottles of beer on the wall, 2 bottles of beer.\nTake one down and pass it around, 1 bottle of beer on the wall.\n", Ignore = "Remove to run test case")] - [TestCase(1, ExpectedResult = "1 bottle of beer on the wall, 1 bottle of beer.\nTake it down and pass it around, no more bottles of beer on the wall.\n", Ignore = "Remove to run test case")] - [TestCase(0, ExpectedResult = "No more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.\n", Ignore = "Remove to run test case")] - public string Verse(int number) + [Theory] + [InlineData(8, "8 bottles of beer on the wall, 8 bottles of beer.\nTake one down and pass it around, 7 bottles of beer on the wall.\n")] + [InlineData(2, "2 bottles of beer on the wall, 2 bottles of beer.\nTake one down and pass it around, 1 bottle of beer on the wall.\n")] + [InlineData(1, "1 bottle of beer on the wall, 1 bottle of beer.\nTake it down and pass it around, no more bottles of beer on the wall.\n")] + [InlineData(0, "No more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.\n")] + public void Verse(int number, string expected) { - return Beer.Verse(number); + Assert.Equal(expected, Beer.Verse(number)); } - [TestCase(8, 6, ExpectedResult = "8 bottles of beer on the wall, 8 bottles of beer.\nTake one down and pass it around, 7 bottles of beer on the wall.\n\n7 bottles of beer on the wall, 7 bottles of beer.\nTake one down and pass it around, 6 bottles of beer on the wall.\n\n6 bottles of beer on the wall, 6 bottles of beer.\nTake one down and pass it around, 5 bottles of beer on the wall.\n\n", Ignore = "Remove to run test case")] - [TestCase(3, 0, ExpectedResult = "3 bottles of beer on the wall, 3 bottles of beer.\nTake one down and pass it around, 2 bottles of beer on the wall.\n\n2 bottles of beer on the wall, 2 bottles of beer.\nTake one down and pass it around, 1 bottle of beer on the wall.\n\n1 bottle of beer on the wall, 1 bottle of beer.\nTake it down and pass it around, no more bottles of beer on the wall.\n\nNo more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.\n\n", Ignore = "Remove to run test case")] - public string Sing(int start, int stop) + [Theory(Skip = "Remove to run test")] + [InlineData(8, 6, "8 bottles of beer on the wall, 8 bottles of beer.\nTake one down and pass it around, 7 bottles of beer on the wall.\n\n7 bottles of beer on the wall, 7 bottles of beer.\nTake one down and pass it around, 6 bottles of beer on the wall.\n\n6 bottles of beer on the wall, 6 bottles of beer.\nTake one down and pass it around, 5 bottles of beer on the wall.\n\n")] + [InlineData(3, 0, "3 bottles of beer on the wall, 3 bottles of beer.\nTake one down and pass it around, 2 bottles of beer on the wall.\n\n2 bottles of beer on the wall, 2 bottles of beer.\nTake one down and pass it around, 1 bottle of beer on the wall.\n\n1 bottle of beer on the wall, 1 bottle of beer.\nTake it down and pass it around, no more bottles of beer on the wall.\n\nNo more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.\n\n")] + public void Sing(int start, int stop, string expected) { - return Beer.Sing(start, stop); + Assert.Equal(expected, Beer.Sing(start, stop)); } } \ No newline at end of file diff --git a/exercises/binary-search-tree/BinarySearchTree.cs b/exercises/binary-search-tree/BinarySearchTree.cs new file mode 100644 index 0000000000..cd6a9edca5 --- /dev/null +++ b/exercises/binary-search-tree/BinarySearchTree.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections; +using System.Collections.Generic; + +public class BinarySearchTree : IEnumerable +{ + public BinarySearchTree(int value) + { + } + + public BinarySearchTree(IEnumerable values) + { + } + + public int Value + { + get + { + throw new NotImplementedException("You need to implement this function."); + } + } + + public BinarySearchTree Left + { + get + { + throw new NotImplementedException("You need to implement this function."); + } + } + + public BinarySearchTree Right + { + get + { + throw new NotImplementedException("You need to implement this function."); + } + } + + public BinarySearchTree Add(int value) + { + throw new NotImplementedException("You need to implement this function."); + } + + public IEnumerator GetEnumerator() + { + throw new NotImplementedException("You need to implement this function."); + } + + IEnumerator IEnumerable.GetEnumerator() + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/binary-search-tree/BinarySearchTree.csproj b/exercises/binary-search-tree/BinarySearchTree.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/binary-search-tree/BinarySearchTree.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/binary-search-tree/BinarySearchTreeTest.cs b/exercises/binary-search-tree/BinarySearchTreeTest.cs index 0d7efb8c38..ebf718d684 100644 --- a/exercises/binary-search-tree/BinarySearchTreeTest.cs +++ b/exercises/binary-search-tree/BinarySearchTreeTest.cs @@ -1,85 +1,77 @@ using System.Linq; -using NUnit.Framework; +using Xunit; public class BinarySearchTreeTest { - [Test] + [Fact] public void Data_is_retained() { var tree = new BinarySearchTree(4); - Assert.That(tree.Value, Is.EqualTo(4)); + Assert.Equal(4, tree.Value); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Inserting_less() { var tree = new BinarySearchTree(4).Add(2); - Assert.That(tree.Value, Is.EqualTo(4)); - Assert.That(tree.Left.Value, Is.EqualTo(2)); + Assert.Equal(4, tree.Value); + Assert.Equal(2, tree.Left.Value); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Inserting_same() { var tree = new BinarySearchTree(4).Add(4); - Assert.That(tree.Value, Is.EqualTo(4)); - Assert.That(tree.Left.Value, Is.EqualTo(4)); + Assert.Equal(4, tree.Value); + Assert.Equal(4, tree.Left.Value); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Inserting_greater() { var tree = new BinarySearchTree(4).Add(5); - Assert.That(tree.Value, Is.EqualTo(4)); - Assert.That(tree.Right.Value, Is.EqualTo(5)); + Assert.Equal(4, tree.Value); + Assert.Equal(5, tree.Right.Value); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Complex_tree() { var tree = new BinarySearchTree(new [] { 4, 2, 6, 1, 3, 7, 5 }); - Assert.That(tree.Value, Is.EqualTo(4)); - Assert.That(tree.Left.Value, Is.EqualTo(2)); - Assert.That(tree.Left.Left.Value, Is.EqualTo(1)); - Assert.That(tree.Left.Right.Value, Is.EqualTo(3)); - Assert.That(tree.Right.Value, Is.EqualTo(6)); - Assert.That(tree.Right.Left.Value, Is.EqualTo(5)); - Assert.That(tree.Right.Right.Value, Is.EqualTo(7)); + Assert.Equal(4, tree.Value); + Assert.Equal(2, tree.Left.Value); + Assert.Equal(1, tree.Left.Left.Value); + Assert.Equal(3, tree.Left.Right.Value); + Assert.Equal(6, tree.Right.Value); + Assert.Equal(5, tree.Right.Left.Value); + Assert.Equal(7, tree.Right.Right.Value); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Iterating_one_element() { var elements = new BinarySearchTree(4).AsEnumerable(); - Assert.That(elements, Is.EqualTo(new [] { 4 })); + Assert.Equal(new [] { 4 }, elements); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Iterating_over_smaller_element() { var elements = new BinarySearchTree(new[] { 4, 2 }).AsEnumerable(); - Assert.That(elements, Is.EqualTo(new[] { 2, 4 })); + Assert.Equal(new[] { 2, 4 }, elements); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Iterating_over_larger_element() { var elements = new BinarySearchTree(new[] { 4, 5 }).AsEnumerable(); - Assert.That(elements, Is.EqualTo(new[] { 4, 5 })); + Assert.Equal(new[] { 4, 5 }, elements); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Iterating_over_complex_element() { var elements = new BinarySearchTree(new[] { 4, 2, 1, 3, 6, 7, 5 }).AsEnumerable(); - Assert.That(elements, Is.EqualTo(new[] { 1, 2, 3, 4, 5, 6, 7 })); + Assert.Equal(new[] { 1, 2, 3, 4, 5, 6, 7 }, elements); } } \ No newline at end of file diff --git a/exercises/binary-search/BinarySearch.cs b/exercises/binary-search/BinarySearch.cs new file mode 100644 index 0000000000..54a1717d08 --- /dev/null +++ b/exercises/binary-search/BinarySearch.cs @@ -0,0 +1,9 @@ +using System; + +public static class BinarySearch +{ + public static int Search(int[] input, int target) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/binary-search/BinarySearch.csproj b/exercises/binary-search/BinarySearch.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/binary-search/BinarySearch.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/binary-search/BinarySearchTest.cs b/exercises/binary-search/BinarySearchTest.cs index a607afe69d..d1d98f49e0 100644 --- a/exercises/binary-search/BinarySearchTest.cs +++ b/exercises/binary-search/BinarySearchTest.cs @@ -1,76 +1,67 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class BinarySearchTest { - [Test] + [Fact] public void Should_return_minus_one_when_an_empty_array_is_searched() { var input = new int[0]; - Assert.That(BinarySearch.Search(input, 6), Is.EqualTo(-1)); + Assert.Equal(-1, BinarySearch.Search(input, 6)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Should_be_able_to_find_a_value_in_a_single_element_array_with_one_access() { var input = new[] { 6 }; - Assert.That(BinarySearch.Search(input, 6), Is.EqualTo(0)); + Assert.Equal(0, BinarySearch.Search(input, 6)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Should_return_minus_one_if_a_value_is_less_than_the_element_in_a_single_element_array() { var input = new[] { 94 }; - Assert.That(BinarySearch.Search(input, 6), Is.EqualTo(-1)); + Assert.Equal(-1, BinarySearch.Search(input, 6)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Should_return_minus_one_if_a_value_is_greater_than_the_element_in_a_single_element_array() { var input = new[] { 94 }; - Assert.That(BinarySearch.Search(input, 602), Is.EqualTo(-1)); + Assert.Equal(-1, BinarySearch.Search(input, 602)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Should_find_an_element_in_a_longer_array() { var input = new[] { 6, 67, 123, 345, 456, 457, 490, 2002, 54321, 54322 }; - Assert.That(BinarySearch.Search(input, 2002), Is.EqualTo(7)); + Assert.Equal(7, BinarySearch.Search(input, 2002)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Should_find_elements_at_the_beginning_of_an_array() { var input = new[] { 6, 67, 123, 345, 456, 457, 490, 2002, 54321, 54322 }; - Assert.That(BinarySearch.Search(input, 6), Is.EqualTo(0)); + Assert.Equal(0, BinarySearch.Search(input, 6)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Should_find_elements_at_the_end_of_an_array() { var input = new[] { 6, 67, 123, 345, 456, 457, 490, 2002, 54321, 54322 }; - Assert.That(BinarySearch.Search(input, 54322), Is.EqualTo(9)); + Assert.Equal(9, BinarySearch.Search(input, 54322)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Should_return_minus_one_if_a_value_is_less_than_all_elements_in_a_long_array() { var input = new[] { 6, 67, 123, 345, 456, 457, 490, 2002, 54321, 54322 }; - Assert.That(BinarySearch.Search(input, 2), Is.EqualTo(-1)); + Assert.Equal(-1, BinarySearch.Search(input, 2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Should_return_minus_one_if_a_value_is_greater_than_all_elements_in_a_long_array() { var input = new[] { 6, 67, 123, 345, 456, 457, 490, 2002, 54321, 54322 }; - Assert.That(BinarySearch.Search(input, 54323), Is.EqualTo(-1)); + Assert.Equal(-1, BinarySearch.Search(input, 54323)); } } \ No newline at end of file diff --git a/exercises/bob/Bob.cs b/exercises/bob/Bob.cs new file mode 100644 index 0000000000..d4b9f98611 --- /dev/null +++ b/exercises/bob/Bob.cs @@ -0,0 +1,9 @@ +using System; + +public static class Bob +{ + public static string Hey(string statement) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/bob/Bob.csproj b/exercises/bob/Bob.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/bob/Bob.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/bob/BobTest.cs b/exercises/bob/BobTest.cs index 5a4a542d05..1019d9bb18 100644 --- a/exercises/bob/BobTest.cs +++ b/exercises/bob/BobTest.cs @@ -1,130 +1,112 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class BobTest { - [Test] + [Fact] public void Stating_something () { - Assert.That(Bob.Hey("Tom-ay-to, tom-aaaah-to."), Is.EqualTo("Whatever.")); + Assert.Equal("Whatever.", Bob.Hey("Tom-ay-to, tom-aaaah-to.")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Shouting () { - Assert.That(Bob.Hey("WATCH OUT!"), Is.EqualTo("Whoa, chill out!")); + Assert.Equal("Whoa, chill out!", Bob.Hey("WATCH OUT!")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Asking_a_question () { - Assert.That(Bob.Hey("Does this cryogenic chamber make me look fat?"), Is.EqualTo("Sure.")); + Assert.Equal("Sure.", Bob.Hey("Does this cryogenic chamber make me look fat?")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Asking_a_question_with_a_trailing_space() { - Assert.That(Bob.Hey("Do I like my spacebar too much? "), Is.EqualTo("Sure.")); + Assert.Equal("Sure.", Bob.Hey("Do I like my spacebar too much? ")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Asking_a_numeric_question () { - Assert.That(Bob.Hey("You are, what, like 15?"), Is.EqualTo("Sure.")); + Assert.Equal("Sure.", Bob.Hey("You are, what, like 15?")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Talking_forcefully () { - Assert.That(Bob.Hey("Let's go make out behind the gym!"), Is.EqualTo("Whatever.")); + Assert.Equal("Whatever.", Bob.Hey("Let's go make out behind the gym!")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Using_acronyms_in_regular_search () { - Assert.That(Bob.Hey("It's OK if you don't want to go to the DMV."), Is.EqualTo("Whatever.")); + Assert.Equal("Whatever.", Bob.Hey("It's OK if you don't want to go to the DMV.")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Forceful_questions () { - Assert.That(Bob.Hey("WHAT THE HELL WERE YOU THINKING?"), Is.EqualTo("Whoa, chill out!")); + Assert.Equal("Whoa, chill out!", Bob.Hey("WHAT THE HELL WERE YOU THINKING?")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Shouting_numbers () { - Assert.That(Bob.Hey("1, 2, 3 GO!"), Is.EqualTo("Whoa, chill out!")); + Assert.Equal("Whoa, chill out!", Bob.Hey("1, 2, 3 GO!")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Only_numbers () { - Assert.That(Bob.Hey("1, 2, 3"), Is.EqualTo("Whatever.")); + Assert.Equal("Whatever.", Bob.Hey("1, 2, 3")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Question_with_only_numbers () { - Assert.That(Bob.Hey("4?"), Is.EqualTo("Sure.")); + Assert.Equal("Sure.", Bob.Hey("4?")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Shouting_with_special_characters () { - Assert.That(Bob.Hey("ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!"), Is.EqualTo("Whoa, chill out!")); + Assert.Equal("Whoa, chill out!", Bob.Hey("ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Shouting_with_no_exclamation_mark () { - Assert.That(Bob.Hey("I HATE YOU"), Is.EqualTo("Whoa, chill out!")); + Assert.Equal("Whoa, chill out!", Bob.Hey("I HATE YOU")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Statement_containing_question_mark () { - Assert.That(Bob.Hey("Ending with ? means a question."), Is.EqualTo("Whatever.")); + Assert.Equal("Whatever.", Bob.Hey("Ending with ? means a question.")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Prattling_on () { - Assert.That(Bob.Hey("Wait! Hang on. Are you going to be OK?"), Is.EqualTo("Sure.")); + Assert.Equal("Sure.", Bob.Hey("Wait! Hang on. Are you going to be OK?")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Silence () { - Assert.That(Bob.Hey(""), Is.EqualTo("Fine. Be that way!")); + Assert.Equal("Fine. Be that way!", Bob.Hey("")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Prolonged_silence () { - Assert.That(Bob.Hey(" "), Is.EqualTo("Fine. Be that way!")); + Assert.Equal("Fine. Be that way!", Bob.Hey(" ")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Multiple_line_question () { - Assert.That(Bob.Hey("Does this cryogenic chamber make me look fat?\nno"), Is.EqualTo("Whatever.")); + Assert.Equal("Whatever.", Bob.Hey("Does this cryogenic chamber make me look fat?\nno")); } } diff --git a/exercises/bob/Example.cs b/exercises/bob/Example.cs index fc1b716f1a..0e96ec3608 100644 --- a/exercises/bob/Example.cs +++ b/exercises/bob/Example.cs @@ -1,4 +1,4 @@ -public class Bob +public static class Bob { public static string Hey(string statement) { @@ -25,5 +25,4 @@ private static bool IsQuestion (string statement) { return statement.Trim().EndsWith("?"); } - -} +} \ No newline at end of file diff --git a/exercises/book-store/BookStore.cs b/exercises/book-store/BookStore.cs new file mode 100644 index 0000000000..aad6c61a67 --- /dev/null +++ b/exercises/book-store/BookStore.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; + +public static class BookStore +{ + public static double CalculateTotalCost(List books) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/book-store/BookStore.csproj b/exercises/book-store/BookStore.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/book-store/BookStore.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/book-store/BookStoreTest.cs b/exercises/book-store/BookStoreTest.cs index 8ec73c56e4..4faed66a6e 100644 --- a/exercises/book-store/BookStoreTest.cs +++ b/exercises/book-store/BookStoreTest.cs @@ -1,91 +1,79 @@ using System.Collections.Generic; using System.Linq; -using NUnit.Framework; +using Xunit; -[TestFixture] public class BookStoreTest { - [Test] + [Fact] public void Basket_with_single_book() { - Assert.That(BookStore.CalculateTotalCost(MakeList(1)), Is.EqualTo(8)); + Assert.Equal(8, BookStore.CalculateTotalCost(MakeList(1))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Basket_with_two_of_same_book() { - Assert.That(BookStore.CalculateTotalCost(MakeList(2, 2)), Is.EqualTo(16)); + Assert.Equal(16, BookStore.CalculateTotalCost(MakeList(2, 2))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Empty_basket() { - Assert.That(BookStore.CalculateTotalCost(MakeList()), Is.EqualTo(0)); + Assert.Equal(0, BookStore.CalculateTotalCost(MakeList())); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Basket_with_two_different_books() { - Assert.That(BookStore.CalculateTotalCost(MakeList(1, 2)), Is.EqualTo(15.2)); + Assert.Equal(15.2, BookStore.CalculateTotalCost(MakeList(1, 2))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Basket_with_three_different_books() { - Assert.That(BookStore.CalculateTotalCost(MakeList(1, 2, 3)), Is.EqualTo(21.6)); + Assert.Equal(21.6, BookStore.CalculateTotalCost(MakeList(1, 2, 3))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Basket_with_four_different_books() { - Assert.That(BookStore.CalculateTotalCost(MakeList(1, 2, 3, 4)), Is.EqualTo(25.6)); + Assert.Equal(25.6, BookStore.CalculateTotalCost(MakeList(1, 2, 3, 4))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Basket_with_five_different_books() { - Assert.That(BookStore.CalculateTotalCost(MakeList(1, 2, 3, 4, 5)), Is.EqualTo(30)); + Assert.Equal(30, BookStore.CalculateTotalCost(MakeList(1, 2, 3, 4, 5))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Basket_with_eight_books() { - Assert.That(BookStore.CalculateTotalCost(MakeList(1, 1, 2, 2, 3, 3, 4, 5)), Is.EqualTo(51.20)); + Assert.Equal(51.20, BookStore.CalculateTotalCost(MakeList(1, 1, 2, 2, 3, 3, 4, 5))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Basket_with_nine_books() { - Assert.That(BookStore.CalculateTotalCost(MakeList(1, 1, 2, 2, 3, 3, 4, 4, 5)), Is.EqualTo(55.60)); + Assert.Equal(55.60, BookStore.CalculateTotalCost(MakeList(1, 1, 2, 2, 3, 3, 4, 4, 5))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Basket_with_ten_books() { - Assert.That(BookStore.CalculateTotalCost(MakeList(1, 1, 2, 2, 3, 3, 4, 4, 5, 5)), Is.EqualTo(60)); + Assert.Equal(60, BookStore.CalculateTotalCost(MakeList(1, 1, 2, 2, 3, 3, 4, 4, 5, 5))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Basket_with_eleven_books() { - Assert.That(BookStore.CalculateTotalCost(MakeList(1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 1)), Is.EqualTo(68)); + Assert.Equal(68, BookStore.CalculateTotalCost(MakeList(1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 1))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Basket_with_twelve_books() { - Assert.That(BookStore.CalculateTotalCost(MakeList(1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 1, 2)), Is.EqualTo(75.20)); + Assert.Equal(75.20, BookStore.CalculateTotalCost(MakeList(1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 1, 2))); } private static List MakeList(params int[] values) diff --git a/exercises/book-store/Example.cs b/exercises/book-store/Example.cs index 5d32be193b..4428c459d5 100644 --- a/exercises/book-store/Example.cs +++ b/exercises/book-store/Example.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; -public class BookStore +public static class BookStore { public static double CalculateTotalCost(List books) { diff --git a/exercises/bowling/Bowling.cs b/exercises/bowling/Bowling.cs new file mode 100644 index 0000000000..f990e56e48 --- /dev/null +++ b/exercises/bowling/Bowling.cs @@ -0,0 +1,14 @@ +using System; + +public class BowlingGame +{ + public void Roll(int pins) + { + throw new NotImplementedException("You need to implement this function."); + } + + public int? Score() + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/bowling/Bowling.csproj b/exercises/bowling/Bowling.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/bowling/Bowling.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/bowling/BowlingTest.cs b/exercises/bowling/BowlingTest.cs index b8725aaebc..3441476f98 100644 --- a/exercises/bowling/BowlingTest.cs +++ b/exercises/bowling/BowlingTest.cs @@ -1,221 +1,198 @@ using System.Collections.Generic; -using NUnit.Framework; +using Xunit; public class BowlingTest { - [Test] + [Fact] public void Should_be_able_to_score_a_game_with_all_zeros() { var rolls = new[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; var game = RollMany(rolls, new BowlingGame()); - Assert.That(game.Score(), Is.EqualTo(0)); + Assert.Equal(0, game.Score()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Should_be_able_to_score_a_game_with_no_strikes_or_spares() { var rolls = new[] { 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6 }; var game = RollMany(rolls, new BowlingGame()); - Assert.That(game.Score(), Is.EqualTo(90)); + Assert.Equal(90, game.Score()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void A_spare_followed_by_zeros_is_worth_ten_points() { var rolls = new[] { 6, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; var game = RollMany(rolls, new BowlingGame()); - Assert.That(game.Score(), Is.EqualTo(10)); + Assert.Equal(10, game.Score()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Points_scored_in_the_roll_after_a_spare_are_counted_twice() { var rolls = new[] { 6, 4, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; var game = RollMany(rolls, new BowlingGame()); - Assert.That(game.Score(), Is.EqualTo(16)); + Assert.Equal(16, game.Score()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Consecutive_spares_each_get_a_one_roll_bonus() { var rolls = new[] { 5, 5, 3, 7, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; var game = RollMany(rolls, new BowlingGame()); - Assert.That(game.Score(), Is.EqualTo(31)); + Assert.Equal(31, game.Score()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void A_spare_in_the_last_frame_gets_a_one_roll_bonus_that_is_counted_once() { var rolls = new[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 3, 7 }; var game = RollMany(rolls, new BowlingGame()); - Assert.That(game.Score(), Is.EqualTo(17)); + Assert.Equal(17, game.Score()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void A_strike_earns_ten_points_in_frame_with_a_single_roll() { var rolls = new[] { 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; var game = RollMany(rolls, new BowlingGame()); - Assert.That(game.Score(), Is.EqualTo(10)); + Assert.Equal(10, game.Score()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Points_scored_in_the_two_rolls_after_a_strike_are_counted_twice_as_a_bonus() { var rolls = new[] { 10, 5, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; var game = RollMany(rolls, new BowlingGame()); - Assert.That(game.Score(), Is.EqualTo(26)); + Assert.Equal(26, game.Score()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Consecutive_strikes_each_get_the_two_roll_bonus() { var rolls = new[] { 10, 10, 10, 5, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; var game = RollMany(rolls, new BowlingGame()); - Assert.That(game.Score(), Is.EqualTo(81)); + Assert.Equal(81, game.Score()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void A_strike_in_the_last_frame_gets_a_two_roll_bonus_that_is_counted_once() { var rolls = new[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 7, 1 }; var game = RollMany(rolls, new BowlingGame()); - Assert.That(game.Score(), Is.EqualTo(18)); + Assert.Equal(18, game.Score()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Rolling_a_spare_with_the_two_roll_bonus_does_not_get_a_bonus_roll() { var rolls = new[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 7, 3 }; var game = RollMany(rolls, new BowlingGame()); - Assert.That(game.Score(), Is.EqualTo(20)); + Assert.Equal(20, game.Score()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Strikes_with_the_two_roll_bonus_do_not_get_bonus_rolls() { var rolls = new[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10 }; var game = RollMany(rolls, new BowlingGame()); - Assert.That(game.Score(), Is.EqualTo(30)); + Assert.Equal(30, game.Score()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void A_strike_with_the_one_roll_bonus_after_a_spare_in_the_last_frame_does_not_get_a_bonus() { var rolls = new[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 3, 10 }; var game = RollMany(rolls, new BowlingGame()); - Assert.That(game.Score(), Is.EqualTo(20)); + Assert.Equal(20, game.Score()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void All_strikes_is_a_perfect_game() { var rolls = new[] { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 }; var game = RollMany(rolls, new BowlingGame()); - Assert.That(game.Score(), Is.EqualTo(300)); + Assert.Equal(300, game.Score()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Rolls_can_not_score_negative_points() { var rolls = new[] { -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; var game = RollMany(rolls, new BowlingGame()); - Assert.That(game.Score(), Is.Null); + Assert.Null(game.Score()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void A_roll_can_not_score_more_than_10_points() { var rolls = new[] { 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; var game = RollMany(rolls, new BowlingGame()); - Assert.That(game.Score(), Is.Null); + Assert.Null(game.Score()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Two_rolls_in_a_frame_can_not_score_more_than_10_points() { var rolls = new[] { 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; var game = RollMany(rolls, new BowlingGame()); - Assert.That(game.Score(), Is.Null); + Assert.Null(game.Score()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Two_bonus_rolls_after_a_strike_in_the_last_frame_can_not_score_more_than_10_points() { var rolls = new[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 5, 6 }; var game = RollMany(rolls, new BowlingGame()); - Assert.That(game.Score(), Is.Null); + Assert.Null(game.Score()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void An_unstarted_game_can_not_be_scored() { var rolls = new int[0]; var game = RollMany(rolls, new BowlingGame()); - Assert.That(game.Score(), Is.Null); + Assert.Null(game.Score()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void An_incomplete_game_can_not_be_scored() { var rolls = new[] { 0, 0 }; var game = RollMany(rolls, new BowlingGame()); - Assert.That(game.Score(), Is.Null); + Assert.Null(game.Score()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void A_game_with_more_than_ten_frames_can_not_be_scored() { var rolls = new[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; var game = RollMany(rolls, new BowlingGame()); - Assert.That(game.Score(), Is.Null); + Assert.Null(game.Score()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Bonus_rolls_for_a_strike_in_the_last_frame_must_be_rolled_before_score_can_be_calculated() { var rolls = new[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10 }; var game = RollMany(rolls, new BowlingGame()); - Assert.That(game.Score(), Is.Null); + Assert.Null(game.Score()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Both_bonus_rolls_for_a_strike_in_the_last_frame_must_be_rolled_before_score_can_be_calculated() { var rolls = new[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10 }; var game = RollMany(rolls, new BowlingGame()); - Assert.That(game.Score(), Is.Null); + Assert.Null(game.Score()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Bonus_roll_for_a_spare_in_the_last_frame_must_be_rolled_before_score_can_be_calculated() { var rolls = new[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 3 }; var game = RollMany(rolls, new BowlingGame()); - Assert.That(game.Score(), Is.Null); + Assert.Null(game.Score()); } private static BowlingGame RollMany(IEnumerable rolls, BowlingGame game) diff --git a/exercises/bracket-push/BracketPush.cs b/exercises/bracket-push/BracketPush.cs new file mode 100644 index 0000000000..68bf2a9061 --- /dev/null +++ b/exercises/bracket-push/BracketPush.cs @@ -0,0 +1,9 @@ +using System; + +public static class BracketPush +{ + public static bool Matched(string input) + { + throw new NotImplementedException("You need to implement this function."); + } +} diff --git a/exercises/bracket-push/BracketPush.csproj b/exercises/bracket-push/BracketPush.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/bracket-push/BracketPush.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/bracket-push/BracketPushTest.cs b/exercises/bracket-push/BracketPushTest.cs index a91f9bdd09..79cf4d3c67 100644 --- a/exercises/bracket-push/BracketPushTest.cs +++ b/exercises/bracket-push/BracketPushTest.cs @@ -1,99 +1,88 @@ -using NUnit.Framework; +using Xunit; public class BracketPushTest { - [Test] + [Fact] public void Paired_square_brackets() { const string actual = "[]"; - Assert.That(BracketPush.Matched(actual), Is.True); + Assert.True(BracketPush.Matched(actual)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Empty_string() { const string actual = ""; - Assert.That(BracketPush.Matched(actual), Is.True); + Assert.True(BracketPush.Matched(actual)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Unpaired_brackets() { const string actual = "[["; - Assert.That(BracketPush.Matched(actual), Is.False); + Assert.False(BracketPush.Matched(actual)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Wrong_ordered_brackets() { const string actual = "}{"; - Assert.That(BracketPush.Matched(actual), Is.False); + Assert.False(BracketPush.Matched(actual)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Paired_with_whitespace() { const string actual = "{ }"; - Assert.That(BracketPush.Matched(actual), Is.True); + Assert.True(BracketPush.Matched(actual)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Simple_nested_brackets() { const string actual = "{[]}"; - Assert.That(BracketPush.Matched(actual), Is.True); + Assert.True(BracketPush.Matched(actual)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Several_paired_brackets() { const string actual = "{}[]"; - Assert.That(BracketPush.Matched(actual), Is.True); + Assert.True(BracketPush.Matched(actual)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Paired_and_nested_brackets() { const string actual = "([{}({}[])])"; - Assert.That(BracketPush.Matched(actual), Is.True); + Assert.True(BracketPush.Matched(actual)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Unpaired_and_nested_brackets() { const string actual = "([{])"; - Assert.That(BracketPush.Matched(actual), Is.False); + Assert.False(BracketPush.Matched(actual)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Paired_and_wrong_nested_brackets() { const string actual = "[({]})"; - Assert.That(BracketPush.Matched(actual), Is.False); + Assert.False(BracketPush.Matched(actual)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Math_expression() { const string actual = "(((185 + 223.85) * 15) - 543)/2"; - Assert.That(BracketPush.Matched(actual), Is.True); + Assert.True(BracketPush.Matched(actual)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Complex_latex_expression() { const string actual = "\\left(\\begin{array}{cc} \\frac{1}{3} & x\\\\ \\mathrm{e}^{x} &... x^2 \\end{array}\\right)"; - Assert.That(BracketPush.Matched(actual), Is.True); + Assert.True(BracketPush.Matched(actual)); } } \ No newline at end of file diff --git a/exercises/change/Change.cs b/exercises/change/Change.cs new file mode 100644 index 0000000000..561ccde428 --- /dev/null +++ b/exercises/change/Change.cs @@ -0,0 +1,9 @@ +using System; + +public static class Change +{ + public static int[] Calculate(int target, int[] coins) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/change/Change.csproj b/exercises/change/Change.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/change/Change.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/change/ChangeTest.cs b/exercises/change/ChangeTest.cs index d34a4086be..b7808ce2ad 100644 --- a/exercises/change/ChangeTest.cs +++ b/exercises/change/ChangeTest.cs @@ -1,69 +1,63 @@ using System; -using NUnit.Framework; +using Xunit; public class ChangeTest { - [Test] + [Fact] public void Single_coin_change() { var actual = new[] { 1, 5, 10, 25, 100 }; var target = 25; var expected = new[] { 25 }; - Assert.That(Change.Calculate(target, actual), Is.EqualTo(expected)); + Assert.Equal(expected, Change.Calculate(target, actual)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Multiple_coin_change() { var actual = new[] { 1, 5, 10, 25, 100 }; var target = 15; var expected = new[] { 5, 10 }; - Assert.That(Change.Calculate(target, actual), Is.EqualTo(expected)); + Assert.Equal(expected, Change.Calculate(target, actual)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Change_with_Lilliputian_Coins() { var actual = new[] { 1, 4, 15, 20, 50 }; var target = 23; var expected = new[] { 4, 4, 15 }; - Assert.That(Change.Calculate(target, actual), Is.EqualTo(expected)); + Assert.Equal(expected, Change.Calculate(target, actual)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Change_with_Lower_Elbonia_Coins() { var actual = new[] { 1, 5, 10, 21, 25 }; var target = 63; var expected = new[] { 21, 21, 21 }; - Assert.That(Change.Calculate(target, actual), Is.EqualTo(expected)); + Assert.Equal(expected, Change.Calculate(target, actual)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Large_target_values() { var actual = new[] { 1, 2, 5, 10, 20, 50, 100 }; var target = 999; var expected = new[] { 2, 2, 5, 20, 20, 50, 100, 100, 100, 100, 100, 100, 100, 100, 100 }; - Assert.That(Change.Calculate(target, actual), Is.EqualTo(expected)); + Assert.Equal(expected, Change.Calculate(target, actual)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void No_coins_make_0_change() { var actual = new[] { 1, 5, 10, 21, 25 }; var target = 0; var expected = new int[0]; - Assert.That(Change.Calculate(target, actual), Is.EqualTo(expected)); + Assert.Equal(expected, Change.Calculate(target, actual)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Error_testing_for_change_smaller_than_the_smallest_of_coins() { var actual = new[] { 5, 10 }; @@ -71,8 +65,7 @@ public void Error_testing_for_change_smaller_than_the_smallest_of_coins() Assert.Throws(() => Change.Calculate(target, actual)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Cannot_find_negative_change_values() { var actual = new[] { 1, 2, 5 }; diff --git a/exercises/circular-buffer/CircularBuffer.cs b/exercises/circular-buffer/CircularBuffer.cs new file mode 100644 index 0000000000..0dec0a8442 --- /dev/null +++ b/exercises/circular-buffer/CircularBuffer.cs @@ -0,0 +1,29 @@ +using System; + +public class CircularBuffer +{ + public CircularBuffer(int size) + { + throw new NotImplementedException("You need to implement this function."); + } + + public T Read() + { + throw new NotImplementedException("You need to implement this function."); + } + + public void Write(T value) + { + throw new NotImplementedException("You need to implement this function."); + } + + public void ForceWrite(T value) + { + throw new NotImplementedException("You need to implement this function."); + } + + public void Clear() + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/circular-buffer/CircularBuffer.csproj b/exercises/circular-buffer/CircularBuffer.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/circular-buffer/CircularBuffer.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/circular-buffer/CircularBufferTest.cs b/exercises/circular-buffer/CircularBufferTest.cs index 768f33bcb0..4131bdeff2 100644 --- a/exercises/circular-buffer/CircularBufferTest.cs +++ b/exercises/circular-buffer/CircularBufferTest.cs @@ -1,20 +1,20 @@ -using NUnit.Framework; +using System; +using Xunit; public class CircularBufferTest { - [Test] + [Fact] public void Write_and_read_back_one_item() { var buffer = new CircularBuffer(1); buffer.Write('1'); var val = buffer.Read(); - Assert.That(val, Is.EqualTo('1')); - Assert.That(() => buffer.Read(), Throws.Exception); + Assert.Equal('1', val); + Assert.Throws(() => buffer.Read()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Write_and_read_back_multiple_items() { var buffer = new CircularBuffer(2); @@ -24,13 +24,12 @@ public void Write_and_read_back_multiple_items() var val1 = buffer.Read(); var val2 = buffer.Read(); - Assert.That(val1, Is.EqualTo('1')); - Assert.That(val2, Is.EqualTo('2')); - Assert.That(() => buffer.Read(), Throws.Exception); + Assert.Equal('1', val1); + Assert.Equal('2', val2); + Assert.Throws(() => buffer.Read()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Clearing_buffer() { var buffer = new CircularBuffer(3); @@ -40,7 +39,7 @@ public void Clearing_buffer() buffer.Clear(); - Assert.That(() => buffer.Read(), Throws.Exception); + Assert.Throws(() => buffer.Read()); buffer.Write('1'); buffer.Write('2'); @@ -49,12 +48,11 @@ public void Clearing_buffer() buffer.Write('3'); var val2 = buffer.Read(); - Assert.That(val1, Is.EqualTo('1')); - Assert.That(val2, Is.EqualTo('2')); + Assert.Equal('1', val1); + Assert.Equal('2', val2); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Alternate_write_and_read() { var buffer = new CircularBuffer(2); @@ -63,12 +61,11 @@ public void Alternate_write_and_read() buffer.Write('2'); var val2 = buffer.Read(); - Assert.That(val1, Is.EqualTo('1')); - Assert.That(val2, Is.EqualTo('2')); + Assert.Equal('1', val1); + Assert.Equal('2', val2); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Reads_back_oldest_item() { var buffer1 = new CircularBuffer(3); @@ -79,23 +76,21 @@ public void Reads_back_oldest_item() buffer1.Write('3'); var val2 = buffer1.Read(); var val3 = buffer1.Read(); - Assert.That(val2, Is.EqualTo('2')); - Assert.That(val3, Is.EqualTo('3')); + Assert.Equal('2', val2); + Assert.Equal('3', val3); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Writing_to_a_full_buffer_throws_an_exception() { var buffer = new CircularBuffer(2); buffer.Write('1'); buffer.Write('2'); - Assert.That(() => buffer.Write('A'), Throws.Exception); + Assert.Throws(() => buffer.Write('A')); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Overwriting_oldest_item_in_a_full_buffer() { var buffer = new CircularBuffer(2); @@ -106,13 +101,12 @@ public void Overwriting_oldest_item_in_a_full_buffer() var val1 = buffer.Read(); var val2 = buffer.Read(); - Assert.That(val1, Is.EqualTo('2')); - Assert.That(val2, Is.EqualTo('A')); - Assert.That(() => buffer.Read(), Throws.Exception); + Assert.Equal('2', val1); + Assert.Equal('A', val2); + Assert.Throws(() => buffer.Read()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Forced_writes_to_non_full_buffer_should_behave_like_writes() { var buffer = new CircularBuffer(2); @@ -122,13 +116,12 @@ public void Forced_writes_to_non_full_buffer_should_behave_like_writes() var val1 = buffer.Read(); var val2 = buffer.Read(); - Assert.That(val1, Is.EqualTo('1')); - Assert.That(val2, Is.EqualTo('2')); - Assert.That(() => buffer.Read(), Throws.Exception); + Assert.Equal('1', val1); + Assert.Equal('2', val2); + Assert.Throws(() => buffer.Read()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Alternate_read_and_write_into_buffer_overflow() { var buffer = new CircularBuffer(5); @@ -155,11 +148,11 @@ public void Alternate_read_and_write_into_buffer_overflow() var val7 = buffer.Read(); var val8 = buffer.Read(); - Assert.That(val4, Is.EqualTo('6')); - Assert.That(val5, Is.EqualTo('7')); - Assert.That(val6, Is.EqualTo('8')); - Assert.That(val7, Is.EqualTo('A')); - Assert.That(val8, Is.EqualTo('B')); - Assert.That(() => buffer.Read(), Throws.Exception); + Assert.Equal('6', val4); + Assert.Equal('7', val5); + Assert.Equal('8', val6); + Assert.Equal('A', val7); + Assert.Equal('B', val8); + Assert.Throws(() => buffer.Read()); } } \ No newline at end of file diff --git a/exercises/clock/Clock.cs b/exercises/clock/Clock.cs new file mode 100644 index 0000000000..f285c1b5f0 --- /dev/null +++ b/exercises/clock/Clock.cs @@ -0,0 +1,24 @@ +using System; + +public class Clock +{ + public Clock(int hours) + { + throw new NotImplementedException("You need to implement this function."); + } + + public Clock(int hours, int minutes) + { + throw new NotImplementedException("You need to implement this function."); + } + + public Clock Add(int minutesToAdd) + { + throw new NotImplementedException("You need to implement this function."); + } + + public Clock Subtract(int minutesToSubtract) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/clock/Clock.csproj b/exercises/clock/Clock.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/clock/Clock.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/clock/ClockTest.cs b/exercises/clock/ClockTest.cs index e5e4a9e9f4..634d880233 100644 --- a/exercises/clock/ClockTest.cs +++ b/exercises/clock/ClockTest.cs @@ -1,127 +1,114 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class ClockTest { - [TestCase(8, "08:00")] - [TestCase(9, "09:00")] + [Theory] + [InlineData(8, "08:00")] + [InlineData(9, "09:00")] public void Prints_the_hour(int hours, string expected) { - Assert.That(new Clock(hours).ToString(), Is.EqualTo(expected)); + Assert.Equal(expected, new Clock(hours).ToString()); } - [Ignore("Remove to run test")] - [TestCase(11, 9, "11:09")] - [TestCase(11, 19, "11:19")] + [Theory(Skip = "Remove to run test")] + [InlineData(11, 9, "11:09")] + [InlineData(11, 19, "11:19")] public void Prints_past_the_hour(int hours, int minutes, string expected) { - Assert.That(new Clock(hours, minutes).ToString(), Is.EqualTo(expected)); + Assert.Equal(expected, new Clock(hours, minutes).ToString()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_add_minutes() { var clock = new Clock(10).Add(3); - Assert.That(clock.ToString(), Is.EqualTo("10:03")); + Assert.Equal("10:03", clock.ToString()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_add_over_an_hour() { var clock = new Clock(10).Add(63); - Assert.That(clock.ToString(), Is.EqualTo("11:03")); + Assert.Equal("11:03", clock.ToString()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_add_over_more_than_one_day() { var clock = new Clock(10).Add(7224); - Assert.That(clock.ToString(), Is.EqualTo("10:24")); + Assert.Equal("10:24", clock.ToString()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_subtract_minutes() { var clock = new Clock(10, 3).Subtract(3); - Assert.That(clock.ToString(), Is.EqualTo("10:00")); + Assert.Equal("10:00", clock.ToString()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_subtract_to_previous_hour() { var clock = new Clock(10, 3).Subtract(30); - Assert.That(clock.ToString(), Is.EqualTo("09:33")); + Assert.Equal("09:33", clock.ToString()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_subtract_over_an_hour() { var clock = new Clock(10, 3).Subtract(70); - Assert.That(clock.ToString(), Is.EqualTo("08:53")); + Assert.Equal("08:53", clock.ToString()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Wraps_around_midnight() { var clock = new Clock(23, 59).Add(2); - Assert.That(clock.ToString(), Is.EqualTo("00:01")); + Assert.Equal("00:01", clock.ToString()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Wraps_around_midnight_backwards() { var clock = new Clock(0, 1).Subtract(2); - Assert.That(clock.ToString(), Is.EqualTo("23:59")); + Assert.Equal("23:59", clock.ToString()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Midnight_is_zero_hundred_hours() { var clock = new Clock(24); - Assert.That(clock.ToString(), Is.EqualTo("00:00")); + Assert.Equal("00:00", clock.ToString()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Sixty_minutes_is_next_hour() { var clock = new Clock(1, 60); - Assert.That(clock.ToString(), Is.EqualTo("02:00")); + Assert.Equal("02:00", clock.ToString()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Clocks_with_same_time_are_equal() { var clock1 = new Clock(14, 30); var clock2 = new Clock(14, 30); - Assert.That(clock1, Is.EqualTo(clock2)); + Assert.Equal(clock2, clock1); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Clocks_with_different_time_are_not_equal() { var clock1 = new Clock(15, 30); var clock2 = new Clock(14, 30); - Assert.That(clock1, Is.Not.EqualTo(clock2)); + Assert.NotEqual(clock2, clock1); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Overflown_clocks_with_same_time_are_equal() { var clock1 = new Clock(14, 30); var clock2 = new Clock(38, 30); - Assert.That(clock1, Is.EqualTo(clock2)); + Assert.Equal(clock2, clock1); } } \ No newline at end of file diff --git a/exercises/connect/Connect.cs b/exercises/connect/Connect.cs new file mode 100644 index 0000000000..a15ccaf69c --- /dev/null +++ b/exercises/connect/Connect.cs @@ -0,0 +1,21 @@ +using System; + +public enum ConnectWinner +{ + White, + Black, + None +} + +public class Connect +{ + public Connect(string input) + { + throw new NotImplementedException("You need to implement this function."); + } + + public ConnectWinner Result() + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/connect/Connect.csproj b/exercises/connect/Connect.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/connect/Connect.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/connect/ConnectTest.cs b/exercises/connect/ConnectTest.cs index 701720ed8c..b75b131f6c 100644 --- a/exercises/connect/ConnectTest.cs +++ b/exercises/connect/ConnectTest.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using Xunit; using System.Linq; public class ConnectTest @@ -8,7 +8,7 @@ private static string MakeBoard(string[] board) return string.Join("\n", board.Select(x => x.Replace(" ", ""))); } - [Test] + [Fact] public void Empty_board_has_no_winner() { var lines = new[] @@ -20,29 +20,26 @@ public void Empty_board_has_no_winner() " . . . . ." }; var board = new Connect(MakeBoard(lines)); - Assert.That(board.Result(), Is.EqualTo(Connect.Winner.None)); + Assert.Equal(ConnectWinner.None, board.Result()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One_by_one_board_with_black_stone() { var lines = new[] { "X" }; var board = new Connect(MakeBoard(lines)); - Assert.That(board.Result(), Is.EqualTo(Connect.Winner.Black)); + Assert.Equal(ConnectWinner.Black, board.Result()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One_by_one_board_with_white_stone() { var lines = new[] { "O" }; var board = new Connect(MakeBoard(lines)); - Assert.That(board.Result(), Is.EqualTo(Connect.Winner.White)); + Assert.Equal(ConnectWinner.White, board.Result()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Convoluted_path() { var lines = new[] @@ -54,11 +51,10 @@ public void Convoluted_path() " O O O O O" }; var board = new Connect(MakeBoard(lines)); - Assert.That(board.Result(), Is.EqualTo(Connect.Winner.Black)); + Assert.Equal(ConnectWinner.Black, board.Result()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Rectangle_black_wins() { var lines = new[] @@ -70,11 +66,10 @@ public void Rectangle_black_wins() " . O X ." }; var board = new Connect(MakeBoard(lines)); - Assert.That(board.Result(), Is.EqualTo(Connect.Winner.Black)); + Assert.Equal(ConnectWinner.Black, board.Result()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Rectangle_white_wins() { var lines = new[] @@ -86,11 +81,10 @@ public void Rectangle_white_wins() " . O X ." }; var board = new Connect(MakeBoard(lines)); - Assert.That(board.Result(), Is.EqualTo(Connect.Winner.White)); + Assert.Equal(ConnectWinner.White, board.Result()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Spiral_black_wins() { var lines = new[] @@ -106,11 +100,10 @@ public void Spiral_black_wins() "XXXXXXXXO" }; var board = new Connect(MakeBoard(lines)); - Assert.That(board.Result(), Is.EqualTo(Connect.Winner.Black)); + Assert.Equal(ConnectWinner.Black, board.Result()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Spiral_nobody_wins() { var lines = new[] @@ -126,6 +119,6 @@ public void Spiral_nobody_wins() "XXXXXXXXO" }; var board = new Connect(MakeBoard(lines)); - Assert.That(board.Result(), Is.EqualTo(Connect.Winner.None)); + Assert.Equal(ConnectWinner.None, board.Result()); } } \ No newline at end of file diff --git a/exercises/connect/Example.cs b/exercises/connect/Example.cs index deeb71c350..aecd5c257e 100644 --- a/exercises/connect/Example.cs +++ b/exercises/connect/Example.cs @@ -1,18 +1,17 @@ using System; using System.Collections.Generic; -using System.Drawing; using System.Linq; -public class Connect +public enum ConnectWinner { - public enum Winner - { - White, - Black, - None - } + White, + Black, + None +} - public enum Cell +public class Connect +{ + private enum Cell { Empty, White, @@ -48,31 +47,31 @@ private static Cell[][] ParseBoard(string input) private int Cols => board[0].Length; private int Rows => board.Length; - private bool IsValidCoordinate(Point coordinate) => - coordinate.Y >= 0 && coordinate.Y < Rows && - coordinate.X >= 0 && coordinate.X < Cols; + private bool IsValidCoordinate(Tuple coordinate) => + coordinate.Item2 >= 0 && coordinate.Item2 < Rows && + coordinate.Item1 >= 0 && coordinate.Item1 < Cols; - private bool CellAtCoordinateEquals(Cell cell, Point coordinate) => board[coordinate.Y][coordinate.X] == cell; + private bool CellAtCoordinateEquals(Cell cell, Tuple coordinate) => board[coordinate.Item2][coordinate.Item1] == cell; - private HashSet Adjacent(Cell cell, Point coordinate) + private HashSet> Adjacent(Cell cell, Tuple coordinate) { - var row = coordinate.Y; - var col = coordinate.X; + var row = coordinate.Item2; + var col = coordinate.Item1; var coords = new[] { - new Point(col + 1, row - 1), - new Point(col, row - 1), - new Point(col - 1, row ), - new Point(col + 1, row ), - new Point(col - 1, row + 1), - new Point(col, row + 1) + new Tuple(col + 1, row - 1), + new Tuple(col, row - 1), + new Tuple(col - 1, row ), + new Tuple(col + 1, row ), + new Tuple(col - 1, row + 1), + new Tuple(col, row + 1) }; - return new HashSet(coords.Where(coord => IsValidCoordinate(coord) && CellAtCoordinateEquals(cell, coord))); + return new HashSet>(coords.Where(coord => IsValidCoordinate(coord) && CellAtCoordinateEquals(cell, coord))); } - private bool ValidPath(Cell cell, Func stop, HashSet processed, Point coordinate) + private bool ValidPath(Cell cell, Func, bool> stop, HashSet> processed, Tuple coordinate) { if (stop(board, coordinate)) return true; @@ -84,38 +83,38 @@ private bool ValidPath(Cell cell, Func stop, HashSet { - var updatedProcessed = new HashSet(processed); + var updatedProcessed = new HashSet>(processed); updatedProcessed.Add(nextCoord); return ValidPath(cell, stop, updatedProcessed, nextCoord); }); } - private bool IsWhiteStop(Cell[][] board, Point coordinate) => coordinate.Y == Rows - 1; - private bool IsBlackStop(Cell[][] board, Point coordinate) => coordinate.X == Cols - 1; + private bool IsWhiteStop(Cell[][] board, Tuple coordinate) => coordinate.Item2 == Rows - 1; + private bool IsBlackStop(Cell[][] board, Tuple coordinate) => coordinate.Item1 == Cols - 1; - private HashSet WhiteStart() => - new HashSet(Enumerable.Range(0, Cols).Select(col => new Point(col, 0)).Where(coord => CellAtCoordinateEquals(Cell.White, coord))); + private HashSet> WhiteStart() => + new HashSet>(Enumerable.Range(0, Cols).Select(col => new Tuple(col, 0)).Where(coord => CellAtCoordinateEquals(Cell.White, coord))); - private HashSet BlackStart() => - new HashSet(Enumerable.Range(0, Rows).Select(row => new Point(0, row)).Where(coord => CellAtCoordinateEquals(Cell.Black, coord))); + private HashSet> BlackStart() => + new HashSet>(Enumerable.Range(0, Rows).Select(row => new Tuple(0, row)).Where(coord => CellAtCoordinateEquals(Cell.Black, coord))); - private bool ColorWins(Cell cell, Func stop, Func> start) + private bool ColorWins(Cell cell, Func, bool> stop, Func>> start) { - return start().Any(coordinate => ValidPath(cell, stop, new HashSet(), coordinate)); + return start().Any(coordinate => ValidPath(cell, stop, new HashSet>(), coordinate)); } private bool WhiteWins() => ColorWins(Cell.White, IsWhiteStop, WhiteStart); private bool BlackWins() => ColorWins(Cell.Black, IsBlackStop, BlackStart); - public Winner Result() + public ConnectWinner Result() { if (WhiteWins()) - return Winner.White; + return ConnectWinner.White; if (BlackWins()) - return Winner.Black; + return ConnectWinner.Black; - return Winner.None; + return ConnectWinner.None; } } \ No newline at end of file diff --git a/exercises/crypto-square/CryptoSquare.cs b/exercises/crypto-square/CryptoSquare.cs new file mode 100644 index 0000000000..704605e37e --- /dev/null +++ b/exercises/crypto-square/CryptoSquare.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; + +public class Crypto +{ + public Crypto(string input) + { + throw new NotImplementedException("You need to implement this function."); + } + + public int Size + { + get + { + throw new NotImplementedException("Please implement this function"); + } + } + + public string NormalizePlaintext + { + get + { + throw new NotImplementedException("Please implement this function"); + } + } + + public string NormalizeCiphertext() + { + throw new NotImplementedException("Please implement this function"); + } + + public string Ciphertext() + { + throw new NotImplementedException("Please implement this function"); + } + + public IEnumerable PlaintextSegments() + { + throw new NotImplementedException("Please implement this function"); + } +} \ No newline at end of file diff --git a/exercises/crypto-square/CryptoSquare.csproj b/exercises/crypto-square/CryptoSquare.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/crypto-square/CryptoSquare.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/crypto-square/CryptoSquareTest.cs b/exercises/crypto-square/CryptoSquareTest.cs index 5348ff0337..6db077fdb7 100644 --- a/exercises/crypto-square/CryptoSquareTest.cs +++ b/exercises/crypto-square/CryptoSquareTest.cs @@ -1,132 +1,116 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class CryptoSquareTest { - [Test] + [Fact] public void Strange_characters_are_stripped_during_normalization() { var crypto = new Crypto("s#$%^&plunk"); - Assert.That(crypto.NormalizePlaintext, Is.EqualTo("splunk")); + Assert.Equal("splunk", crypto.NormalizePlaintext); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Letters_are_lowercased_during_normalization() { var crypto = new Crypto("WHOA HEY!"); - Assert.That(crypto.NormalizePlaintext, Is.EqualTo("whoahey")); + Assert.Equal("whoahey", crypto.NormalizePlaintext); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Numbers_are_kept_during_normalization() { var crypto = new Crypto("1, 2, 3, GO!"); - Assert.That(crypto.NormalizePlaintext, Is.EqualTo("123go")); + Assert.Equal("123go", crypto.NormalizePlaintext); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Smallest_square_size_is_2() { var crypto = new Crypto("1234"); - Assert.That(crypto.Size, Is.EqualTo(2)); + Assert.Equal(2, crypto.Size); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Size_of_text_whose_length_is_a_perfect_square_is_its_square_root() { var crypto = new Crypto("123456789"); - Assert.That(crypto.Size, Is.EqualTo(3)); + Assert.Equal(3, crypto.Size); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Size_of_text_whose_length_is_not_a_perfect_square_is_next_biggest_square_root() { var crypto = new Crypto("123456789abc"); - Assert.That(crypto.Size, Is.EqualTo(4)); + Assert.Equal(4, crypto.Size); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Size_is_determined_by_normalized_text() { var crypto = new Crypto("Oh hey, this is nuts!"); - Assert.That(crypto.Size, Is.EqualTo(4)); + Assert.Equal(4, crypto.Size); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Segments_are_split_by_square_size() { var crypto = new Crypto("Never vex thine heart with idle woes"); - Assert.That(crypto.PlaintextSegments(), Is.EqualTo(new[] { "neverv", "exthin", "eheart", "withid", "lewoes" })); + Assert.Equal(new[] { "neverv", "exthin", "eheart", "withid", "lewoes" }, crypto.PlaintextSegments()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Segments_are_split_by_square_size_until_text_runs_out() { var crypto = new Crypto("ZOMG! ZOMBIES!!!"); - Assert.That(crypto.PlaintextSegments(), Is.EqualTo(new[] { "zomg", "zomb", "ies" })); + Assert.Equal(new[] { "zomg", "zomb", "ies" }, crypto.PlaintextSegments()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Ciphertext_combines_text_by_column() { var crypto = new Crypto("First, solve the problem. Then, write the code."); - Assert.That(crypto.Ciphertext(), Is.EqualTo("foeewhilpmrervrticseohtottbeedshlnte")); + Assert.Equal("foeewhilpmrervrticseohtottbeedshlnte", crypto.Ciphertext()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Ciphertext_skips_cells_with_no_text() { var crypto = new Crypto("Time is an illusion. Lunchtime doubly so."); - Assert.That(crypto.Ciphertext(), Is.EqualTo("tasneyinicdsmiohooelntuillibsuuml")); + Assert.Equal("tasneyinicdsmiohooelntuillibsuuml", crypto.Ciphertext()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Normalized_ciphertext_is_split_by_height_of_square() { var crypto = new Crypto("Vampires are people too!"); - Assert.That(crypto.NormalizeCiphertext(), Is.EqualTo("vrel aepe mset paoo irpo")); + Assert.Equal("vrel aepe mset paoo irpo", crypto.NormalizeCiphertext()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Normalized_ciphertext_not_exactly_divisible_by_5_spills_into_a_smaller_segment() { var crypto = new Crypto("Madness, and then illumination."); - Assert.That(crypto.NormalizeCiphertext(), Is.EqualTo("msemo aanin dnin ndla etlt shui")); + Assert.Equal("msemo aanin dnin ndla etlt shui", crypto.NormalizeCiphertext()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Normalized_ciphertext_is_split_into_segements_of_correct_size() { var crypto = new Crypto("If man was meant to stay on the ground god would have given us roots"); - Assert.That(crypto.NormalizeCiphertext(), Is.EqualTo("imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau")); + Assert.Equal("imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau", crypto.NormalizeCiphertext()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Normalized_ciphertext_is_split_into_segements_of_correct_size_with_punctuation() { var crypto = new Crypto("Have a nice day. Feed the dog & chill out!"); - Assert.That(crypto.NormalizeCiphertext(), Is.EqualTo("hifei acedl veeol eddgo aatcu nyhht")); + Assert.Equal("hifei acedl veeol eddgo aatcu nyhht", crypto.NormalizeCiphertext()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Normalized_ciphertext_is_split_into_segements_of_correct_size_when_just_less_than_full_square() { var crypto = new Crypto("I am"); - Assert.That(crypto.NormalizeCiphertext(), Is.EqualTo("im a")); + Assert.Equal("im a", crypto.NormalizeCiphertext()); } } \ No newline at end of file diff --git a/exercises/custom-set/CustomSet.cs b/exercises/custom-set/CustomSet.cs new file mode 100644 index 0000000000..0b507e0227 --- /dev/null +++ b/exercises/custom-set/CustomSet.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections; +using System.Collections.Generic; + +public class CustomSet : IEnumerable, IEquatable> +{ + public CustomSet() + { + } + + public CustomSet(T value) + { + } + + public CustomSet(IEnumerable values) + { + } + + public CustomSet Insert(T value) + { + throw new NotImplementedException("You need to implement this function."); + } + + public bool IsEmpty() + { + throw new NotImplementedException("You need to implement this function."); + } + + public bool Contains(T value) + { + throw new NotImplementedException("You need to implement this function."); + } + + public bool IsSubsetOf(CustomSet right) + { + throw new NotImplementedException("You need to implement this function."); + } + + public bool IsDisjointFrom(CustomSet right) + { + throw new NotImplementedException("You need to implement this function."); + } + + public CustomSet Intersection(CustomSet right) + { + throw new NotImplementedException("You need to implement this function."); + } + + public CustomSet Difference(CustomSet right) + { + throw new NotImplementedException("You need to implement this function."); + } + + public CustomSet Union(CustomSet right) + { + throw new NotImplementedException("You need to implement this function."); + } + + public IEnumerator GetEnumerator() + { + throw new NotImplementedException("You need to implement this function."); + } + + IEnumerator IEnumerable.GetEnumerator() + { + throw new NotImplementedException("You need to implement this function."); + } + + public override bool Equals(object obj) + { + throw new NotImplementedException("You need to implement this function."); + } + + public override int GetHashCode() + { + throw new NotImplementedException(); + } + + public bool Equals(IEnumerable other) + { + throw new NotImplementedException("You need to implement this function."); + } + + public int GetHashCode(IEnumerable obj) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/exercises/custom-set/CustomSet.csproj b/exercises/custom-set/CustomSet.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/custom-set/CustomSet.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/custom-set/CustomSetTest.cs b/exercises/custom-set/CustomSetTest.cs index 67091b5c62..f30fb22d59 100644 --- a/exercises/custom-set/CustomSetTest.cs +++ b/exercises/custom-set/CustomSetTest.cs @@ -1,348 +1,312 @@ -using NUnit.Framework; +using Xunit; public class CustomSetTest { - [Test] + [Fact] public void Sets_with_no_elements_are_empty() { var actual = new CustomSet(); - Assert.That(actual.IsEmpty(), Is.True); + Assert.True(actual.IsEmpty()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Sets_with_elements_are_not_empty() { var actual = new CustomSet(1); - Assert.That(actual.IsEmpty(), Is.False); + Assert.False(actual.IsEmpty()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Nothing_is_contained_in_an_empty_set() { var actual = new CustomSet(); - Assert.That(actual.Contains(1), Is.False); + Assert.False(actual.Contains(1)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Detect_if_the_element_is_in_the_set() { var actual = new CustomSet(new[] { 1, 2, 3 }); - Assert.That(actual.Contains(1), Is.True); + Assert.True(actual.Contains(1)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Detect_if_the_element_is_not_in_the_set() { var actual = new CustomSet(new[] { 1, 2, 3 }); - Assert.That(actual.Contains(4), Is.False); + Assert.False(actual.Contains(4)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Add_to_empty_set() { var actual = new CustomSet().Insert(3); var expected = new CustomSet(new[] { 3 }); - Assert.That(actual, Is.EquivalentTo(expected)); + Assert.True(expected.Equals(actual)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Add_to_non_empty_set() { var actual = new CustomSet(new[] { 1, 2, 4 }).Insert(3); var expected = new CustomSet(new[] { 1, 2, 3, 4 }); - Assert.That(actual, Is.EquivalentTo(expected)); + Assert.True(expected.Equals(actual)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Adding_an_existing_element_does_not_change_the_set() { var actual = new CustomSet(new[] { 1, 2, 3 }); actual.Insert(3); var expected = new CustomSet(new[] { 1, 2, 3 }); - Assert.That(actual, Is.EquivalentTo(expected)); + Assert.True(expected.Equals(actual)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Empty_set_is_a_subset_of_another_empty_set() { var left = new CustomSet(); var right = new CustomSet(); - Assert.That(left.IsSubsetOf(right), Is.True); + Assert.True(left.IsSubsetOf(right)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Empty_set_is_a_subset_of_non_empty_set() { var left = new CustomSet(); var right = new CustomSet(1); - Assert.That(left.IsSubsetOf(right), Is.True); + Assert.True(left.IsSubsetOf(right)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Non_empty_set_is_not_a_subset_of_empty_set() { var left = new CustomSet(1); var right = new CustomSet(); - Assert.That(left.IsSubsetOf(right), Is.False); + Assert.False(left.IsSubsetOf(right)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Set_is_a_subset_of_set_with_exact_same_elements() { var left = new CustomSet(new[] { 1, 2, 3 }); var right = new CustomSet(new[] { 1, 2, 3 }); - Assert.That(left.IsSubsetOf(right), Is.True); + Assert.True(left.IsSubsetOf(right)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Set_is_a_subset_of_larger_set_with_same_elements() { var left = new CustomSet(new[] { 1, 2, 3 }); var right = new CustomSet(new[] { 4, 1, 2, 3 }); - Assert.That(left.IsSubsetOf(right), Is.True); + Assert.True(left.IsSubsetOf(right)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Set_is_not_a_subset_of_set_that_does_not_contain_its_elements() { var left = new CustomSet(new[] { 1, 2, 3 }); var right = new CustomSet(new[] { 4, 1, 3 }); - Assert.That(left.IsSubsetOf(right), Is.False); + Assert.False(left.IsSubsetOf(right)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void The_empty_set_is_disjoint_with_itself() { var left = new CustomSet(); var right = new CustomSet(); - Assert.That(left.IsDisjointFrom(right), Is.True); + Assert.True(left.IsDisjointFrom(right)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Empty_set_is_disjoint_with_non_empty_set() { var left = new CustomSet(); var right = new CustomSet(1); - Assert.That(left.IsDisjointFrom(right), Is.True); + Assert.True(left.IsDisjointFrom(right)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Non_empty_set_is_disjoint_with_empty_set() { var left = new CustomSet(1); var right = new CustomSet(); - Assert.That(left.IsDisjointFrom(right), Is.True); + Assert.True(left.IsDisjointFrom(right)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Sets_are_not_disjoint_if_they_share_an_element() { var left = new CustomSet(new[] { 1, 2 }); var right = new CustomSet(new[] { 2, 3 }); - Assert.That(left.IsDisjointFrom(right), Is.False); + Assert.False(left.IsDisjointFrom(right)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Sets_are_disjoint_if_they_share_no_elements() { var left = new CustomSet(new[] { 1, 2 }); var right = new CustomSet(new[] { 3, 4 }); - Assert.That(left.IsDisjointFrom(right), Is.True); + Assert.True(left.IsDisjointFrom(right)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Intersection_of_two_empty_sets_is_an_empty_set() { var left = new CustomSet(); var right = new CustomSet(); var expected = new CustomSet(); - Assert.That(left.Intersection(right), Is.EquivalentTo(expected)); + Assert.True(left.Intersection(right).Equals(expected)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Intersection_of_an_empty_set_and_non_empty_set_is_an_empty_set() { var left = new CustomSet(); var right = new CustomSet(new[] { 3, 2, 5 }); var expected = new CustomSet(); - Assert.That(left.Intersection(right), Is.EquivalentTo(expected)); + Assert.True(left.Intersection(right).Equals(expected)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Intersection_of_a_non_empty_set_and_an_empty_set_is_an_empty_set() { var left = new CustomSet(new[] { 1, 2, 3, 4 }); var right = new CustomSet(); var expected = new CustomSet(); - Assert.That(left.Intersection(right), Is.EquivalentTo(expected)); + Assert.True(left.Intersection(right).Equals(expected)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Intersection_of_two_sets_with_no_shared_elements_is_an_empty_set() { var left = new CustomSet(new[] { 1, 2, 3 }); var right = new CustomSet(new[] { 4, 5, 6 }); var expected = new CustomSet(); - Assert.That(left.Intersection(right), Is.EquivalentTo(expected)); + Assert.True(left.Intersection(right).Equals(expected)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Intersection_of_two_sets_with_shared_elements_is_a_set_of_the_shared_elements() { var left = new CustomSet(new[] { 1, 2, 3, 4 }); var right = new CustomSet(new[] { 3, 2, 5 }); var expected = new CustomSet(new[] { 2, 3 }); - Assert.That(left.Intersection(right), Is.EquivalentTo(expected)); + Assert.True(left.Intersection(right).Equals(expected)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Difference_of_two_empty_sets_is_an_empty_set() { var left = new CustomSet(); var right = new CustomSet(); var expected = new CustomSet(); - Assert.That(left.Difference(right), Is.EquivalentTo(expected)); + Assert.True(left.Difference(right).Equals(expected)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Difference_of_an_empty_set_and_non_empty_set_is_an_empty_set() { var left = new CustomSet(); var right = new CustomSet(new[] { 3, 2, 5 }); var expected = new CustomSet(); - Assert.That(left.Difference(right), Is.EquivalentTo(expected)); + Assert.True(left.Difference(right).Equals(expected)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Difference_of_a_non_empty_set_and_an_empty_set_is_an_empty_set() { var left = new CustomSet(new[] { 1, 2, 3, 4 }); var right = new CustomSet(); var expected = new CustomSet(new[] { 1, 2, 3, 4 }); - Assert.That(left.Difference(right), Is.EquivalentTo(expected)); + Assert.True(left.Difference(right).Equals(expected)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Difference_of_two_non_empty_sets_is_a_set_of_elements_that_are_only_in_the_first_set() { var left = new CustomSet(new[] { 3, 2, 1 }); var right = new CustomSet(new[] { 2, 4 }); var expected = new CustomSet(new[] { 1, 3 }); - Assert.That(left.Difference(right), Is.EquivalentTo(expected)); + Assert.True(left.Difference(right).Equals(expected)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Union_of_two_empty_sets_is_an_empty_set() { var left = new CustomSet(); var right = new CustomSet(); var expected = new CustomSet(); - Assert.That(left.Union(right), Is.EquivalentTo(expected)); + Assert.True(left.Union(right).Equals(expected)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Union_of_an_empty_set_and_non_empty_set_is_the_non_empty_set() { var left = new CustomSet(); var right = new CustomSet(new[] { 2 }); var expected = new CustomSet(new[] { 2 }); - Assert.That(left.Union(right), Is.EquivalentTo(expected)); + Assert.True(left.Union(right).Equals(expected)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Union_of_a_non_empty_set_and_empty_set_is_the_non_empty_set() { var left = new CustomSet(new[] { 1, 3 }); var right = new CustomSet(); var expected = new CustomSet(new[] { 1, 3 }); - Assert.That(left.Union(right), Is.EquivalentTo(expected)); + Assert.True(left.Union(right).Equals(expected)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Union_of_non_empty_sets_contains_all_unique_elements() { var left = new CustomSet(new[] { 1, 3 }); var right = new CustomSet(new[] { 2, 3 }); var expected = new CustomSet(new[] { 3, 2, 1 }); - Assert.That(left.Union(right), Is.EquivalentTo(expected)); + Assert.True(left.Union(right).Equals(expected)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Empty_sets_are_equal() { var left = new CustomSet(); var right = new CustomSet(); - Assert.That(left, Is.EquivalentTo(right)); + Assert.True(left.Equals(right)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Empty_set_is_not_equal_to_non_empty_set() { var left = new CustomSet(); var right = new CustomSet(new[] { 1, 2, 3 }); - Assert.That(left, Is.Not.EquivalentTo(right)); + Assert.False(left.Equals(right)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Non_empty_set_is_not_equal_to_empty_set() { var left = new CustomSet(new[] { 1, 2, 3 }); var right = new CustomSet(); - Assert.That(left, Is.Not.EquivalentTo(right)); + Assert.False(left.Equals(right)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Sets_with_the_same_elements_are_equal() { var left = new CustomSet(new[] { 1, 2 }); var right = new CustomSet(new[] { 2, 1 }); - Assert.That(left, Is.EquivalentTo(right)); + Assert.True(left.Equals(right)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Sets_with_different_elements_are_not_equal() { var left = new CustomSet(new[] { 1, 2, 3 }); var right = new CustomSet(new[] { 1, 2, 4 }); - Assert.That(left, Is.Not.EquivalentTo(right)); + Assert.False(left.Equals(right)); } } \ No newline at end of file diff --git a/exercises/custom-set/Example.cs b/exercises/custom-set/Example.cs index 40e69f3aaf..76770e01d7 100644 --- a/exercises/custom-set/Example.cs +++ b/exercises/custom-set/Example.cs @@ -1,8 +1,9 @@ -using System.Collections; +using System; +using System.Collections; using System.Collections.Generic; using System.Linq; -public class CustomSet : IEnumerable +public class CustomSet : IEnumerable, IEquatable> { private readonly Dictionary items = new Dictionary(); @@ -69,4 +70,21 @@ IEnumerator IEnumerable.GetEnumerator() } private IEnumerable GetValuesFromKeys(IEnumerable keys) => keys.Select(key => items[key]); + + public override bool Equals(object obj) => Equals(obj as IEnumerable); + + public override int GetHashCode() + { + throw new NotImplementedException(); + } + + public bool Equals(IEnumerable other) + { + return items.Keys.OrderBy(x => x).SequenceEqual(other.Select(o => o.GetHashCode()).OrderBy(x => x)); + } + + public int GetHashCode(IEnumerable obj) + { + throw new NotImplementedException(); + } } \ No newline at end of file diff --git a/exercises/diamond/Diamond.cs b/exercises/diamond/Diamond.cs new file mode 100644 index 0000000000..5de795154c --- /dev/null +++ b/exercises/diamond/Diamond.cs @@ -0,0 +1,9 @@ +using System; + +public static class Diamond +{ + public static string Make(char target) + { + throw new NotImplementedException("Please implement this function"); + } +} diff --git a/exercises/diamond/Diamond.csproj b/exercises/diamond/Diamond.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/diamond/Diamond.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/diamond/DiamondTest.cs b/exercises/diamond/DiamondTest.cs index 04290dbd0a..9f6e7db62c 100644 --- a/exercises/diamond/DiamondTest.cs +++ b/exercises/diamond/DiamondTest.cs @@ -1,38 +1,44 @@ using System; +using System.Collections.Generic; using System.Linq; -using NUnit.Framework; +using Xunit; public class DiamondTest { - private static readonly char[] Letters = GetLetterRange('A', 'Z'); + public static readonly char[] AllLetters = GetLetterRange('A', 'Z'); + public static readonly IEnumerable Letters = AllLetters.Select(letter => new[] { (object)letter }); private static char[] GetLetterRange(char min, char max) => Enumerable.Range(min, max - min + 1).Select(i => (char) i).ToArray(); private static string[] Rows(string x) => x.Split(new[] { '\n' }, StringSplitOptions.None); - private static string LeadingSpaces(string x) => x.Substring(0, x.IndexOfAny(Letters)); - private static string TrailingSpaces(string x) => x.Substring(x.LastIndexOfAny(Letters) + 1); + private static string LeadingSpaces(string x) => x.Substring(0, x.IndexOfAny(AllLetters)); + private static string TrailingSpaces(string x) => x.Substring(x.LastIndexOfAny(AllLetters) + 1); - [TestCaseSource(nameof(Letters))] + [Theory] + [MemberData(nameof(Letters))] public void First_row_contains_A(char letter) { var actual = Diamond.Make(letter); var rows = Rows(actual); var firstRowCharacters = rows.First().Trim(); - Assert.That(firstRowCharacters, Is.EqualTo("A")); + Assert.Equal("A", firstRowCharacters); } - [Ignore("Remove to run test")] - [TestCaseSource(nameof(Letters))] + [Theory(Skip = "Remove to run test")] + [MemberData(nameof(Letters))] public void All_rows_must_have_symmetric_contour(char letter) { var actual = Diamond.Make(letter); var rows = Rows(actual); - Assert.That(rows, Is.All.Matches(row => LeadingSpaces(row) == TrailingSpaces(row))); + Assert.All(rows, row => + { + Assert.Equal(LeadingSpaces(row), TrailingSpaces(row)); + }); } - [Ignore("Remove to run test")] - [TestCaseSource(nameof(Letters))] + [Theory(Skip = "Remove to run test")] + [MemberData(nameof(Letters))] public void Top_of_figure_has_letters_in_correct_order(char letter) { var actual = Diamond.Make(letter); @@ -40,11 +46,11 @@ public void Top_of_figure_has_letters_in_correct_order(char letter) var expected = GetLetterRange('A', letter); var firstNonSpaceLetters = rows.Take(expected.Length).Select(row => row.Trim()[0]); - Assert.That(expected, Is.EqualTo(firstNonSpaceLetters)); + Assert.Equal(firstNonSpaceLetters, expected); } - [Ignore("Remove to run test")] - [TestCaseSource(nameof(Letters))] + [Theory(Skip = "Remove to run test")] + [MemberData(nameof(Letters))] public void Figure_is_symmetric_around_the_horizontal_axis(char letter) { var actual = Diamond.Make(letter); @@ -53,11 +59,11 @@ public void Figure_is_symmetric_around_the_horizontal_axis(char letter) var top = rows.TakeWhile(row => !row.Contains(letter)); var bottom = rows.Reverse().TakeWhile(row => !row.Contains(letter)); - Assert.That(top, Is.EqualTo(bottom)); + Assert.Equal(bottom, top); } - [Ignore("Remove to run test")] - [TestCaseSource(nameof(Letters))] + [Theory(Skip = "Remove to run test")] + [MemberData(nameof(Letters))] public void Diamond_has_square_shape(char letter) { var actual = Diamond.Make(letter); @@ -65,27 +71,30 @@ public void Diamond_has_square_shape(char letter) var rows = Rows(actual); var expected = rows.Length; - Assert.That(rows, Is.All.Matches(row => row.Length == expected)); + Assert.All(rows, row => + { + Assert.Equal(expected, row.Length); + }); } - [Ignore("Remove to run test")] - [TestCaseSource(nameof(Letters))] + [Theory(Skip = "Remove to run test")] + [MemberData(nameof(Letters))] public void All_rows_except_top_and_bottom_have_two_identical_letters(char letter) { var actual = Diamond.Make(letter); var rows = Rows(actual).Where(row => !row.Contains('A')); - Assert.That(rows, Is.All.Matches(row => + Assert.All(rows, row => { var twoCharacters = row.Replace(" ", "").Length == 2; var identicalCharacters = row.Replace(" ", "").Distinct().Count() == 1; - return twoCharacters && identicalCharacters; - })); + Assert.True(twoCharacters && identicalCharacters, "Does not have two identical letters"); + }); } - [Ignore("Remove to run test")] - [TestCaseSource(nameof(Letters))] + [Theory(Skip = "Remove to run test")] + [MemberData(nameof(Letters))] public void Bottom_left_corner_spaces_are_triangle(char letter) { var actual = Diamond.Make(letter); @@ -96,6 +105,6 @@ public void Bottom_left_corner_spaces_are_triangle(char letter) var spaceCounts = cornerSpaces.Select(row => row.Length).ToList(); var expected = Enumerable.Range(0, spaceCounts.Count).Select(i => i).ToList(); - Assert.That(spaceCounts, Is.EqualTo(expected)); + Assert.Equal(expected, spaceCounts); } } \ No newline at end of file diff --git a/exercises/difference-of-squares/DifferenceOfSquares.cs b/exercises/difference-of-squares/DifferenceOfSquares.cs new file mode 100644 index 0000000000..2b6167cda1 --- /dev/null +++ b/exercises/difference-of-squares/DifferenceOfSquares.cs @@ -0,0 +1,19 @@ +using System; + +public static class Squares +{ + public static int SquareOfSums(int max) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static int SumOfSquares(int max) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static int DifferenceOfSquares(int max) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/difference-of-squares/DifferenceOfSquares.csproj b/exercises/difference-of-squares/DifferenceOfSquares.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/difference-of-squares/DifferenceOfSquares.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/difference-of-squares/DifferenceOfSquaresTest.cs b/exercises/difference-of-squares/DifferenceOfSquaresTest.cs index 0d7e66655d..7f887c6516 100644 --- a/exercises/difference-of-squares/DifferenceOfSquaresTest.cs +++ b/exercises/difference-of-squares/DifferenceOfSquaresTest.cs @@ -1,82 +1,65 @@ using System; -using NUnit.Framework; +using Xunit; -[TestFixture] public class DifferenceOfSquaresTests { - [Test] + [Fact] public void Test_square_of_sums_to_5() { - Assert.That(new Squares(5).SquareOfSums(), Is.EqualTo(225)); + Assert.Equal(225, Squares.SquareOfSums(5)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_sum_of_squares_to_5() { - Assert.That(new Squares(5).SumOfSquares(), Is.EqualTo(55)); + Assert.Equal(55, Squares.SumOfSquares(5)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_difference_of_sums_to_5() { - Assert.That(new Squares(5).DifferenceOfSquares(), Is.EqualTo(170)); + Assert.Equal(170, Squares.DifferenceOfSquares(5)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_square_of_sums_to_10() { - Assert.That(new Squares(10).SquareOfSums(), Is.EqualTo(3025)); + Assert.Equal(3025, Squares.SquareOfSums(10)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_sum_of_squares_to_10() { - Assert.That(new Squares(10).SumOfSquares(), Is.EqualTo(385)); + Assert.Equal(385, Squares.SumOfSquares(10)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_difference_of_sums_to_10() { - Assert.That(new Squares(10).DifferenceOfSquares(), Is.EqualTo(2640)); + Assert.Equal(2640, Squares.DifferenceOfSquares(10)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_square_of_sums_to_100() { - Assert.That(new Squares(100).SquareOfSums(), Is.EqualTo(25502500)); + Assert.Equal(25502500, Squares.SquareOfSums(100)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_sum_of_squares_to_100() { - Assert.That(new Squares(100).SumOfSquares(), Is.EqualTo(338350)); + Assert.Equal(338350, Squares.SumOfSquares(100)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_difference_of_sums_to_100() { - Assert.That(new Squares(100).DifferenceOfSquares(), Is.EqualTo(25164150)); + Assert.Equal(25164150, Squares.DifferenceOfSquares(100)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_difference_of_sums_0() { - Assert.That(new Squares(0).DifferenceOfSquares(), Is.EqualTo(0)); - } - - [Ignore("Remove to run test")] - [Test] - public void Test_negative_numbers_throw_argument_out_of_range_exception() - { - Assert.That(() => new Squares(-5), Throws.TypeOf()); + Assert.Equal(0, Squares.DifferenceOfSquares(0)); } } diff --git a/exercises/difference-of-squares/Example.cs b/exercises/difference-of-squares/Example.cs index b92a76b452..a7d83e8baa 100644 --- a/exercises/difference-of-squares/Example.cs +++ b/exercises/difference-of-squares/Example.cs @@ -1,35 +1,23 @@ using System; using System.Linq; -public class Squares +public static class Squares { - private readonly int max; - - public Squares(int max) - { - if (max < 0) - { - throw new ArgumentOutOfRangeException("Max must be positive", "max"); - } - - this.max = max; - } - - public int SquareOfSums() + public static int SquareOfSums(int max) { var numbers = Enumerable.Range(1, max); int sum = numbers.Sum(); return sum * sum; } - public int SumOfSquares() + public static int SumOfSquares(int max) { var numbers = Enumerable.Range(1, max); return numbers.Select(x => x * x).Sum(); } - public int DifferenceOfSquares() + public static int DifferenceOfSquares(int max) { - return SquareOfSums() - SumOfSquares(); + return SquareOfSums(max) - SumOfSquares(max); } } \ No newline at end of file diff --git a/exercises/diffie-hellman/DiffieHellman.cs b/exercises/diffie-hellman/DiffieHellman.cs new file mode 100644 index 0000000000..047d8c4eb6 --- /dev/null +++ b/exercises/diffie-hellman/DiffieHellman.cs @@ -0,0 +1,20 @@ +using System; +using System.Numerics; + +public static class DiffieHellman +{ + public static BigInteger PrivateKey(BigInteger primeP) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static BigInteger PublicKey(BigInteger primeP, BigInteger primeG, BigInteger privateKey) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static BigInteger Secret(BigInteger primeP, BigInteger publicKey, BigInteger privateKey) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/diffie-hellman/DiffieHellman.csproj b/exercises/diffie-hellman/DiffieHellman.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/diffie-hellman/DiffieHellman.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/diffie-hellman/DiffieHellmanTest.cs b/exercises/diffie-hellman/DiffieHellmanTest.cs index 5fbd6d5c48..dd66ac78eb 100644 --- a/exercises/diffie-hellman/DiffieHellmanTest.cs +++ b/exercises/diffie-hellman/DiffieHellmanTest.cs @@ -1,30 +1,31 @@ using System.Linq; using System.Numerics; -using NUnit.Framework; +using Xunit; public class DiffieHellmanTest { - [Test] + [Fact] public void Private_key_in_range() { var primeP = new BigInteger(23); var privateKeys = Enumerable.Range(0, 10).Select(_ => DiffieHellman.PrivateKey(primeP)).ToList(); - Assert.That(privateKeys, Is.All.InRange(new BigInteger(1), primeP - new BigInteger(1))); + Assert.All(privateKeys, privateKey => + { + Assert.InRange(privateKey, new BigInteger(1), primeP - new BigInteger(1)); + }); } // Note: due to the nature of randomness, there is always a chance that this test fails // Be sure to check the actual generated values - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Private_key_randomly_generated() { var primeP = new BigInteger(7919); var privateKeys = Enumerable.Range(0, 5).Select(_ => DiffieHellman.PrivateKey(primeP)).ToList(); - Assert.That(privateKeys.Count, Is.EqualTo(privateKeys.Distinct().Count())); + Assert.Equal(privateKeys.Distinct().Count(), privateKeys.Count); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Public_key_correctly_calculated() { var primeP = new BigInteger(23); @@ -32,11 +33,10 @@ public void Public_key_correctly_calculated() var privateKey = new BigInteger(6); var actual = DiffieHellman.PublicKey(primeP, primeG, privateKey); - Assert.That(actual, Is.EqualTo(new BigInteger(8))); + Assert.Equal(new BigInteger(8), actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Secret_key_correctly_calculated() { var primeP = new BigInteger(23); @@ -44,11 +44,10 @@ public void Secret_key_correctly_calculated() var privateKey = new BigInteger(6); var actual = DiffieHellman.Secret(primeP, publicKey, privateKey); - Assert.That(actual, Is.EqualTo(new BigInteger(2))); + Assert.Equal(new BigInteger(2), actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Secret_key_correctly_calculated_when_using_large_primes() { var primeP = BigInteger.Parse("120227323036150778550155526710966921740030662694578947298423549235265759593711587341037426347114541533006628856300552706996143592240453345642869233562886752930249953227657883929905072620233073626594386072962776144691433658814261874113232461749035425712805067202910389407991986070558964461330091797026762932543"); @@ -56,11 +55,10 @@ public void Secret_key_correctly_calculated_when_using_large_primes() var privateKey = BigInteger.Parse("2483479393625932939911081304356888505153797135447327501792696199190469015215177630758617902200417377685436170904594686456961202706692908603181062371925882"); var expected = BigInteger.Parse("70900735223964890815905879227737819348808518698920446491346508980461201746567735331455825644429877946556431095820785835497384849778344216981228226252639932672153547963980483673419756271345828771971984887453014488572245819864454136618980914729839523581263886740821363010486083940557620831348661126601106717071"); var actual = DiffieHellman.Secret(primeP, publicKey, privateKey); - Assert.That(actual, Is.EqualTo(expected)); + Assert.Equal(expected, actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_exchange() { var primeP = new BigInteger(23); @@ -75,6 +73,6 @@ public void Test_exchange() var secretA = DiffieHellman.Secret(primeP, publicKeyB, privateKeyA); var secretB = DiffieHellman.Secret(primeP, publicKeyA, privateKeyB); - Assert.That(secretA, Is.EqualTo(secretB)); + Assert.Equal(secretB, secretA); } } diff --git a/exercises/dominoes/Dominoes.cs b/exercises/dominoes/Dominoes.cs new file mode 100644 index 0000000000..134f76eea3 --- /dev/null +++ b/exercises/dominoes/Dominoes.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; + +public static class Dominoes +{ + public static bool CanChain(IEnumerable> dominoes) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/dominoes/Dominoes.csproj b/exercises/dominoes/Dominoes.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/dominoes/Dominoes.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/dominoes/DominoesTest.cs b/exercises/dominoes/DominoesTest.cs index 9fe0e86592..9e6307e71a 100644 --- a/exercises/dominoes/DominoesTest.cs +++ b/exercises/dominoes/DominoesTest.cs @@ -1,100 +1,89 @@ using System; -using NUnit.Framework; +using Xunit; public class DominoesTest { - [Test] + [Fact] public void Empty_input_equals_empty_output() { var actual = new Tuple[0]; - Assert.That(Dominoes.CanChain(actual), Is.True); + Assert.True(Dominoes.CanChain(actual)); } - - [Ignore("Remove to run test")] - [Test] + + [Fact(Skip = "Remove to run test")] public void Singleton_input_equals_singleton_output() { var actual = new[] { Tuple.Create(1, 1) }; - Assert.That(Dominoes.CanChain(actual), Is.True); + Assert.True(Dominoes.CanChain(actual)); } - - [Ignore("Remove to run test")] - [Test] + + [Fact(Skip = "Remove to run test")] public void Singleton_that_cant_be_chained() { var actual = new[] { Tuple.Create(1, 2) }; - Assert.That(Dominoes.CanChain(actual), Is.False); + Assert.False(Dominoes.CanChain(actual)); } - - [Ignore("Remove to run test")] - [Test] + + [Fact(Skip = "Remove to run test")] public void Three_elements() { var actual = new[] { Tuple.Create(1, 2), Tuple.Create(3, 1), Tuple.Create(2, 3) }; - Assert.That(Dominoes.CanChain(actual), Is.True); + Assert.True(Dominoes.CanChain(actual)); } - - [Ignore("Remove to run test")] - [Test] + + [Fact(Skip = "Remove to run test")] public void Can_reverse_dominoes() { var actual = new[] { Tuple.Create(1, 2), Tuple.Create(1, 3), Tuple.Create(2, 3) }; - Assert.That(Dominoes.CanChain(actual), Is.True); + Assert.True(Dominoes.CanChain(actual)); } - - [Ignore("Remove to run test")] - [Test] + + [Fact(Skip = "Remove to run test")] public void Cant_be_chained() { var actual = new[] { Tuple.Create(1, 2), Tuple.Create(4, 1), Tuple.Create(2, 3) }; - Assert.That(Dominoes.CanChain(actual), Is.False); + Assert.False(Dominoes.CanChain(actual)); } - - [Ignore("Remove to run test")] - [Test] + + [Fact(Skip = "Remove to run test")] public void Disconnected_simple() { var actual = new[] { Tuple.Create(1, 1), Tuple.Create(2, 2) }; - Assert.That(Dominoes.CanChain(actual), Is.False); + Assert.False(Dominoes.CanChain(actual)); } - - [Ignore("Remove to run test")] - [Test] + + [Fact(Skip = "Remove to run test")] public void Disconnected_double_loop() { var actual = new[] { Tuple.Create(1, 2), Tuple.Create(2, 1), Tuple.Create(3, 4), Tuple.Create(4, 3) }; - Assert.That(Dominoes.CanChain(actual), Is.False); + Assert.False(Dominoes.CanChain(actual)); } - - [Ignore("Remove to run test")] - [Test] + + [Fact(Skip = "Remove to run test")] public void Disconnected_single_isolated() { var actual = new[] { Tuple.Create(1, 2), Tuple.Create(2, 3), Tuple.Create(3, 1), Tuple.Create(4, 4) }; - Assert.That(Dominoes.CanChain(actual), Is.False); + Assert.False(Dominoes.CanChain(actual)); } - - [Ignore("Remove to run test")] - [Test] + + [Fact(Skip = "Remove to run test")] public void Need_backtrack() { var actual = new[] { Tuple.Create(1, 2), Tuple.Create(2, 3), Tuple.Create(3, 1), Tuple.Create(2, 4), Tuple.Create(2, 4) }; - Assert.That(Dominoes.CanChain(actual), Is.True); + Assert.True(Dominoes.CanChain(actual)); } - - [Ignore("Remove to run test")] - [Test] + + [Fact(Skip = "Remove to run test")] public void Separate_loops() { var actual = new[] { Tuple.Create(1, 2), Tuple.Create(2, 3), Tuple.Create(3, 1), Tuple.Create(1, 1), Tuple.Create(2, 2), Tuple.Create(3, 3) }; - Assert.That(Dominoes.CanChain(actual), Is.True); + Assert.True(Dominoes.CanChain(actual)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Ten_elements() { var actual = new[] @@ -102,6 +91,6 @@ public void Ten_elements() Tuple.Create(1, 2), Tuple.Create(5, 3), Tuple.Create(3, 1), Tuple.Create(1, 2), Tuple.Create(2, 4), Tuple.Create(1, 6), Tuple.Create(2, 3), Tuple.Create(3, 4), Tuple.Create(5, 6) }; - Assert.That(Dominoes.CanChain(actual), Is.True); + Assert.True(Dominoes.CanChain(actual)); } } \ No newline at end of file diff --git a/exercises/dot-dsl/DotDsl.cs b/exercises/dot-dsl/DotDsl.cs new file mode 100644 index 0000000000..4ac7fd97db --- /dev/null +++ b/exercises/dot-dsl/DotDsl.cs @@ -0,0 +1,15 @@ +public class Node +{ +} + +public class Edge +{ +} + +public class Attr +{ +} + +public class Graph +{ +} \ No newline at end of file diff --git a/exercises/dot-dsl/DotDsl.csproj b/exercises/dot-dsl/DotDsl.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/dot-dsl/DotDsl.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/dot-dsl/DotDslTest.cs b/exercises/dot-dsl/DotDslTest.cs index 615fb1f84f..9e0c45b6b7 100644 --- a/exercises/dot-dsl/DotDslTest.cs +++ b/exercises/dot-dsl/DotDslTest.cs @@ -1,19 +1,21 @@ -using NUnit.Framework; +using System; +using System.Collections.Generic; +using System.Linq; +using Xunit; public class DotDslTest { - [Test] + [Fact] public void Empty_graph() { var g = new Graph(); - Assert.That(g.Nodes, Is.Empty); - Assert.That(g.Edges, Is.Empty); - Assert.That(g.Attrs, Is.Empty); + Assert.Empty(g.Nodes); + Assert.Empty(g.Edges); + Assert.Empty(g.Attrs); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Graph_with_one_node() { var g = new Graph @@ -21,13 +23,12 @@ public void Graph_with_one_node() new Node("a") }; - Assert.That(g.Nodes, Is.EquivalentTo(new[] { new Node("a") })); - Assert.That(g.Edges, Is.Empty); - Assert.That(g.Attrs, Is.Empty); + Assert.Equal(new[] { new Node("a") }, g.Nodes); + Assert.Empty(g.Edges); + Assert.Empty(g.Attrs); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Graph_with_one_node_with_keywords() { var g = new Graph @@ -35,13 +36,12 @@ public void Graph_with_one_node_with_keywords() new Node("a") { { "color", "green" } } }; - Assert.That(g.Nodes, Is.EquivalentTo(new[] { new Node("a") { { "color", "green" } } })); - Assert.That(g.Edges, Is.Empty); - Assert.That(g.Attrs, Is.Empty); + Assert.Equal(new[] { new Node("a") { { "color", "green" } } }, g.Nodes); + Assert.Empty(g.Edges); + Assert.Empty(g.Attrs); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Graph_with_one_edge() { var g = new Graph @@ -49,13 +49,12 @@ public void Graph_with_one_edge() new Edge("a", "b") }; - Assert.That(g.Nodes, Is.Empty); - Assert.That(g.Edges, Is.EquivalentTo(new[] { new Edge("a", "b") })); - Assert.That(g.Attrs, Is.Empty); + Assert.Empty(g.Nodes); + Assert.Equal(new[] { new Edge("a", "b") }, g.Edges); + Assert.Empty(g.Attrs); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Graph_with_one_attribute() { var g = new Graph @@ -63,13 +62,12 @@ public void Graph_with_one_attribute() { "foo", "1" } }; - Assert.That(g.Nodes, Is.Empty); - Assert.That(g.Edges, Is.Empty); - Assert.That(g.Attrs, Is.EquivalentTo(new[] { new Attr("foo", "1") })); + Assert.Empty(g.Nodes); + Assert.Empty(g.Edges); + Assert.Equal(new[] { new Attr("foo", "1") }, g.Attrs); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Graph_with_attributes() { var g = new Graph @@ -84,8 +82,20 @@ public void Graph_with_attributes() { "bar", "true" } }; - Assert.That(g.Nodes, Is.EquivalentTo(new[] { new Node("a") { { "color", "green" } }, new Node("b") { { "label", "Beta!" } }, new Node("c") })); - Assert.That(g.Edges, Is.EquivalentTo(new[] { new Edge("a", "b") { { "color", "blue" } }, new Edge("b", "c") })); - Assert.That(g.Attrs, Is.EquivalentTo(new[] { new Attr("bar", "true"), new Attr("foo", "1"), new Attr("title", "Testing Attrs") })); + Assert.Equal(new[] { new Node("a") { { "color", "green" } }, new Node("b") { { "label", "Beta!" } }, new Node("c") }, g.Nodes, EnumerableEqualityComparer.Instance); + Assert.Equal(new[] { new Edge("a", "b") { { "color", "blue" } }, new Edge("b", "c") }, g.Edges, EnumerableEqualityComparer.Instance); + Assert.Equal(new[] { new Attr("bar", "true"), new Attr("foo", "1"), new Attr("title", "Testing Attrs") }, g.Attrs, EnumerableEqualityComparer.Instance); + } + + private class EnumerableEqualityComparer : IEqualityComparer> + { + public static readonly EnumerableEqualityComparer Instance = new EnumerableEqualityComparer(); + + public bool Equals(IEnumerable x, IEnumerable y) => new HashSet(x).SetEquals(y); + + public int GetHashCode(IEnumerable obj) + { + throw new NotImplementedException(); + } } } \ No newline at end of file diff --git a/exercises/error-handling/ErrorHandling.cs b/exercises/error-handling/ErrorHandling.cs new file mode 100644 index 0000000000..df277b2d84 --- /dev/null +++ b/exercises/error-handling/ErrorHandling.cs @@ -0,0 +1,24 @@ +using System; + +public static class ErrorHandling +{ + public static void HandleErrorByThrowingException() + { + throw new NotImplementedException("You need to implement this function."); + } + + public static int? HandleErrorByReturningNullableType(string input) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static bool HandleErrorWithOutParam(string input, out int result) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static void DisposableResourcesAreDisposedWhenExceptionIsThrown(IDisposable disposableObject) + { + throw new NotImplementedException("You need to implement this function."); + } +} diff --git a/exercises/error-handling/ErrorHandling.csproj b/exercises/error-handling/ErrorHandling.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/error-handling/ErrorHandling.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/error-handling/ErrorHandlingTest.cs b/exercises/error-handling/ErrorHandlingTest.cs index 545560bf0c..ff8bd317d9 100644 --- a/exercises/error-handling/ErrorHandlingTest.cs +++ b/exercises/error-handling/ErrorHandlingTest.cs @@ -1,43 +1,40 @@ using System; -using NUnit.Framework; +using Xunit; -[TestFixture] public class ErrorHandlingTest { // Read more about exception handling here: // https://msdn.microsoft.com/en-us/library/ms173162.aspx?f=255&MSPPError=-2147217396 - [Test] + [Fact] public void ThrowException() { - Assert.Throws(ErrorHandling.HandleErrorByThrowingException); + Assert.Throws(() => ErrorHandling.HandleErrorByThrowingException()); } // Read more about nullable types here: // https://msdn.microsoft.com/en-us/library/1t3y8s4s.aspx?f=255&MSPPError=-2147217396 - [Test] - [Ignore("Remove to run test")] + [Fact(Skip = "Remove to run test")] public void ReturnNullableType() { var successfulResult = ErrorHandling.HandleErrorByReturningNullableType("1"); - Assert.That(successfulResult, Is.EqualTo(1)); + Assert.Equal(1, successfulResult); var failureResult = ErrorHandling.HandleErrorByReturningNullableType("a"); - Assert.That(failureResult, Is.EqualTo(null)); + Assert.Equal(null, failureResult); } // Read more about out parameters here: // https://msdn.microsoft.com/en-us/library/t3c3bfhx.aspx?f=255&MSPPError=-2147217396 - [Test] - [Ignore("Remove to run test")] + [Fact(Skip = "Remove to run test")] public void ReturnWithOutParameter() { int result; var successfulResult = ErrorHandling.HandleErrorWithOutParam("1", out result); - Assert.That(successfulResult, Is.EqualTo(true)); - Assert.That(result, Is.EqualTo(1)); + Assert.Equal(true, successfulResult); + Assert.Equal(1, result); var failureResult = ErrorHandling.HandleErrorWithOutParam("a", out result); - Assert.That(failureResult, Is.EqualTo(false)); + Assert.Equal(false, failureResult); // The value of result is meaningless here (it could be anything) so it shouldn't be used and it's not validated } @@ -53,13 +50,12 @@ public void Dispose() // Read more about IDisposable here: // https://msdn.microsoft.com/en-us/library/system.idisposable(v=vs.110).aspx - [Test] - [Ignore("Remove to run test")] + [Fact(Skip = "Remove to run test")] public void DisposableObjectsAreDisposedWhenThrowingAnException() { var disposableResource = new DisposableResource(); Assert.Throws(() => ErrorHandling.DisposableResourcesAreDisposedWhenExceptionIsThrown(disposableResource)); - Assert.That(disposableResource.IsDisposed, Is.EqualTo(true)); + Assert.Equal(true, disposableResource.IsDisposed); } } diff --git a/exercises/etl/ETLTest.cs b/exercises/etl/ETLTest.cs index 4426fe6eff..171736878a 100644 --- a/exercises/etl/ETLTest.cs +++ b/exercises/etl/ETLTest.cs @@ -1,37 +1,33 @@ using System.Collections.Generic; -using NUnit.Framework; +using Xunit; -[TestFixture] public class ETLTest { - [Test] + [Fact] public void Transforms_one_value() { var old = new Dictionary> { { 1, new List { "A" } } }; var expected = new Dictionary { { "a", 1 } }; - Assert.That(ETL.Transform(old), Is.EqualTo(expected)); + Assert.Equal(expected, ETL.Transform(old)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Transforms_multiple_values() { var old = new Dictionary> { { 1, new List { "A", "E", "I", "O", "U" } } }; var expected = new Dictionary { { "a", 1 }, { "e", 1 }, { "i", 1 }, { "o", 1 }, { "u", 1 } }; - Assert.That(ETL.Transform(old), Is.EqualTo(expected)); + Assert.Equal(expected, ETL.Transform(old)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Transforms_multiple_keys() { var old = new Dictionary> { { 1, new List { "A", "E" } }, { 2, new List { "D", "G" } } }; var expected = new Dictionary { { "a", 1 }, { "e", 1 }, { "d", 2 }, { "g", 2 } }; - Assert.That(ETL.Transform(old), Is.EqualTo(expected)); + Assert.Equal(expected, ETL.Transform(old)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Transforms_a_full_dataset() { var old = new Dictionary> @@ -50,6 +46,6 @@ public void Transforms_a_full_dataset() { "j", 8 }, { "k", 5 }, { "l", 1 }, { "m", 3 }, { "n", 1 }, { "o", 1 }, { "p", 3 }, { "q", 10 }, { "r", 1 }, { "s", 1 }, { "t", 1 }, { "u", 1 }, { "v", 4 }, { "w", 4 }, { "x", 8 }, { "y", 4 }, { "z", 10 } }; - Assert.That(ETL.Transform(old), Is.EqualTo(expected)); + Assert.Equal(expected, ETL.Transform(old)); } } \ No newline at end of file diff --git a/exercises/etl/Etl.cs b/exercises/etl/Etl.cs new file mode 100644 index 0000000000..656204d959 --- /dev/null +++ b/exercises/etl/Etl.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; + +public static class ETL +{ + public static IDictionary Transform(IDictionary> old) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/etl/Etl.csproj b/exercises/etl/Etl.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/etl/Etl.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/etl/Example.cs b/exercises/etl/Example.cs index 891725eaa7..2a7c702fd3 100644 --- a/exercises/etl/Example.cs +++ b/exercises/etl/Example.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -public class ETL +public static class ETL { public static IDictionary Transform(IDictionary> old) { diff --git a/exercises/exercises.csproj b/exercises/exercises.csproj deleted file mode 100644 index 2432130d5d..0000000000 --- a/exercises/exercises.csproj +++ /dev/null @@ -1,363 +0,0 @@ - - - - - Debug - AnyCPU - {FEF69435-D885-45DD-A446-04FD3BD3F593} - Library - Properties - xcsharp - xcsharp - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - ..\packages\NUnit\lib\net20\NUnit.System.Linq.dll - True - True - - - ..\packages\NUnit\lib\net20\nunit.framework.dll - True - True - - - - - - - ..\packages\NUnit\lib\net35\nunit.framework.dll - True - True - - - - - - - ..\packages\NUnit\lib\net40\nunit.framework.dll - True - True - - - - - - - ..\packages\NUnit\lib\net45\nunit.framework.dll - True - True - - - - - - - ..\packages\NUnit\lib\portable-net45+win8+wp8+wpa81+Xamarin.Mac+MonoAndroid10+MonoTouch10+Xamarin.iOS10\nunit.framework.dll - True - True - - - - - - - - - ..\packages\Sprache\lib\net35\Sprache.dll - True - True - - - - - - - ..\packages\Sprache\lib\net40\Sprache.dll - True - True - - - - - - - ..\packages\Sprache\lib\netstandard1.0\Sprache.dll - True - True - - - - - - - ..\packages\Sprache\lib\sl50\Sprache.dll - True - True - - - - - - - - - ..\packages\System.Collections\ref\netstandard1.0\System.Collections.dll - False - True - - - - - - - ..\packages\System.Collections\ref\netstandard1.3\System.Collections.dll - False - True - - - - - - - - - ..\packages\System.Diagnostics.Debug\ref\netstandard1.3\System.Diagnostics.Debug.dll - False - True - - - - - - - - - ..\packages\System.Globalization\ref\netstandard1.0\System.Globalization.dll - False - True - - - - - - - ..\packages\System.Globalization\ref\netstandard1.3\System.Globalization.dll - False - True - - - - - - - - - ..\packages\System.IO\ref\netstandard1.5\System.IO.dll - False - True - - - - - - - - - ..\packages\System.Linq\ref\netstandard1.0\System.Linq.dll - False - True - - - - - - - ..\packages\System.Linq\ref\netstandard1.6\System.Linq.dll - False - True - - - - - - - - - ..\packages\System.Reflection\ref\netstandard1.5\System.Reflection.dll - False - True - - - - - - - - - ..\packages\System.Reflection.Primitives\ref\netstandard1.0\System.Reflection.Primitives.dll - False - True - - - - - - - - - ..\packages\System.Resources.ResourceManager\ref\netstandard1.0\System.Resources.ResourceManager.dll - False - True - - - - - - - - - ..\packages\System.Runtime\ref\netstandard1.0\System.Runtime.dll - False - True - - - - - - - ..\packages\System.Runtime\ref\netstandard1.2\System.Runtime.dll - False - True - - - - - - - ..\packages\System.Runtime\ref\netstandard1.3\System.Runtime.dll - False - True - - - - - - - ..\packages\System.Runtime\ref\netstandard1.5\System.Runtime.dll - False - True - - - - - - - - - ..\packages\System.Runtime.Extensions\ref\netstandard1.5\System.Runtime.Extensions.dll - False - True - - - - - - - - - ..\packages\System.Text.Encoding\ref\netstandard1.3\System.Text.Encoding.dll - False - True - - - - - - - - - ..\packages\System.Text.RegularExpressions\ref\netstandard1.0\System.Text.RegularExpressions.dll - False - True - - - - - - - ..\packages\System.Text.RegularExpressions\ref\netstandard1.3\System.Text.RegularExpressions.dll - False - True - - - - - - - ..\packages\System.Text.RegularExpressions\ref\netstandard1.6\System.Text.RegularExpressions.dll - False - True - - - - - - - - - ..\packages\System.Threading\ref\netstandard1.3\System.Threading.dll - False - True - - - - - - - - - ..\packages\System.Threading.Tasks\ref\netstandard1.3\System.Threading.Tasks.dll - False - True - - - - - \ No newline at end of file diff --git a/exercises/exercises.sln b/exercises/exercises.sln new file mode 100644 index 0000000000..f85d9cfb40 --- /dev/null +++ b/exercises/exercises.sln @@ -0,0 +1,1475 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26228.4 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accumulate", "accumulate\Accumulate.csproj", "{F16C0EE1-6923-4328-B015-363CF24FF867}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Acronym", "acronym\Acronym.csproj", "{0B8FF29D-6707-4112-8398-6F383A31524D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AllYourBase", "all-your-base\AllYourBase.csproj", "{CFA7CC8D-C585-4AE6-BAD0-840D3DC62A43}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Allergies", "allergies\Allergies.csproj", "{C9372234-0F42-4E0E-BD55-EAC351D9256C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Alphametics", "alphametics\Alphametics.csproj", "{BA7E7612-8AE8-4246-8E09-190445DF9900}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Anagram", "anagram\Anagram.csproj", "{815C764D-CC32-4BD9-8F32-78A2D030C71E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AtbashCipher", "atbash-cipher\AtbashCipher.csproj", "{4CEF0893-7AE3-455E-98C1-89BB822AC1C2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BankAccount", "bank-account\BankAccount.csproj", "{12BF4BEE-261C-42B8-B2DC-D80262744AC2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BeerSong", "beer-song\BeerSong.csproj", "{BE87F8A4-E216-40A7-86CF-153A15BAFEF8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BinarySearch", "binary-search\BinarySearch.csproj", "{1F8B6B66-7A58-4F84-9D3A-FB454D2CC3E2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BinarySearchTree", "binary-search-tree\BinarySearchTree.csproj", "{6FBC562A-7721-4846-81B6-D79D5AF576C5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bob", "bob\Bob.csproj", "{C8D01AEE-9AD9-4134-9721-3442C59702B2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BookStore", "book-store\BookStore.csproj", "{F9175D9F-7602-4BE1-B565-EA723D0CDF0A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bowling", "bowling\Bowling.csproj", "{CE0CA302-A594-422D-A215-E78F2F3AF0CE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BracketPush", "bracket-push\BracketPush.csproj", "{A9584773-6FD0-42CB-B94E-A61125C5C1E7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Change", "change\Change.csproj", "{31595C04-4C0E-4A72-90A1-054EE5C47BFC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CircularBuffer", "circular-buffer\CircularBuffer.csproj", "{A3016178-CED9-4DDD-8FF4-03C420AD77B9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Clock", "clock\Clock.csproj", "{D498F024-BA85-4543-88F9-1DCF239470C7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Connect", "connect\Connect.csproj", "{2C9B22CE-770A-400B-BD9B-287030CF12BB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CryptoSquare", "crypto-square\CryptoSquare.csproj", "{A6151CB7-713E-43B0-A403-9C73F9936D4B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomSet", "custom-set\CustomSet.csproj", "{3ED88500-2825-4F24-81E6-C816FF89A5B5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Diamond", "diamond\Diamond.csproj", "{93092B18-7447-4F06-AD46-FC7B39EC9E89}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DifferenceOfSquares", "difference-of-squares\DifferenceOfSquares.csproj", "{07DA1459-6101-43E1-A1AF-48ABD8D62ADD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiffieHellman", "diffie-hellman\DiffieHellman.csproj", "{58000112-543C-401E-9D1C-EBABC5A67A14}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dominoes", "dominoes\Dominoes.csproj", "{99CCDA48-1CA3-46B9-89B8-0B45106304FC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotDsl", "dot-dsl\DotDsl.csproj", "{45A818E0-8CDF-44A5-B948-63D8DEB9982E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ErrorHandling", "error-handling\ErrorHandling.csproj", "{B341FE12-9233-4E34-8C1C-4E62AC2F8AE1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Etl", "etl\Etl.csproj", "{B7E811DB-8575-4C77-9AF9-49DA840557C2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlattenArray", "flatten-array\FlattenArray.csproj", "{FD52020A-6F1E-42FA-81CE-1F6A8E7C9737}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FoodChain", "food-chain\FoodChain.csproj", "{FED33EF6-AC47-4E9A-B615-66B16B846E94}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Forth", "forth\Forth.csproj", "{ACB24C7C-C92D-43F9-B1B1-9444696DAD36}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gigasecond", "gigasecond\Gigasecond.csproj", "{2C8C5AE3-D04F-48F4-8AF5-D7535277B7A0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GoCounting", "go-counting\GoCounting.csproj", "{A5417213-F20A-4C06-9D8B-8688B0C4EE61}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GradeSchool", "grade-school\GradeSchool.csproj", "{A03A743F-C645-45CB-80A0-BE10D2FC1A13}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Grains", "grains\Grains.csproj", "{29C6234D-5562-4495-A014-92388EE4518E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Grep", "grep\Grep.csproj", "{4427F391-652B-4804-BED4-7CD0D218FE28}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hamming", "hamming\Hamming.csproj", "{61BAD6B6-3A48-4E9B-8333-F1884F68A0A5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hangman", "hangman\Hangman.csproj", "{DE23A75D-E816-4988-BB2C-7EBEB5BEB6F1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloWorld", "hello-world\HelloWorld.csproj", "{0CC90F16-9B6C-4C87-A49B-600DB3DF0D2A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "House", "house\House.csproj", "{4D68748B-6DEF-4E05-830C-43AF09B2CE8A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Isogram", "isogram\Isogram.csproj", "{91CF9FC4-105B-4E21-8692-1D5E539E42E9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KindergartenGarden", "kindergarten-garden\KindergartenGarden.csproj", "{D504C93E-AE1A-4852-9727-6E565632D38E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LargestSeriesProduct", "largest-series-product\LargestSeriesProduct.csproj", "{1632128F-A60B-49B8-A5DB-05F3F1A3B84C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Leap", "leap\Leap.csproj", "{8CA92DF0-3C60-4F23-9890-806744E1F514}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ledger", "ledger\Ledger.csproj", "{507ED1D4-F905-4AAD-897D-AD403FA56663}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LinkedList", "linked-list\LinkedList.csproj", "{C9ADF8BA-8239-4514-8906-A8E09A1A874C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ListOps", "list-ops\ListOps.csproj", "{7370EDAC-0F7C-4008-A8C6-8C6240EE518E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Luhn", "luhn\Luhn.csproj", "{6B934B23-6A75-42FC-9B6C-B3F4CFA6673F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Markdown", "markdown\Markdown.csproj", "{AFA39C3B-C0A0-445C-8129-4DFD3009B56E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Matrix", "matrix\Matrix.csproj", "{BCC05EA8-DB49-4684-9888-1B8688BE3FA6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Meetup", "meetup\Meetup.csproj", "{87FCABD0-2762-464E-9489-415E95D12427}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Minesweeper", "minesweeper\Minesweeper.csproj", "{C84E079F-9790-425A-9C86-C69122811E6F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NthPrime", "nth-prime\NthPrime.csproj", "{F437861F-4FF8-418E-B205-FB04D23E0312}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NucleotideCount", "nucleotide-count\NucleotideCount.csproj", "{6A9E4125-03D1-4DAF-8333-336C49360621}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OcrNumbers", "ocr-numbers\OcrNumbers.csproj", "{1BA7884A-3D6F-4479-A0F9-44385662FE24}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PalindromeProducts", "palindrome-products\PalindromeProducts.csproj", "{FBE7E7D4-EBF1-4B0C-B63E-540DA1C9CEAA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pangram", "pangram\Pangram.csproj", "{7E047279-FD70-440F-8FB9-B47E88747EF4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ParallelLetterFrequency", "parallel-letter-frequency\ParallelLetterFrequency.csproj", "{A60E1C9A-6E52-42F7-ACA2-BB58DA64361E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PascalsTriangle", "pascals-triangle\PascalsTriangle.csproj", "{427A9EFA-5E06-4176-A287-0DC0E0CD3E86}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PerfectNumbers", "perfect-numbers\PerfectNumbers.csproj", "{4B864ACE-495C-46FB-870F-4D794C02C8F9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PhoneNumber", "phone-number\PhoneNumber.csproj", "{17419CBD-2AC6-479F-ACA7-D478F9FBF397}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PigLatin", "pig-latin\PigLatin.csproj", "{03856292-CE47-45EE-91D4-6ACF27E1925F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Poker", "poker\Poker.csproj", "{762A1A84-4B1E-49A1-BC58-4988BB489F7C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pov", "pov\Pov.csproj", "{3B42D204-BFB1-456F-B5F5-9421EECE465A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrimeFactors", "prime-factors\PrimeFactors.csproj", "{F8BC96E4-15E2-4F64-9D25-E167EC207404}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProteinTranslation", "protein-translation\ProteinTranslation.csproj", "{A2EB7FD7-7660-4297-B431-9833CB65A848}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Proverb", "proverb\Proverb.csproj", "{086D5907-AAF8-4488-A2AD-4A3430D74FAB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PythagoreanTriplet", "pythagorean-triplet\PythagoreanTriplet.csproj", "{6ACF8F5B-B1E1-439B-AFFF-42D6B143760E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QueenAttack", "queen-attack\QueenAttack.csproj", "{50FB388F-6D68-400C-A919-0414B87466A7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RailFenceCipher", "rail-fence-cipher\RailFenceCipher.csproj", "{F1957BE5-4CA4-494B-A62B-AA4F5E4D460A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Raindrops", "raindrops\Raindrops.csproj", "{F2077E7E-7305-4FC7-8D67-D90037B3F370}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "React", "react\React.csproj", "{3A3D27B8-10FE-4E72-A3CE-183EBC11503B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rectangles", "rectangles\Rectangles.csproj", "{A8777E05-E344-4673-915B-E9224002C423}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RnaTranscription", "rna-transcription\RnaTranscription.csproj", "{05B08A0C-5BCA-4FF6-9C42-9DFF5E7DCDEA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RobotName", "robot-name\RobotName.csproj", "{C9CFE66E-6921-4CCE-83A7-D5B54812122F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RobotSimulator", "robot-simulator\RobotSimulator.csproj", "{A0FD4472-99E5-4FBC-A6A7-20786EA167DF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RomanNumerals", "roman-numerals\RomanNumerals.csproj", "{86272012-C994-41F7-BFAF-4BED50797B22}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RunLengthEncoding", "run-length-encoding\RunLengthEncoding.csproj", "{94B89563-1E74-42F9-96A5-19CD800AFECB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SaddlePoints", "saddle-points\SaddlePoints.csproj", "{E5D2964E-CFE9-4DE6-99B5-1F54F9984F65}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Say", "say\Say.csproj", "{C92F8E81-6FB1-46FF-9B68-2D126F8903E6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ScaleGenerator", "scale-generator\ScaleGenerator.csproj", "{B9207BE6-2577-4C49-AF5F-130A17BBEA73}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ScrabbleScore", "scrabble-score\ScrabbleScore.csproj", "{40C19FFA-E1E1-4589-86E4-B7BEF336CE79}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SecretHandshake", "secret-handshake\SecretHandshake.csproj", "{64324C38-03F7-4624-8F00-B85183DDBF99}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Series", "series\Series.csproj", "{14C24193-D5E0-4D29-B270-C27B43CC1925}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SgfParsing", "sgf-parsing\SgfParsing.csproj", "{B25208A4-3C80-411E-A36A-7BC4AA506DC7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sieve", "sieve\Sieve.csproj", "{2A56B16C-3980-4380-84E8-B20DEEEFB5D6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleCipher", "simple-cipher\SimpleCipher.csproj", "{269971FF-B748-4B95-8507-534C229A60B9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleLinkedList", "simple-linked-list\SimpleLinkedList.csproj", "{F6244150-1AD9-470E-B0F0-72389B10639E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpaceAge", "space-age\SpaceAge.csproj", "{D1102F23-265A-4CA8-975C-75564DFFAA04}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Strain", "strain\Strain.csproj", "{F4C5ECB6-2C17-4BC9-BF8F-BA9117BD2843}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sublist", "sublist\Sublist.csproj", "{B9C4BF5F-2D56-4B06-A1EE-1E1CC642D14B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SumOfMultiples", "sum-of-multiples\SumOfMultiples.csproj", "{6CE987BF-9677-476C-8BB9-1BE7CC16F932}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tournament", "tournament\Tournament.csproj", "{BD63E691-0A53-46CE-B687-E3CD95F1D4B1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Transpose", "transpose\Transpose.csproj", "{FCF9AB0E-4310-4BCB-8682-833450658B97}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TreeBuilding", "tree-building\TreeBuilding.csproj", "{607AB17F-1305-4002-A980-DB60699688F1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Triangle", "triangle\Triangle.csproj", "{128B3A5D-E28C-4C7F-8B16-3202D0F73A00}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TwelveDays", "twelve-days\TwelveDays.csproj", "{B98F63AB-F0C8-4594-98BD-0BBBAEA4C4E9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TwoBucket", "two-bucket\TwoBucket.csproj", "{62EBA4E5-BD13-4F7C-85E6-65D633B3FB6C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VariableLengthQuantity", "variable-length-quantity\VariableLengthQuantity.csproj", "{DFE95B37-24F5-417A-8C3F-788255CE8A04}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WordCount", "word-count\WordCount.csproj", "{77E253C3-5FCE-45A4-B285-BE24945E0D70}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WordSearch", "word-search\WordSearch.csproj", "{32ECF281-6D99-42D4-AD00-C8B56A8270F8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wordy", "wordy\Wordy.csproj", "{2EBD1C45-9D80-413A-9BE8-4ECB43C06843}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZebraPuzzle", "zebra-puzzle\ZebraPuzzle.csproj", "{79198D56-C3F2-49D6-B8BF-5BB674B6F7A2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Zipper", "zipper\Zipper.csproj", "{83504141-FF2A-427E-8A51-9FA0E9037A78}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F16C0EE1-6923-4328-B015-363CF24FF867}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F16C0EE1-6923-4328-B015-363CF24FF867}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F16C0EE1-6923-4328-B015-363CF24FF867}.Debug|x64.ActiveCfg = Debug|Any CPU + {F16C0EE1-6923-4328-B015-363CF24FF867}.Debug|x64.Build.0 = Debug|Any CPU + {F16C0EE1-6923-4328-B015-363CF24FF867}.Debug|x86.ActiveCfg = Debug|Any CPU + {F16C0EE1-6923-4328-B015-363CF24FF867}.Debug|x86.Build.0 = Debug|Any CPU + {F16C0EE1-6923-4328-B015-363CF24FF867}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F16C0EE1-6923-4328-B015-363CF24FF867}.Release|Any CPU.Build.0 = Release|Any CPU + {F16C0EE1-6923-4328-B015-363CF24FF867}.Release|x64.ActiveCfg = Release|Any CPU + {F16C0EE1-6923-4328-B015-363CF24FF867}.Release|x64.Build.0 = Release|Any CPU + {F16C0EE1-6923-4328-B015-363CF24FF867}.Release|x86.ActiveCfg = Release|Any CPU + {F16C0EE1-6923-4328-B015-363CF24FF867}.Release|x86.Build.0 = Release|Any CPU + {0B8FF29D-6707-4112-8398-6F383A31524D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0B8FF29D-6707-4112-8398-6F383A31524D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B8FF29D-6707-4112-8398-6F383A31524D}.Debug|x64.ActiveCfg = Debug|Any CPU + {0B8FF29D-6707-4112-8398-6F383A31524D}.Debug|x64.Build.0 = Debug|Any CPU + {0B8FF29D-6707-4112-8398-6F383A31524D}.Debug|x86.ActiveCfg = Debug|Any CPU + {0B8FF29D-6707-4112-8398-6F383A31524D}.Debug|x86.Build.0 = Debug|Any CPU + {0B8FF29D-6707-4112-8398-6F383A31524D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0B8FF29D-6707-4112-8398-6F383A31524D}.Release|Any CPU.Build.0 = Release|Any CPU + {0B8FF29D-6707-4112-8398-6F383A31524D}.Release|x64.ActiveCfg = Release|Any CPU + {0B8FF29D-6707-4112-8398-6F383A31524D}.Release|x64.Build.0 = Release|Any CPU + {0B8FF29D-6707-4112-8398-6F383A31524D}.Release|x86.ActiveCfg = Release|Any CPU + {0B8FF29D-6707-4112-8398-6F383A31524D}.Release|x86.Build.0 = Release|Any CPU + {CFA7CC8D-C585-4AE6-BAD0-840D3DC62A43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CFA7CC8D-C585-4AE6-BAD0-840D3DC62A43}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CFA7CC8D-C585-4AE6-BAD0-840D3DC62A43}.Debug|x64.ActiveCfg = Debug|Any CPU + {CFA7CC8D-C585-4AE6-BAD0-840D3DC62A43}.Debug|x64.Build.0 = Debug|Any CPU + {CFA7CC8D-C585-4AE6-BAD0-840D3DC62A43}.Debug|x86.ActiveCfg = Debug|Any CPU + {CFA7CC8D-C585-4AE6-BAD0-840D3DC62A43}.Debug|x86.Build.0 = Debug|Any CPU + {CFA7CC8D-C585-4AE6-BAD0-840D3DC62A43}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CFA7CC8D-C585-4AE6-BAD0-840D3DC62A43}.Release|Any CPU.Build.0 = Release|Any CPU + {CFA7CC8D-C585-4AE6-BAD0-840D3DC62A43}.Release|x64.ActiveCfg = Release|Any CPU + {CFA7CC8D-C585-4AE6-BAD0-840D3DC62A43}.Release|x64.Build.0 = Release|Any CPU + {CFA7CC8D-C585-4AE6-BAD0-840D3DC62A43}.Release|x86.ActiveCfg = Release|Any CPU + {CFA7CC8D-C585-4AE6-BAD0-840D3DC62A43}.Release|x86.Build.0 = Release|Any CPU + {C9372234-0F42-4E0E-BD55-EAC351D9256C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C9372234-0F42-4E0E-BD55-EAC351D9256C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C9372234-0F42-4E0E-BD55-EAC351D9256C}.Debug|x64.ActiveCfg = Debug|Any CPU + {C9372234-0F42-4E0E-BD55-EAC351D9256C}.Debug|x64.Build.0 = Debug|Any CPU + {C9372234-0F42-4E0E-BD55-EAC351D9256C}.Debug|x86.ActiveCfg = Debug|Any CPU + {C9372234-0F42-4E0E-BD55-EAC351D9256C}.Debug|x86.Build.0 = Debug|Any CPU + {C9372234-0F42-4E0E-BD55-EAC351D9256C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C9372234-0F42-4E0E-BD55-EAC351D9256C}.Release|Any CPU.Build.0 = Release|Any CPU + {C9372234-0F42-4E0E-BD55-EAC351D9256C}.Release|x64.ActiveCfg = Release|Any CPU + {C9372234-0F42-4E0E-BD55-EAC351D9256C}.Release|x64.Build.0 = Release|Any CPU + {C9372234-0F42-4E0E-BD55-EAC351D9256C}.Release|x86.ActiveCfg = Release|Any CPU + {C9372234-0F42-4E0E-BD55-EAC351D9256C}.Release|x86.Build.0 = Release|Any CPU + {BA7E7612-8AE8-4246-8E09-190445DF9900}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BA7E7612-8AE8-4246-8E09-190445DF9900}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BA7E7612-8AE8-4246-8E09-190445DF9900}.Debug|x64.ActiveCfg = Debug|Any CPU + {BA7E7612-8AE8-4246-8E09-190445DF9900}.Debug|x64.Build.0 = Debug|Any CPU + {BA7E7612-8AE8-4246-8E09-190445DF9900}.Debug|x86.ActiveCfg = Debug|Any CPU + {BA7E7612-8AE8-4246-8E09-190445DF9900}.Debug|x86.Build.0 = Debug|Any CPU + {BA7E7612-8AE8-4246-8E09-190445DF9900}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BA7E7612-8AE8-4246-8E09-190445DF9900}.Release|Any CPU.Build.0 = Release|Any CPU + {BA7E7612-8AE8-4246-8E09-190445DF9900}.Release|x64.ActiveCfg = Release|Any CPU + {BA7E7612-8AE8-4246-8E09-190445DF9900}.Release|x64.Build.0 = Release|Any CPU + {BA7E7612-8AE8-4246-8E09-190445DF9900}.Release|x86.ActiveCfg = Release|Any CPU + {BA7E7612-8AE8-4246-8E09-190445DF9900}.Release|x86.Build.0 = Release|Any CPU + {815C764D-CC32-4BD9-8F32-78A2D030C71E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {815C764D-CC32-4BD9-8F32-78A2D030C71E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {815C764D-CC32-4BD9-8F32-78A2D030C71E}.Debug|x64.ActiveCfg = Debug|Any CPU + {815C764D-CC32-4BD9-8F32-78A2D030C71E}.Debug|x64.Build.0 = Debug|Any CPU + {815C764D-CC32-4BD9-8F32-78A2D030C71E}.Debug|x86.ActiveCfg = Debug|Any CPU + {815C764D-CC32-4BD9-8F32-78A2D030C71E}.Debug|x86.Build.0 = Debug|Any CPU + {815C764D-CC32-4BD9-8F32-78A2D030C71E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {815C764D-CC32-4BD9-8F32-78A2D030C71E}.Release|Any CPU.Build.0 = Release|Any CPU + {815C764D-CC32-4BD9-8F32-78A2D030C71E}.Release|x64.ActiveCfg = Release|Any CPU + {815C764D-CC32-4BD9-8F32-78A2D030C71E}.Release|x64.Build.0 = Release|Any CPU + {815C764D-CC32-4BD9-8F32-78A2D030C71E}.Release|x86.ActiveCfg = Release|Any CPU + {815C764D-CC32-4BD9-8F32-78A2D030C71E}.Release|x86.Build.0 = Release|Any CPU + {4CEF0893-7AE3-455E-98C1-89BB822AC1C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4CEF0893-7AE3-455E-98C1-89BB822AC1C2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4CEF0893-7AE3-455E-98C1-89BB822AC1C2}.Debug|x64.ActiveCfg = Debug|Any CPU + {4CEF0893-7AE3-455E-98C1-89BB822AC1C2}.Debug|x64.Build.0 = Debug|Any CPU + {4CEF0893-7AE3-455E-98C1-89BB822AC1C2}.Debug|x86.ActiveCfg = Debug|Any CPU + {4CEF0893-7AE3-455E-98C1-89BB822AC1C2}.Debug|x86.Build.0 = Debug|Any CPU + {4CEF0893-7AE3-455E-98C1-89BB822AC1C2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4CEF0893-7AE3-455E-98C1-89BB822AC1C2}.Release|Any CPU.Build.0 = Release|Any CPU + {4CEF0893-7AE3-455E-98C1-89BB822AC1C2}.Release|x64.ActiveCfg = Release|Any CPU + {4CEF0893-7AE3-455E-98C1-89BB822AC1C2}.Release|x64.Build.0 = Release|Any CPU + {4CEF0893-7AE3-455E-98C1-89BB822AC1C2}.Release|x86.ActiveCfg = Release|Any CPU + {4CEF0893-7AE3-455E-98C1-89BB822AC1C2}.Release|x86.Build.0 = Release|Any CPU + {12BF4BEE-261C-42B8-B2DC-D80262744AC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {12BF4BEE-261C-42B8-B2DC-D80262744AC2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {12BF4BEE-261C-42B8-B2DC-D80262744AC2}.Debug|x64.ActiveCfg = Debug|Any CPU + {12BF4BEE-261C-42B8-B2DC-D80262744AC2}.Debug|x64.Build.0 = Debug|Any CPU + {12BF4BEE-261C-42B8-B2DC-D80262744AC2}.Debug|x86.ActiveCfg = Debug|Any CPU + {12BF4BEE-261C-42B8-B2DC-D80262744AC2}.Debug|x86.Build.0 = Debug|Any CPU + {12BF4BEE-261C-42B8-B2DC-D80262744AC2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {12BF4BEE-261C-42B8-B2DC-D80262744AC2}.Release|Any CPU.Build.0 = Release|Any CPU + {12BF4BEE-261C-42B8-B2DC-D80262744AC2}.Release|x64.ActiveCfg = Release|Any CPU + {12BF4BEE-261C-42B8-B2DC-D80262744AC2}.Release|x64.Build.0 = Release|Any CPU + {12BF4BEE-261C-42B8-B2DC-D80262744AC2}.Release|x86.ActiveCfg = Release|Any CPU + {12BF4BEE-261C-42B8-B2DC-D80262744AC2}.Release|x86.Build.0 = Release|Any CPU + {BE87F8A4-E216-40A7-86CF-153A15BAFEF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BE87F8A4-E216-40A7-86CF-153A15BAFEF8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BE87F8A4-E216-40A7-86CF-153A15BAFEF8}.Debug|x64.ActiveCfg = Debug|Any CPU + {BE87F8A4-E216-40A7-86CF-153A15BAFEF8}.Debug|x64.Build.0 = Debug|Any CPU + {BE87F8A4-E216-40A7-86CF-153A15BAFEF8}.Debug|x86.ActiveCfg = Debug|Any CPU + {BE87F8A4-E216-40A7-86CF-153A15BAFEF8}.Debug|x86.Build.0 = Debug|Any CPU + {BE87F8A4-E216-40A7-86CF-153A15BAFEF8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BE87F8A4-E216-40A7-86CF-153A15BAFEF8}.Release|Any CPU.Build.0 = Release|Any CPU + {BE87F8A4-E216-40A7-86CF-153A15BAFEF8}.Release|x64.ActiveCfg = Release|Any CPU + {BE87F8A4-E216-40A7-86CF-153A15BAFEF8}.Release|x64.Build.0 = Release|Any CPU + {BE87F8A4-E216-40A7-86CF-153A15BAFEF8}.Release|x86.ActiveCfg = Release|Any CPU + {BE87F8A4-E216-40A7-86CF-153A15BAFEF8}.Release|x86.Build.0 = Release|Any CPU + {1F8B6B66-7A58-4F84-9D3A-FB454D2CC3E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F8B6B66-7A58-4F84-9D3A-FB454D2CC3E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F8B6B66-7A58-4F84-9D3A-FB454D2CC3E2}.Debug|x64.ActiveCfg = Debug|Any CPU + {1F8B6B66-7A58-4F84-9D3A-FB454D2CC3E2}.Debug|x64.Build.0 = Debug|Any CPU + {1F8B6B66-7A58-4F84-9D3A-FB454D2CC3E2}.Debug|x86.ActiveCfg = Debug|Any CPU + {1F8B6B66-7A58-4F84-9D3A-FB454D2CC3E2}.Debug|x86.Build.0 = Debug|Any CPU + {1F8B6B66-7A58-4F84-9D3A-FB454D2CC3E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F8B6B66-7A58-4F84-9D3A-FB454D2CC3E2}.Release|Any CPU.Build.0 = Release|Any CPU + {1F8B6B66-7A58-4F84-9D3A-FB454D2CC3E2}.Release|x64.ActiveCfg = Release|Any CPU + {1F8B6B66-7A58-4F84-9D3A-FB454D2CC3E2}.Release|x64.Build.0 = Release|Any CPU + {1F8B6B66-7A58-4F84-9D3A-FB454D2CC3E2}.Release|x86.ActiveCfg = Release|Any CPU + {1F8B6B66-7A58-4F84-9D3A-FB454D2CC3E2}.Release|x86.Build.0 = Release|Any CPU + {6FBC562A-7721-4846-81B6-D79D5AF576C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6FBC562A-7721-4846-81B6-D79D5AF576C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6FBC562A-7721-4846-81B6-D79D5AF576C5}.Debug|x64.ActiveCfg = Debug|Any CPU + {6FBC562A-7721-4846-81B6-D79D5AF576C5}.Debug|x64.Build.0 = Debug|Any CPU + {6FBC562A-7721-4846-81B6-D79D5AF576C5}.Debug|x86.ActiveCfg = Debug|Any CPU + {6FBC562A-7721-4846-81B6-D79D5AF576C5}.Debug|x86.Build.0 = Debug|Any CPU + {6FBC562A-7721-4846-81B6-D79D5AF576C5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6FBC562A-7721-4846-81B6-D79D5AF576C5}.Release|Any CPU.Build.0 = Release|Any CPU + {6FBC562A-7721-4846-81B6-D79D5AF576C5}.Release|x64.ActiveCfg = Release|Any CPU + {6FBC562A-7721-4846-81B6-D79D5AF576C5}.Release|x64.Build.0 = Release|Any CPU + {6FBC562A-7721-4846-81B6-D79D5AF576C5}.Release|x86.ActiveCfg = Release|Any CPU + {6FBC562A-7721-4846-81B6-D79D5AF576C5}.Release|x86.Build.0 = Release|Any CPU + {C8D01AEE-9AD9-4134-9721-3442C59702B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C8D01AEE-9AD9-4134-9721-3442C59702B2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C8D01AEE-9AD9-4134-9721-3442C59702B2}.Debug|x64.ActiveCfg = Debug|Any CPU + {C8D01AEE-9AD9-4134-9721-3442C59702B2}.Debug|x64.Build.0 = Debug|Any CPU + {C8D01AEE-9AD9-4134-9721-3442C59702B2}.Debug|x86.ActiveCfg = Debug|Any CPU + {C8D01AEE-9AD9-4134-9721-3442C59702B2}.Debug|x86.Build.0 = Debug|Any CPU + {C8D01AEE-9AD9-4134-9721-3442C59702B2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C8D01AEE-9AD9-4134-9721-3442C59702B2}.Release|Any CPU.Build.0 = Release|Any CPU + {C8D01AEE-9AD9-4134-9721-3442C59702B2}.Release|x64.ActiveCfg = Release|Any CPU + {C8D01AEE-9AD9-4134-9721-3442C59702B2}.Release|x64.Build.0 = Release|Any CPU + {C8D01AEE-9AD9-4134-9721-3442C59702B2}.Release|x86.ActiveCfg = Release|Any CPU + {C8D01AEE-9AD9-4134-9721-3442C59702B2}.Release|x86.Build.0 = Release|Any CPU + {F9175D9F-7602-4BE1-B565-EA723D0CDF0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F9175D9F-7602-4BE1-B565-EA723D0CDF0A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F9175D9F-7602-4BE1-B565-EA723D0CDF0A}.Debug|x64.ActiveCfg = Debug|Any CPU + {F9175D9F-7602-4BE1-B565-EA723D0CDF0A}.Debug|x64.Build.0 = Debug|Any CPU + {F9175D9F-7602-4BE1-B565-EA723D0CDF0A}.Debug|x86.ActiveCfg = Debug|Any CPU + {F9175D9F-7602-4BE1-B565-EA723D0CDF0A}.Debug|x86.Build.0 = Debug|Any CPU + {F9175D9F-7602-4BE1-B565-EA723D0CDF0A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F9175D9F-7602-4BE1-B565-EA723D0CDF0A}.Release|Any CPU.Build.0 = Release|Any CPU + {F9175D9F-7602-4BE1-B565-EA723D0CDF0A}.Release|x64.ActiveCfg = Release|Any CPU + {F9175D9F-7602-4BE1-B565-EA723D0CDF0A}.Release|x64.Build.0 = Release|Any CPU + {F9175D9F-7602-4BE1-B565-EA723D0CDF0A}.Release|x86.ActiveCfg = Release|Any CPU + {F9175D9F-7602-4BE1-B565-EA723D0CDF0A}.Release|x86.Build.0 = Release|Any CPU + {CE0CA302-A594-422D-A215-E78F2F3AF0CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CE0CA302-A594-422D-A215-E78F2F3AF0CE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CE0CA302-A594-422D-A215-E78F2F3AF0CE}.Debug|x64.ActiveCfg = Debug|Any CPU + {CE0CA302-A594-422D-A215-E78F2F3AF0CE}.Debug|x64.Build.0 = Debug|Any CPU + {CE0CA302-A594-422D-A215-E78F2F3AF0CE}.Debug|x86.ActiveCfg = Debug|Any CPU + {CE0CA302-A594-422D-A215-E78F2F3AF0CE}.Debug|x86.Build.0 = Debug|Any CPU + {CE0CA302-A594-422D-A215-E78F2F3AF0CE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CE0CA302-A594-422D-A215-E78F2F3AF0CE}.Release|Any CPU.Build.0 = Release|Any CPU + {CE0CA302-A594-422D-A215-E78F2F3AF0CE}.Release|x64.ActiveCfg = Release|Any CPU + {CE0CA302-A594-422D-A215-E78F2F3AF0CE}.Release|x64.Build.0 = Release|Any CPU + {CE0CA302-A594-422D-A215-E78F2F3AF0CE}.Release|x86.ActiveCfg = Release|Any CPU + {CE0CA302-A594-422D-A215-E78F2F3AF0CE}.Release|x86.Build.0 = Release|Any CPU + {A9584773-6FD0-42CB-B94E-A61125C5C1E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A9584773-6FD0-42CB-B94E-A61125C5C1E7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A9584773-6FD0-42CB-B94E-A61125C5C1E7}.Debug|x64.ActiveCfg = Debug|Any CPU + {A9584773-6FD0-42CB-B94E-A61125C5C1E7}.Debug|x64.Build.0 = Debug|Any CPU + {A9584773-6FD0-42CB-B94E-A61125C5C1E7}.Debug|x86.ActiveCfg = Debug|Any CPU + {A9584773-6FD0-42CB-B94E-A61125C5C1E7}.Debug|x86.Build.0 = Debug|Any CPU + {A9584773-6FD0-42CB-B94E-A61125C5C1E7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A9584773-6FD0-42CB-B94E-A61125C5C1E7}.Release|Any CPU.Build.0 = Release|Any CPU + {A9584773-6FD0-42CB-B94E-A61125C5C1E7}.Release|x64.ActiveCfg = Release|Any CPU + {A9584773-6FD0-42CB-B94E-A61125C5C1E7}.Release|x64.Build.0 = Release|Any CPU + {A9584773-6FD0-42CB-B94E-A61125C5C1E7}.Release|x86.ActiveCfg = Release|Any CPU + {A9584773-6FD0-42CB-B94E-A61125C5C1E7}.Release|x86.Build.0 = Release|Any CPU + {31595C04-4C0E-4A72-90A1-054EE5C47BFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {31595C04-4C0E-4A72-90A1-054EE5C47BFC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {31595C04-4C0E-4A72-90A1-054EE5C47BFC}.Debug|x64.ActiveCfg = Debug|Any CPU + {31595C04-4C0E-4A72-90A1-054EE5C47BFC}.Debug|x64.Build.0 = Debug|Any CPU + {31595C04-4C0E-4A72-90A1-054EE5C47BFC}.Debug|x86.ActiveCfg = Debug|Any CPU + {31595C04-4C0E-4A72-90A1-054EE5C47BFC}.Debug|x86.Build.0 = Debug|Any CPU + {31595C04-4C0E-4A72-90A1-054EE5C47BFC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {31595C04-4C0E-4A72-90A1-054EE5C47BFC}.Release|Any CPU.Build.0 = Release|Any CPU + {31595C04-4C0E-4A72-90A1-054EE5C47BFC}.Release|x64.ActiveCfg = Release|Any CPU + {31595C04-4C0E-4A72-90A1-054EE5C47BFC}.Release|x64.Build.0 = Release|Any CPU + {31595C04-4C0E-4A72-90A1-054EE5C47BFC}.Release|x86.ActiveCfg = Release|Any CPU + {31595C04-4C0E-4A72-90A1-054EE5C47BFC}.Release|x86.Build.0 = Release|Any CPU + {A3016178-CED9-4DDD-8FF4-03C420AD77B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A3016178-CED9-4DDD-8FF4-03C420AD77B9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A3016178-CED9-4DDD-8FF4-03C420AD77B9}.Debug|x64.ActiveCfg = Debug|Any CPU + {A3016178-CED9-4DDD-8FF4-03C420AD77B9}.Debug|x64.Build.0 = Debug|Any CPU + {A3016178-CED9-4DDD-8FF4-03C420AD77B9}.Debug|x86.ActiveCfg = Debug|Any CPU + {A3016178-CED9-4DDD-8FF4-03C420AD77B9}.Debug|x86.Build.0 = Debug|Any CPU + {A3016178-CED9-4DDD-8FF4-03C420AD77B9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A3016178-CED9-4DDD-8FF4-03C420AD77B9}.Release|Any CPU.Build.0 = Release|Any CPU + {A3016178-CED9-4DDD-8FF4-03C420AD77B9}.Release|x64.ActiveCfg = Release|Any CPU + {A3016178-CED9-4DDD-8FF4-03C420AD77B9}.Release|x64.Build.0 = Release|Any CPU + {A3016178-CED9-4DDD-8FF4-03C420AD77B9}.Release|x86.ActiveCfg = Release|Any CPU + {A3016178-CED9-4DDD-8FF4-03C420AD77B9}.Release|x86.Build.0 = Release|Any CPU + {D498F024-BA85-4543-88F9-1DCF239470C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D498F024-BA85-4543-88F9-1DCF239470C7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D498F024-BA85-4543-88F9-1DCF239470C7}.Debug|x64.ActiveCfg = Debug|Any CPU + {D498F024-BA85-4543-88F9-1DCF239470C7}.Debug|x64.Build.0 = Debug|Any CPU + {D498F024-BA85-4543-88F9-1DCF239470C7}.Debug|x86.ActiveCfg = Debug|Any CPU + {D498F024-BA85-4543-88F9-1DCF239470C7}.Debug|x86.Build.0 = Debug|Any CPU + {D498F024-BA85-4543-88F9-1DCF239470C7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D498F024-BA85-4543-88F9-1DCF239470C7}.Release|Any CPU.Build.0 = Release|Any CPU + {D498F024-BA85-4543-88F9-1DCF239470C7}.Release|x64.ActiveCfg = Release|Any CPU + {D498F024-BA85-4543-88F9-1DCF239470C7}.Release|x64.Build.0 = Release|Any CPU + {D498F024-BA85-4543-88F9-1DCF239470C7}.Release|x86.ActiveCfg = Release|Any CPU + {D498F024-BA85-4543-88F9-1DCF239470C7}.Release|x86.Build.0 = Release|Any CPU + {2C9B22CE-770A-400B-BD9B-287030CF12BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2C9B22CE-770A-400B-BD9B-287030CF12BB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2C9B22CE-770A-400B-BD9B-287030CF12BB}.Debug|x64.ActiveCfg = Debug|Any CPU + {2C9B22CE-770A-400B-BD9B-287030CF12BB}.Debug|x64.Build.0 = Debug|Any CPU + {2C9B22CE-770A-400B-BD9B-287030CF12BB}.Debug|x86.ActiveCfg = Debug|Any CPU + {2C9B22CE-770A-400B-BD9B-287030CF12BB}.Debug|x86.Build.0 = Debug|Any CPU + {2C9B22CE-770A-400B-BD9B-287030CF12BB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2C9B22CE-770A-400B-BD9B-287030CF12BB}.Release|Any CPU.Build.0 = Release|Any CPU + {2C9B22CE-770A-400B-BD9B-287030CF12BB}.Release|x64.ActiveCfg = Release|Any CPU + {2C9B22CE-770A-400B-BD9B-287030CF12BB}.Release|x64.Build.0 = Release|Any CPU + {2C9B22CE-770A-400B-BD9B-287030CF12BB}.Release|x86.ActiveCfg = Release|Any CPU + {2C9B22CE-770A-400B-BD9B-287030CF12BB}.Release|x86.Build.0 = Release|Any CPU + {A6151CB7-713E-43B0-A403-9C73F9936D4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A6151CB7-713E-43B0-A403-9C73F9936D4B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A6151CB7-713E-43B0-A403-9C73F9936D4B}.Debug|x64.ActiveCfg = Debug|Any CPU + {A6151CB7-713E-43B0-A403-9C73F9936D4B}.Debug|x64.Build.0 = Debug|Any CPU + {A6151CB7-713E-43B0-A403-9C73F9936D4B}.Debug|x86.ActiveCfg = Debug|Any CPU + {A6151CB7-713E-43B0-A403-9C73F9936D4B}.Debug|x86.Build.0 = Debug|Any CPU + {A6151CB7-713E-43B0-A403-9C73F9936D4B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A6151CB7-713E-43B0-A403-9C73F9936D4B}.Release|Any CPU.Build.0 = Release|Any CPU + {A6151CB7-713E-43B0-A403-9C73F9936D4B}.Release|x64.ActiveCfg = Release|Any CPU + {A6151CB7-713E-43B0-A403-9C73F9936D4B}.Release|x64.Build.0 = Release|Any CPU + {A6151CB7-713E-43B0-A403-9C73F9936D4B}.Release|x86.ActiveCfg = Release|Any CPU + {A6151CB7-713E-43B0-A403-9C73F9936D4B}.Release|x86.Build.0 = Release|Any CPU + {3ED88500-2825-4F24-81E6-C816FF89A5B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3ED88500-2825-4F24-81E6-C816FF89A5B5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3ED88500-2825-4F24-81E6-C816FF89A5B5}.Debug|x64.ActiveCfg = Debug|Any CPU + {3ED88500-2825-4F24-81E6-C816FF89A5B5}.Debug|x64.Build.0 = Debug|Any CPU + {3ED88500-2825-4F24-81E6-C816FF89A5B5}.Debug|x86.ActiveCfg = Debug|Any CPU + {3ED88500-2825-4F24-81E6-C816FF89A5B5}.Debug|x86.Build.0 = Debug|Any CPU + {3ED88500-2825-4F24-81E6-C816FF89A5B5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3ED88500-2825-4F24-81E6-C816FF89A5B5}.Release|Any CPU.Build.0 = Release|Any CPU + {3ED88500-2825-4F24-81E6-C816FF89A5B5}.Release|x64.ActiveCfg = Release|Any CPU + {3ED88500-2825-4F24-81E6-C816FF89A5B5}.Release|x64.Build.0 = Release|Any CPU + {3ED88500-2825-4F24-81E6-C816FF89A5B5}.Release|x86.ActiveCfg = Release|Any CPU + {3ED88500-2825-4F24-81E6-C816FF89A5B5}.Release|x86.Build.0 = Release|Any CPU + {93092B18-7447-4F06-AD46-FC7B39EC9E89}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {93092B18-7447-4F06-AD46-FC7B39EC9E89}.Debug|Any CPU.Build.0 = Debug|Any CPU + {93092B18-7447-4F06-AD46-FC7B39EC9E89}.Debug|x64.ActiveCfg = Debug|Any CPU + {93092B18-7447-4F06-AD46-FC7B39EC9E89}.Debug|x64.Build.0 = Debug|Any CPU + {93092B18-7447-4F06-AD46-FC7B39EC9E89}.Debug|x86.ActiveCfg = Debug|Any CPU + {93092B18-7447-4F06-AD46-FC7B39EC9E89}.Debug|x86.Build.0 = Debug|Any CPU + {93092B18-7447-4F06-AD46-FC7B39EC9E89}.Release|Any CPU.ActiveCfg = Release|Any CPU + {93092B18-7447-4F06-AD46-FC7B39EC9E89}.Release|Any CPU.Build.0 = Release|Any CPU + {93092B18-7447-4F06-AD46-FC7B39EC9E89}.Release|x64.ActiveCfg = Release|Any CPU + {93092B18-7447-4F06-AD46-FC7B39EC9E89}.Release|x64.Build.0 = Release|Any CPU + {93092B18-7447-4F06-AD46-FC7B39EC9E89}.Release|x86.ActiveCfg = Release|Any CPU + {93092B18-7447-4F06-AD46-FC7B39EC9E89}.Release|x86.Build.0 = Release|Any CPU + {07DA1459-6101-43E1-A1AF-48ABD8D62ADD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {07DA1459-6101-43E1-A1AF-48ABD8D62ADD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {07DA1459-6101-43E1-A1AF-48ABD8D62ADD}.Debug|x64.ActiveCfg = Debug|Any CPU + {07DA1459-6101-43E1-A1AF-48ABD8D62ADD}.Debug|x64.Build.0 = Debug|Any CPU + {07DA1459-6101-43E1-A1AF-48ABD8D62ADD}.Debug|x86.ActiveCfg = Debug|Any CPU + {07DA1459-6101-43E1-A1AF-48ABD8D62ADD}.Debug|x86.Build.0 = Debug|Any CPU + {07DA1459-6101-43E1-A1AF-48ABD8D62ADD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {07DA1459-6101-43E1-A1AF-48ABD8D62ADD}.Release|Any CPU.Build.0 = Release|Any CPU + {07DA1459-6101-43E1-A1AF-48ABD8D62ADD}.Release|x64.ActiveCfg = Release|Any CPU + {07DA1459-6101-43E1-A1AF-48ABD8D62ADD}.Release|x64.Build.0 = Release|Any CPU + {07DA1459-6101-43E1-A1AF-48ABD8D62ADD}.Release|x86.ActiveCfg = Release|Any CPU + {07DA1459-6101-43E1-A1AF-48ABD8D62ADD}.Release|x86.Build.0 = Release|Any CPU + {58000112-543C-401E-9D1C-EBABC5A67A14}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {58000112-543C-401E-9D1C-EBABC5A67A14}.Debug|Any CPU.Build.0 = Debug|Any CPU + {58000112-543C-401E-9D1C-EBABC5A67A14}.Debug|x64.ActiveCfg = Debug|Any CPU + {58000112-543C-401E-9D1C-EBABC5A67A14}.Debug|x64.Build.0 = Debug|Any CPU + {58000112-543C-401E-9D1C-EBABC5A67A14}.Debug|x86.ActiveCfg = Debug|Any CPU + {58000112-543C-401E-9D1C-EBABC5A67A14}.Debug|x86.Build.0 = Debug|Any CPU + {58000112-543C-401E-9D1C-EBABC5A67A14}.Release|Any CPU.ActiveCfg = Release|Any CPU + {58000112-543C-401E-9D1C-EBABC5A67A14}.Release|Any CPU.Build.0 = Release|Any CPU + {58000112-543C-401E-9D1C-EBABC5A67A14}.Release|x64.ActiveCfg = Release|Any CPU + {58000112-543C-401E-9D1C-EBABC5A67A14}.Release|x64.Build.0 = Release|Any CPU + {58000112-543C-401E-9D1C-EBABC5A67A14}.Release|x86.ActiveCfg = Release|Any CPU + {58000112-543C-401E-9D1C-EBABC5A67A14}.Release|x86.Build.0 = Release|Any CPU + {99CCDA48-1CA3-46B9-89B8-0B45106304FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {99CCDA48-1CA3-46B9-89B8-0B45106304FC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {99CCDA48-1CA3-46B9-89B8-0B45106304FC}.Debug|x64.ActiveCfg = Debug|Any CPU + {99CCDA48-1CA3-46B9-89B8-0B45106304FC}.Debug|x64.Build.0 = Debug|Any CPU + {99CCDA48-1CA3-46B9-89B8-0B45106304FC}.Debug|x86.ActiveCfg = Debug|Any CPU + {99CCDA48-1CA3-46B9-89B8-0B45106304FC}.Debug|x86.Build.0 = Debug|Any CPU + {99CCDA48-1CA3-46B9-89B8-0B45106304FC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {99CCDA48-1CA3-46B9-89B8-0B45106304FC}.Release|Any CPU.Build.0 = Release|Any CPU + {99CCDA48-1CA3-46B9-89B8-0B45106304FC}.Release|x64.ActiveCfg = Release|Any CPU + {99CCDA48-1CA3-46B9-89B8-0B45106304FC}.Release|x64.Build.0 = Release|Any CPU + {99CCDA48-1CA3-46B9-89B8-0B45106304FC}.Release|x86.ActiveCfg = Release|Any CPU + {99CCDA48-1CA3-46B9-89B8-0B45106304FC}.Release|x86.Build.0 = Release|Any CPU + {45A818E0-8CDF-44A5-B948-63D8DEB9982E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {45A818E0-8CDF-44A5-B948-63D8DEB9982E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {45A818E0-8CDF-44A5-B948-63D8DEB9982E}.Debug|x64.ActiveCfg = Debug|Any CPU + {45A818E0-8CDF-44A5-B948-63D8DEB9982E}.Debug|x64.Build.0 = Debug|Any CPU + {45A818E0-8CDF-44A5-B948-63D8DEB9982E}.Debug|x86.ActiveCfg = Debug|Any CPU + {45A818E0-8CDF-44A5-B948-63D8DEB9982E}.Debug|x86.Build.0 = Debug|Any CPU + {45A818E0-8CDF-44A5-B948-63D8DEB9982E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {45A818E0-8CDF-44A5-B948-63D8DEB9982E}.Release|Any CPU.Build.0 = Release|Any CPU + {45A818E0-8CDF-44A5-B948-63D8DEB9982E}.Release|x64.ActiveCfg = Release|Any CPU + {45A818E0-8CDF-44A5-B948-63D8DEB9982E}.Release|x64.Build.0 = Release|Any CPU + {45A818E0-8CDF-44A5-B948-63D8DEB9982E}.Release|x86.ActiveCfg = Release|Any CPU + {45A818E0-8CDF-44A5-B948-63D8DEB9982E}.Release|x86.Build.0 = Release|Any CPU + {B341FE12-9233-4E34-8C1C-4E62AC2F8AE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B341FE12-9233-4E34-8C1C-4E62AC2F8AE1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B341FE12-9233-4E34-8C1C-4E62AC2F8AE1}.Debug|x64.ActiveCfg = Debug|Any CPU + {B341FE12-9233-4E34-8C1C-4E62AC2F8AE1}.Debug|x64.Build.0 = Debug|Any CPU + {B341FE12-9233-4E34-8C1C-4E62AC2F8AE1}.Debug|x86.ActiveCfg = Debug|Any CPU + {B341FE12-9233-4E34-8C1C-4E62AC2F8AE1}.Debug|x86.Build.0 = Debug|Any CPU + {B341FE12-9233-4E34-8C1C-4E62AC2F8AE1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B341FE12-9233-4E34-8C1C-4E62AC2F8AE1}.Release|Any CPU.Build.0 = Release|Any CPU + {B341FE12-9233-4E34-8C1C-4E62AC2F8AE1}.Release|x64.ActiveCfg = Release|Any CPU + {B341FE12-9233-4E34-8C1C-4E62AC2F8AE1}.Release|x64.Build.0 = Release|Any CPU + {B341FE12-9233-4E34-8C1C-4E62AC2F8AE1}.Release|x86.ActiveCfg = Release|Any CPU + {B341FE12-9233-4E34-8C1C-4E62AC2F8AE1}.Release|x86.Build.0 = Release|Any CPU + {B7E811DB-8575-4C77-9AF9-49DA840557C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B7E811DB-8575-4C77-9AF9-49DA840557C2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B7E811DB-8575-4C77-9AF9-49DA840557C2}.Debug|x64.ActiveCfg = Debug|Any CPU + {B7E811DB-8575-4C77-9AF9-49DA840557C2}.Debug|x64.Build.0 = Debug|Any CPU + {B7E811DB-8575-4C77-9AF9-49DA840557C2}.Debug|x86.ActiveCfg = Debug|Any CPU + {B7E811DB-8575-4C77-9AF9-49DA840557C2}.Debug|x86.Build.0 = Debug|Any CPU + {B7E811DB-8575-4C77-9AF9-49DA840557C2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B7E811DB-8575-4C77-9AF9-49DA840557C2}.Release|Any CPU.Build.0 = Release|Any CPU + {B7E811DB-8575-4C77-9AF9-49DA840557C2}.Release|x64.ActiveCfg = Release|Any CPU + {B7E811DB-8575-4C77-9AF9-49DA840557C2}.Release|x64.Build.0 = Release|Any CPU + {B7E811DB-8575-4C77-9AF9-49DA840557C2}.Release|x86.ActiveCfg = Release|Any CPU + {B7E811DB-8575-4C77-9AF9-49DA840557C2}.Release|x86.Build.0 = Release|Any CPU + {FD52020A-6F1E-42FA-81CE-1F6A8E7C9737}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FD52020A-6F1E-42FA-81CE-1F6A8E7C9737}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FD52020A-6F1E-42FA-81CE-1F6A8E7C9737}.Debug|x64.ActiveCfg = Debug|Any CPU + {FD52020A-6F1E-42FA-81CE-1F6A8E7C9737}.Debug|x64.Build.0 = Debug|Any CPU + {FD52020A-6F1E-42FA-81CE-1F6A8E7C9737}.Debug|x86.ActiveCfg = Debug|Any CPU + {FD52020A-6F1E-42FA-81CE-1F6A8E7C9737}.Debug|x86.Build.0 = Debug|Any CPU + {FD52020A-6F1E-42FA-81CE-1F6A8E7C9737}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FD52020A-6F1E-42FA-81CE-1F6A8E7C9737}.Release|Any CPU.Build.0 = Release|Any CPU + {FD52020A-6F1E-42FA-81CE-1F6A8E7C9737}.Release|x64.ActiveCfg = Release|Any CPU + {FD52020A-6F1E-42FA-81CE-1F6A8E7C9737}.Release|x64.Build.0 = Release|Any CPU + {FD52020A-6F1E-42FA-81CE-1F6A8E7C9737}.Release|x86.ActiveCfg = Release|Any CPU + {FD52020A-6F1E-42FA-81CE-1F6A8E7C9737}.Release|x86.Build.0 = Release|Any CPU + {FED33EF6-AC47-4E9A-B615-66B16B846E94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FED33EF6-AC47-4E9A-B615-66B16B846E94}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FED33EF6-AC47-4E9A-B615-66B16B846E94}.Debug|x64.ActiveCfg = Debug|Any CPU + {FED33EF6-AC47-4E9A-B615-66B16B846E94}.Debug|x64.Build.0 = Debug|Any CPU + {FED33EF6-AC47-4E9A-B615-66B16B846E94}.Debug|x86.ActiveCfg = Debug|Any CPU + {FED33EF6-AC47-4E9A-B615-66B16B846E94}.Debug|x86.Build.0 = Debug|Any CPU + {FED33EF6-AC47-4E9A-B615-66B16B846E94}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FED33EF6-AC47-4E9A-B615-66B16B846E94}.Release|Any CPU.Build.0 = Release|Any CPU + {FED33EF6-AC47-4E9A-B615-66B16B846E94}.Release|x64.ActiveCfg = Release|Any CPU + {FED33EF6-AC47-4E9A-B615-66B16B846E94}.Release|x64.Build.0 = Release|Any CPU + {FED33EF6-AC47-4E9A-B615-66B16B846E94}.Release|x86.ActiveCfg = Release|Any CPU + {FED33EF6-AC47-4E9A-B615-66B16B846E94}.Release|x86.Build.0 = Release|Any CPU + {ACB24C7C-C92D-43F9-B1B1-9444696DAD36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ACB24C7C-C92D-43F9-B1B1-9444696DAD36}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ACB24C7C-C92D-43F9-B1B1-9444696DAD36}.Debug|x64.ActiveCfg = Debug|Any CPU + {ACB24C7C-C92D-43F9-B1B1-9444696DAD36}.Debug|x64.Build.0 = Debug|Any CPU + {ACB24C7C-C92D-43F9-B1B1-9444696DAD36}.Debug|x86.ActiveCfg = Debug|Any CPU + {ACB24C7C-C92D-43F9-B1B1-9444696DAD36}.Debug|x86.Build.0 = Debug|Any CPU + {ACB24C7C-C92D-43F9-B1B1-9444696DAD36}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ACB24C7C-C92D-43F9-B1B1-9444696DAD36}.Release|Any CPU.Build.0 = Release|Any CPU + {ACB24C7C-C92D-43F9-B1B1-9444696DAD36}.Release|x64.ActiveCfg = Release|Any CPU + {ACB24C7C-C92D-43F9-B1B1-9444696DAD36}.Release|x64.Build.0 = Release|Any CPU + {ACB24C7C-C92D-43F9-B1B1-9444696DAD36}.Release|x86.ActiveCfg = Release|Any CPU + {ACB24C7C-C92D-43F9-B1B1-9444696DAD36}.Release|x86.Build.0 = Release|Any CPU + {2C8C5AE3-D04F-48F4-8AF5-D7535277B7A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2C8C5AE3-D04F-48F4-8AF5-D7535277B7A0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2C8C5AE3-D04F-48F4-8AF5-D7535277B7A0}.Debug|x64.ActiveCfg = Debug|Any CPU + {2C8C5AE3-D04F-48F4-8AF5-D7535277B7A0}.Debug|x64.Build.0 = Debug|Any CPU + {2C8C5AE3-D04F-48F4-8AF5-D7535277B7A0}.Debug|x86.ActiveCfg = Debug|Any CPU + {2C8C5AE3-D04F-48F4-8AF5-D7535277B7A0}.Debug|x86.Build.0 = Debug|Any CPU + {2C8C5AE3-D04F-48F4-8AF5-D7535277B7A0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2C8C5AE3-D04F-48F4-8AF5-D7535277B7A0}.Release|Any CPU.Build.0 = Release|Any CPU + {2C8C5AE3-D04F-48F4-8AF5-D7535277B7A0}.Release|x64.ActiveCfg = Release|Any CPU + {2C8C5AE3-D04F-48F4-8AF5-D7535277B7A0}.Release|x64.Build.0 = Release|Any CPU + {2C8C5AE3-D04F-48F4-8AF5-D7535277B7A0}.Release|x86.ActiveCfg = Release|Any CPU + {2C8C5AE3-D04F-48F4-8AF5-D7535277B7A0}.Release|x86.Build.0 = Release|Any CPU + {A5417213-F20A-4C06-9D8B-8688B0C4EE61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A5417213-F20A-4C06-9D8B-8688B0C4EE61}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A5417213-F20A-4C06-9D8B-8688B0C4EE61}.Debug|x64.ActiveCfg = Debug|Any CPU + {A5417213-F20A-4C06-9D8B-8688B0C4EE61}.Debug|x64.Build.0 = Debug|Any CPU + {A5417213-F20A-4C06-9D8B-8688B0C4EE61}.Debug|x86.ActiveCfg = Debug|Any CPU + {A5417213-F20A-4C06-9D8B-8688B0C4EE61}.Debug|x86.Build.0 = Debug|Any CPU + {A5417213-F20A-4C06-9D8B-8688B0C4EE61}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A5417213-F20A-4C06-9D8B-8688B0C4EE61}.Release|Any CPU.Build.0 = Release|Any CPU + {A5417213-F20A-4C06-9D8B-8688B0C4EE61}.Release|x64.ActiveCfg = Release|Any CPU + {A5417213-F20A-4C06-9D8B-8688B0C4EE61}.Release|x64.Build.0 = Release|Any CPU + {A5417213-F20A-4C06-9D8B-8688B0C4EE61}.Release|x86.ActiveCfg = Release|Any CPU + {A5417213-F20A-4C06-9D8B-8688B0C4EE61}.Release|x86.Build.0 = Release|Any CPU + {A03A743F-C645-45CB-80A0-BE10D2FC1A13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A03A743F-C645-45CB-80A0-BE10D2FC1A13}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A03A743F-C645-45CB-80A0-BE10D2FC1A13}.Debug|x64.ActiveCfg = Debug|Any CPU + {A03A743F-C645-45CB-80A0-BE10D2FC1A13}.Debug|x64.Build.0 = Debug|Any CPU + {A03A743F-C645-45CB-80A0-BE10D2FC1A13}.Debug|x86.ActiveCfg = Debug|Any CPU + {A03A743F-C645-45CB-80A0-BE10D2FC1A13}.Debug|x86.Build.0 = Debug|Any CPU + {A03A743F-C645-45CB-80A0-BE10D2FC1A13}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A03A743F-C645-45CB-80A0-BE10D2FC1A13}.Release|Any CPU.Build.0 = Release|Any CPU + {A03A743F-C645-45CB-80A0-BE10D2FC1A13}.Release|x64.ActiveCfg = Release|Any CPU + {A03A743F-C645-45CB-80A0-BE10D2FC1A13}.Release|x64.Build.0 = Release|Any CPU + {A03A743F-C645-45CB-80A0-BE10D2FC1A13}.Release|x86.ActiveCfg = Release|Any CPU + {A03A743F-C645-45CB-80A0-BE10D2FC1A13}.Release|x86.Build.0 = Release|Any CPU + {29C6234D-5562-4495-A014-92388EE4518E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {29C6234D-5562-4495-A014-92388EE4518E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {29C6234D-5562-4495-A014-92388EE4518E}.Debug|x64.ActiveCfg = Debug|Any CPU + {29C6234D-5562-4495-A014-92388EE4518E}.Debug|x64.Build.0 = Debug|Any CPU + {29C6234D-5562-4495-A014-92388EE4518E}.Debug|x86.ActiveCfg = Debug|Any CPU + {29C6234D-5562-4495-A014-92388EE4518E}.Debug|x86.Build.0 = Debug|Any CPU + {29C6234D-5562-4495-A014-92388EE4518E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {29C6234D-5562-4495-A014-92388EE4518E}.Release|Any CPU.Build.0 = Release|Any CPU + {29C6234D-5562-4495-A014-92388EE4518E}.Release|x64.ActiveCfg = Release|Any CPU + {29C6234D-5562-4495-A014-92388EE4518E}.Release|x64.Build.0 = Release|Any CPU + {29C6234D-5562-4495-A014-92388EE4518E}.Release|x86.ActiveCfg = Release|Any CPU + {29C6234D-5562-4495-A014-92388EE4518E}.Release|x86.Build.0 = Release|Any CPU + {4427F391-652B-4804-BED4-7CD0D218FE28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4427F391-652B-4804-BED4-7CD0D218FE28}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4427F391-652B-4804-BED4-7CD0D218FE28}.Debug|x64.ActiveCfg = Debug|Any CPU + {4427F391-652B-4804-BED4-7CD0D218FE28}.Debug|x64.Build.0 = Debug|Any CPU + {4427F391-652B-4804-BED4-7CD0D218FE28}.Debug|x86.ActiveCfg = Debug|Any CPU + {4427F391-652B-4804-BED4-7CD0D218FE28}.Debug|x86.Build.0 = Debug|Any CPU + {4427F391-652B-4804-BED4-7CD0D218FE28}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4427F391-652B-4804-BED4-7CD0D218FE28}.Release|Any CPU.Build.0 = Release|Any CPU + {4427F391-652B-4804-BED4-7CD0D218FE28}.Release|x64.ActiveCfg = Release|Any CPU + {4427F391-652B-4804-BED4-7CD0D218FE28}.Release|x64.Build.0 = Release|Any CPU + {4427F391-652B-4804-BED4-7CD0D218FE28}.Release|x86.ActiveCfg = Release|Any CPU + {4427F391-652B-4804-BED4-7CD0D218FE28}.Release|x86.Build.0 = Release|Any CPU + {61BAD6B6-3A48-4E9B-8333-F1884F68A0A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {61BAD6B6-3A48-4E9B-8333-F1884F68A0A5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {61BAD6B6-3A48-4E9B-8333-F1884F68A0A5}.Debug|x64.ActiveCfg = Debug|Any CPU + {61BAD6B6-3A48-4E9B-8333-F1884F68A0A5}.Debug|x64.Build.0 = Debug|Any CPU + {61BAD6B6-3A48-4E9B-8333-F1884F68A0A5}.Debug|x86.ActiveCfg = Debug|Any CPU + {61BAD6B6-3A48-4E9B-8333-F1884F68A0A5}.Debug|x86.Build.0 = Debug|Any CPU + {61BAD6B6-3A48-4E9B-8333-F1884F68A0A5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {61BAD6B6-3A48-4E9B-8333-F1884F68A0A5}.Release|Any CPU.Build.0 = Release|Any CPU + {61BAD6B6-3A48-4E9B-8333-F1884F68A0A5}.Release|x64.ActiveCfg = Release|Any CPU + {61BAD6B6-3A48-4E9B-8333-F1884F68A0A5}.Release|x64.Build.0 = Release|Any CPU + {61BAD6B6-3A48-4E9B-8333-F1884F68A0A5}.Release|x86.ActiveCfg = Release|Any CPU + {61BAD6B6-3A48-4E9B-8333-F1884F68A0A5}.Release|x86.Build.0 = Release|Any CPU + {DE23A75D-E816-4988-BB2C-7EBEB5BEB6F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DE23A75D-E816-4988-BB2C-7EBEB5BEB6F1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DE23A75D-E816-4988-BB2C-7EBEB5BEB6F1}.Debug|x64.ActiveCfg = Debug|Any CPU + {DE23A75D-E816-4988-BB2C-7EBEB5BEB6F1}.Debug|x64.Build.0 = Debug|Any CPU + {DE23A75D-E816-4988-BB2C-7EBEB5BEB6F1}.Debug|x86.ActiveCfg = Debug|Any CPU + {DE23A75D-E816-4988-BB2C-7EBEB5BEB6F1}.Debug|x86.Build.0 = Debug|Any CPU + {DE23A75D-E816-4988-BB2C-7EBEB5BEB6F1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DE23A75D-E816-4988-BB2C-7EBEB5BEB6F1}.Release|Any CPU.Build.0 = Release|Any CPU + {DE23A75D-E816-4988-BB2C-7EBEB5BEB6F1}.Release|x64.ActiveCfg = Release|Any CPU + {DE23A75D-E816-4988-BB2C-7EBEB5BEB6F1}.Release|x64.Build.0 = Release|Any CPU + {DE23A75D-E816-4988-BB2C-7EBEB5BEB6F1}.Release|x86.ActiveCfg = Release|Any CPU + {DE23A75D-E816-4988-BB2C-7EBEB5BEB6F1}.Release|x86.Build.0 = Release|Any CPU + {0CC90F16-9B6C-4C87-A49B-600DB3DF0D2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0CC90F16-9B6C-4C87-A49B-600DB3DF0D2A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0CC90F16-9B6C-4C87-A49B-600DB3DF0D2A}.Debug|x64.ActiveCfg = Debug|Any CPU + {0CC90F16-9B6C-4C87-A49B-600DB3DF0D2A}.Debug|x64.Build.0 = Debug|Any CPU + {0CC90F16-9B6C-4C87-A49B-600DB3DF0D2A}.Debug|x86.ActiveCfg = Debug|Any CPU + {0CC90F16-9B6C-4C87-A49B-600DB3DF0D2A}.Debug|x86.Build.0 = Debug|Any CPU + {0CC90F16-9B6C-4C87-A49B-600DB3DF0D2A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0CC90F16-9B6C-4C87-A49B-600DB3DF0D2A}.Release|Any CPU.Build.0 = Release|Any CPU + {0CC90F16-9B6C-4C87-A49B-600DB3DF0D2A}.Release|x64.ActiveCfg = Release|Any CPU + {0CC90F16-9B6C-4C87-A49B-600DB3DF0D2A}.Release|x64.Build.0 = Release|Any CPU + {0CC90F16-9B6C-4C87-A49B-600DB3DF0D2A}.Release|x86.ActiveCfg = Release|Any CPU + {0CC90F16-9B6C-4C87-A49B-600DB3DF0D2A}.Release|x86.Build.0 = Release|Any CPU + {4D68748B-6DEF-4E05-830C-43AF09B2CE8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4D68748B-6DEF-4E05-830C-43AF09B2CE8A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4D68748B-6DEF-4E05-830C-43AF09B2CE8A}.Debug|x64.ActiveCfg = Debug|Any CPU + {4D68748B-6DEF-4E05-830C-43AF09B2CE8A}.Debug|x64.Build.0 = Debug|Any CPU + {4D68748B-6DEF-4E05-830C-43AF09B2CE8A}.Debug|x86.ActiveCfg = Debug|Any CPU + {4D68748B-6DEF-4E05-830C-43AF09B2CE8A}.Debug|x86.Build.0 = Debug|Any CPU + {4D68748B-6DEF-4E05-830C-43AF09B2CE8A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4D68748B-6DEF-4E05-830C-43AF09B2CE8A}.Release|Any CPU.Build.0 = Release|Any CPU + {4D68748B-6DEF-4E05-830C-43AF09B2CE8A}.Release|x64.ActiveCfg = Release|Any CPU + {4D68748B-6DEF-4E05-830C-43AF09B2CE8A}.Release|x64.Build.0 = Release|Any CPU + {4D68748B-6DEF-4E05-830C-43AF09B2CE8A}.Release|x86.ActiveCfg = Release|Any CPU + {4D68748B-6DEF-4E05-830C-43AF09B2CE8A}.Release|x86.Build.0 = Release|Any CPU + {91CF9FC4-105B-4E21-8692-1D5E539E42E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {91CF9FC4-105B-4E21-8692-1D5E539E42E9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {91CF9FC4-105B-4E21-8692-1D5E539E42E9}.Debug|x64.ActiveCfg = Debug|Any CPU + {91CF9FC4-105B-4E21-8692-1D5E539E42E9}.Debug|x64.Build.0 = Debug|Any CPU + {91CF9FC4-105B-4E21-8692-1D5E539E42E9}.Debug|x86.ActiveCfg = Debug|Any CPU + {91CF9FC4-105B-4E21-8692-1D5E539E42E9}.Debug|x86.Build.0 = Debug|Any CPU + {91CF9FC4-105B-4E21-8692-1D5E539E42E9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {91CF9FC4-105B-4E21-8692-1D5E539E42E9}.Release|Any CPU.Build.0 = Release|Any CPU + {91CF9FC4-105B-4E21-8692-1D5E539E42E9}.Release|x64.ActiveCfg = Release|Any CPU + {91CF9FC4-105B-4E21-8692-1D5E539E42E9}.Release|x64.Build.0 = Release|Any CPU + {91CF9FC4-105B-4E21-8692-1D5E539E42E9}.Release|x86.ActiveCfg = Release|Any CPU + {91CF9FC4-105B-4E21-8692-1D5E539E42E9}.Release|x86.Build.0 = Release|Any CPU + {D504C93E-AE1A-4852-9727-6E565632D38E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D504C93E-AE1A-4852-9727-6E565632D38E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D504C93E-AE1A-4852-9727-6E565632D38E}.Debug|x64.ActiveCfg = Debug|Any CPU + {D504C93E-AE1A-4852-9727-6E565632D38E}.Debug|x64.Build.0 = Debug|Any CPU + {D504C93E-AE1A-4852-9727-6E565632D38E}.Debug|x86.ActiveCfg = Debug|Any CPU + {D504C93E-AE1A-4852-9727-6E565632D38E}.Debug|x86.Build.0 = Debug|Any CPU + {D504C93E-AE1A-4852-9727-6E565632D38E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D504C93E-AE1A-4852-9727-6E565632D38E}.Release|Any CPU.Build.0 = Release|Any CPU + {D504C93E-AE1A-4852-9727-6E565632D38E}.Release|x64.ActiveCfg = Release|Any CPU + {D504C93E-AE1A-4852-9727-6E565632D38E}.Release|x64.Build.0 = Release|Any CPU + {D504C93E-AE1A-4852-9727-6E565632D38E}.Release|x86.ActiveCfg = Release|Any CPU + {D504C93E-AE1A-4852-9727-6E565632D38E}.Release|x86.Build.0 = Release|Any CPU + {1632128F-A60B-49B8-A5DB-05F3F1A3B84C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1632128F-A60B-49B8-A5DB-05F3F1A3B84C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1632128F-A60B-49B8-A5DB-05F3F1A3B84C}.Debug|x64.ActiveCfg = Debug|Any CPU + {1632128F-A60B-49B8-A5DB-05F3F1A3B84C}.Debug|x64.Build.0 = Debug|Any CPU + {1632128F-A60B-49B8-A5DB-05F3F1A3B84C}.Debug|x86.ActiveCfg = Debug|Any CPU + {1632128F-A60B-49B8-A5DB-05F3F1A3B84C}.Debug|x86.Build.0 = Debug|Any CPU + {1632128F-A60B-49B8-A5DB-05F3F1A3B84C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1632128F-A60B-49B8-A5DB-05F3F1A3B84C}.Release|Any CPU.Build.0 = Release|Any CPU + {1632128F-A60B-49B8-A5DB-05F3F1A3B84C}.Release|x64.ActiveCfg = Release|Any CPU + {1632128F-A60B-49B8-A5DB-05F3F1A3B84C}.Release|x64.Build.0 = Release|Any CPU + {1632128F-A60B-49B8-A5DB-05F3F1A3B84C}.Release|x86.ActiveCfg = Release|Any CPU + {1632128F-A60B-49B8-A5DB-05F3F1A3B84C}.Release|x86.Build.0 = Release|Any CPU + {8CA92DF0-3C60-4F23-9890-806744E1F514}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8CA92DF0-3C60-4F23-9890-806744E1F514}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8CA92DF0-3C60-4F23-9890-806744E1F514}.Debug|x64.ActiveCfg = Debug|Any CPU + {8CA92DF0-3C60-4F23-9890-806744E1F514}.Debug|x64.Build.0 = Debug|Any CPU + {8CA92DF0-3C60-4F23-9890-806744E1F514}.Debug|x86.ActiveCfg = Debug|Any CPU + {8CA92DF0-3C60-4F23-9890-806744E1F514}.Debug|x86.Build.0 = Debug|Any CPU + {8CA92DF0-3C60-4F23-9890-806744E1F514}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8CA92DF0-3C60-4F23-9890-806744E1F514}.Release|Any CPU.Build.0 = Release|Any CPU + {8CA92DF0-3C60-4F23-9890-806744E1F514}.Release|x64.ActiveCfg = Release|Any CPU + {8CA92DF0-3C60-4F23-9890-806744E1F514}.Release|x64.Build.0 = Release|Any CPU + {8CA92DF0-3C60-4F23-9890-806744E1F514}.Release|x86.ActiveCfg = Release|Any CPU + {8CA92DF0-3C60-4F23-9890-806744E1F514}.Release|x86.Build.0 = Release|Any CPU + {507ED1D4-F905-4AAD-897D-AD403FA56663}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {507ED1D4-F905-4AAD-897D-AD403FA56663}.Debug|Any CPU.Build.0 = Debug|Any CPU + {507ED1D4-F905-4AAD-897D-AD403FA56663}.Debug|x64.ActiveCfg = Debug|Any CPU + {507ED1D4-F905-4AAD-897D-AD403FA56663}.Debug|x64.Build.0 = Debug|Any CPU + {507ED1D4-F905-4AAD-897D-AD403FA56663}.Debug|x86.ActiveCfg = Debug|Any CPU + {507ED1D4-F905-4AAD-897D-AD403FA56663}.Debug|x86.Build.0 = Debug|Any CPU + {507ED1D4-F905-4AAD-897D-AD403FA56663}.Release|Any CPU.ActiveCfg = Release|Any CPU + {507ED1D4-F905-4AAD-897D-AD403FA56663}.Release|Any CPU.Build.0 = Release|Any CPU + {507ED1D4-F905-4AAD-897D-AD403FA56663}.Release|x64.ActiveCfg = Release|Any CPU + {507ED1D4-F905-4AAD-897D-AD403FA56663}.Release|x64.Build.0 = Release|Any CPU + {507ED1D4-F905-4AAD-897D-AD403FA56663}.Release|x86.ActiveCfg = Release|Any CPU + {507ED1D4-F905-4AAD-897D-AD403FA56663}.Release|x86.Build.0 = Release|Any CPU + {C9ADF8BA-8239-4514-8906-A8E09A1A874C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C9ADF8BA-8239-4514-8906-A8E09A1A874C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C9ADF8BA-8239-4514-8906-A8E09A1A874C}.Debug|x64.ActiveCfg = Debug|Any CPU + {C9ADF8BA-8239-4514-8906-A8E09A1A874C}.Debug|x64.Build.0 = Debug|Any CPU + {C9ADF8BA-8239-4514-8906-A8E09A1A874C}.Debug|x86.ActiveCfg = Debug|Any CPU + {C9ADF8BA-8239-4514-8906-A8E09A1A874C}.Debug|x86.Build.0 = Debug|Any CPU + {C9ADF8BA-8239-4514-8906-A8E09A1A874C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C9ADF8BA-8239-4514-8906-A8E09A1A874C}.Release|Any CPU.Build.0 = Release|Any CPU + {C9ADF8BA-8239-4514-8906-A8E09A1A874C}.Release|x64.ActiveCfg = Release|Any CPU + {C9ADF8BA-8239-4514-8906-A8E09A1A874C}.Release|x64.Build.0 = Release|Any CPU + {C9ADF8BA-8239-4514-8906-A8E09A1A874C}.Release|x86.ActiveCfg = Release|Any CPU + {C9ADF8BA-8239-4514-8906-A8E09A1A874C}.Release|x86.Build.0 = Release|Any CPU + {7370EDAC-0F7C-4008-A8C6-8C6240EE518E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7370EDAC-0F7C-4008-A8C6-8C6240EE518E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7370EDAC-0F7C-4008-A8C6-8C6240EE518E}.Debug|x64.ActiveCfg = Debug|Any CPU + {7370EDAC-0F7C-4008-A8C6-8C6240EE518E}.Debug|x64.Build.0 = Debug|Any CPU + {7370EDAC-0F7C-4008-A8C6-8C6240EE518E}.Debug|x86.ActiveCfg = Debug|Any CPU + {7370EDAC-0F7C-4008-A8C6-8C6240EE518E}.Debug|x86.Build.0 = Debug|Any CPU + {7370EDAC-0F7C-4008-A8C6-8C6240EE518E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7370EDAC-0F7C-4008-A8C6-8C6240EE518E}.Release|Any CPU.Build.0 = Release|Any CPU + {7370EDAC-0F7C-4008-A8C6-8C6240EE518E}.Release|x64.ActiveCfg = Release|Any CPU + {7370EDAC-0F7C-4008-A8C6-8C6240EE518E}.Release|x64.Build.0 = Release|Any CPU + {7370EDAC-0F7C-4008-A8C6-8C6240EE518E}.Release|x86.ActiveCfg = Release|Any CPU + {7370EDAC-0F7C-4008-A8C6-8C6240EE518E}.Release|x86.Build.0 = Release|Any CPU + {6B934B23-6A75-42FC-9B6C-B3F4CFA6673F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6B934B23-6A75-42FC-9B6C-B3F4CFA6673F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6B934B23-6A75-42FC-9B6C-B3F4CFA6673F}.Debug|x64.ActiveCfg = Debug|Any CPU + {6B934B23-6A75-42FC-9B6C-B3F4CFA6673F}.Debug|x64.Build.0 = Debug|Any CPU + {6B934B23-6A75-42FC-9B6C-B3F4CFA6673F}.Debug|x86.ActiveCfg = Debug|Any CPU + {6B934B23-6A75-42FC-9B6C-B3F4CFA6673F}.Debug|x86.Build.0 = Debug|Any CPU + {6B934B23-6A75-42FC-9B6C-B3F4CFA6673F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6B934B23-6A75-42FC-9B6C-B3F4CFA6673F}.Release|Any CPU.Build.0 = Release|Any CPU + {6B934B23-6A75-42FC-9B6C-B3F4CFA6673F}.Release|x64.ActiveCfg = Release|Any CPU + {6B934B23-6A75-42FC-9B6C-B3F4CFA6673F}.Release|x64.Build.0 = Release|Any CPU + {6B934B23-6A75-42FC-9B6C-B3F4CFA6673F}.Release|x86.ActiveCfg = Release|Any CPU + {6B934B23-6A75-42FC-9B6C-B3F4CFA6673F}.Release|x86.Build.0 = Release|Any CPU + {AFA39C3B-C0A0-445C-8129-4DFD3009B56E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AFA39C3B-C0A0-445C-8129-4DFD3009B56E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AFA39C3B-C0A0-445C-8129-4DFD3009B56E}.Debug|x64.ActiveCfg = Debug|Any CPU + {AFA39C3B-C0A0-445C-8129-4DFD3009B56E}.Debug|x64.Build.0 = Debug|Any CPU + {AFA39C3B-C0A0-445C-8129-4DFD3009B56E}.Debug|x86.ActiveCfg = Debug|Any CPU + {AFA39C3B-C0A0-445C-8129-4DFD3009B56E}.Debug|x86.Build.0 = Debug|Any CPU + {AFA39C3B-C0A0-445C-8129-4DFD3009B56E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AFA39C3B-C0A0-445C-8129-4DFD3009B56E}.Release|Any CPU.Build.0 = Release|Any CPU + {AFA39C3B-C0A0-445C-8129-4DFD3009B56E}.Release|x64.ActiveCfg = Release|Any CPU + {AFA39C3B-C0A0-445C-8129-4DFD3009B56E}.Release|x64.Build.0 = Release|Any CPU + {AFA39C3B-C0A0-445C-8129-4DFD3009B56E}.Release|x86.ActiveCfg = Release|Any CPU + {AFA39C3B-C0A0-445C-8129-4DFD3009B56E}.Release|x86.Build.0 = Release|Any CPU + {BCC05EA8-DB49-4684-9888-1B8688BE3FA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BCC05EA8-DB49-4684-9888-1B8688BE3FA6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BCC05EA8-DB49-4684-9888-1B8688BE3FA6}.Debug|x64.ActiveCfg = Debug|Any CPU + {BCC05EA8-DB49-4684-9888-1B8688BE3FA6}.Debug|x64.Build.0 = Debug|Any CPU + {BCC05EA8-DB49-4684-9888-1B8688BE3FA6}.Debug|x86.ActiveCfg = Debug|Any CPU + {BCC05EA8-DB49-4684-9888-1B8688BE3FA6}.Debug|x86.Build.0 = Debug|Any CPU + {BCC05EA8-DB49-4684-9888-1B8688BE3FA6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BCC05EA8-DB49-4684-9888-1B8688BE3FA6}.Release|Any CPU.Build.0 = Release|Any CPU + {BCC05EA8-DB49-4684-9888-1B8688BE3FA6}.Release|x64.ActiveCfg = Release|Any CPU + {BCC05EA8-DB49-4684-9888-1B8688BE3FA6}.Release|x64.Build.0 = Release|Any CPU + {BCC05EA8-DB49-4684-9888-1B8688BE3FA6}.Release|x86.ActiveCfg = Release|Any CPU + {BCC05EA8-DB49-4684-9888-1B8688BE3FA6}.Release|x86.Build.0 = Release|Any CPU + {87FCABD0-2762-464E-9489-415E95D12427}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {87FCABD0-2762-464E-9489-415E95D12427}.Debug|Any CPU.Build.0 = Debug|Any CPU + {87FCABD0-2762-464E-9489-415E95D12427}.Debug|x64.ActiveCfg = Debug|Any CPU + {87FCABD0-2762-464E-9489-415E95D12427}.Debug|x64.Build.0 = Debug|Any CPU + {87FCABD0-2762-464E-9489-415E95D12427}.Debug|x86.ActiveCfg = Debug|Any CPU + {87FCABD0-2762-464E-9489-415E95D12427}.Debug|x86.Build.0 = Debug|Any CPU + {87FCABD0-2762-464E-9489-415E95D12427}.Release|Any CPU.ActiveCfg = Release|Any CPU + {87FCABD0-2762-464E-9489-415E95D12427}.Release|Any CPU.Build.0 = Release|Any CPU + {87FCABD0-2762-464E-9489-415E95D12427}.Release|x64.ActiveCfg = Release|Any CPU + {87FCABD0-2762-464E-9489-415E95D12427}.Release|x64.Build.0 = Release|Any CPU + {87FCABD0-2762-464E-9489-415E95D12427}.Release|x86.ActiveCfg = Release|Any CPU + {87FCABD0-2762-464E-9489-415E95D12427}.Release|x86.Build.0 = Release|Any CPU + {C84E079F-9790-425A-9C86-C69122811E6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C84E079F-9790-425A-9C86-C69122811E6F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C84E079F-9790-425A-9C86-C69122811E6F}.Debug|x64.ActiveCfg = Debug|Any CPU + {C84E079F-9790-425A-9C86-C69122811E6F}.Debug|x64.Build.0 = Debug|Any CPU + {C84E079F-9790-425A-9C86-C69122811E6F}.Debug|x86.ActiveCfg = Debug|Any CPU + {C84E079F-9790-425A-9C86-C69122811E6F}.Debug|x86.Build.0 = Debug|Any CPU + {C84E079F-9790-425A-9C86-C69122811E6F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C84E079F-9790-425A-9C86-C69122811E6F}.Release|Any CPU.Build.0 = Release|Any CPU + {C84E079F-9790-425A-9C86-C69122811E6F}.Release|x64.ActiveCfg = Release|Any CPU + {C84E079F-9790-425A-9C86-C69122811E6F}.Release|x64.Build.0 = Release|Any CPU + {C84E079F-9790-425A-9C86-C69122811E6F}.Release|x86.ActiveCfg = Release|Any CPU + {C84E079F-9790-425A-9C86-C69122811E6F}.Release|x86.Build.0 = Release|Any CPU + {F437861F-4FF8-418E-B205-FB04D23E0312}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F437861F-4FF8-418E-B205-FB04D23E0312}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F437861F-4FF8-418E-B205-FB04D23E0312}.Debug|x64.ActiveCfg = Debug|Any CPU + {F437861F-4FF8-418E-B205-FB04D23E0312}.Debug|x64.Build.0 = Debug|Any CPU + {F437861F-4FF8-418E-B205-FB04D23E0312}.Debug|x86.ActiveCfg = Debug|Any CPU + {F437861F-4FF8-418E-B205-FB04D23E0312}.Debug|x86.Build.0 = Debug|Any CPU + {F437861F-4FF8-418E-B205-FB04D23E0312}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F437861F-4FF8-418E-B205-FB04D23E0312}.Release|Any CPU.Build.0 = Release|Any CPU + {F437861F-4FF8-418E-B205-FB04D23E0312}.Release|x64.ActiveCfg = Release|Any CPU + {F437861F-4FF8-418E-B205-FB04D23E0312}.Release|x64.Build.0 = Release|Any CPU + {F437861F-4FF8-418E-B205-FB04D23E0312}.Release|x86.ActiveCfg = Release|Any CPU + {F437861F-4FF8-418E-B205-FB04D23E0312}.Release|x86.Build.0 = Release|Any CPU + {6A9E4125-03D1-4DAF-8333-336C49360621}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6A9E4125-03D1-4DAF-8333-336C49360621}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6A9E4125-03D1-4DAF-8333-336C49360621}.Debug|x64.ActiveCfg = Debug|Any CPU + {6A9E4125-03D1-4DAF-8333-336C49360621}.Debug|x64.Build.0 = Debug|Any CPU + {6A9E4125-03D1-4DAF-8333-336C49360621}.Debug|x86.ActiveCfg = Debug|Any CPU + {6A9E4125-03D1-4DAF-8333-336C49360621}.Debug|x86.Build.0 = Debug|Any CPU + {6A9E4125-03D1-4DAF-8333-336C49360621}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6A9E4125-03D1-4DAF-8333-336C49360621}.Release|Any CPU.Build.0 = Release|Any CPU + {6A9E4125-03D1-4DAF-8333-336C49360621}.Release|x64.ActiveCfg = Release|Any CPU + {6A9E4125-03D1-4DAF-8333-336C49360621}.Release|x64.Build.0 = Release|Any CPU + {6A9E4125-03D1-4DAF-8333-336C49360621}.Release|x86.ActiveCfg = Release|Any CPU + {6A9E4125-03D1-4DAF-8333-336C49360621}.Release|x86.Build.0 = Release|Any CPU + {1BA7884A-3D6F-4479-A0F9-44385662FE24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1BA7884A-3D6F-4479-A0F9-44385662FE24}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1BA7884A-3D6F-4479-A0F9-44385662FE24}.Debug|x64.ActiveCfg = Debug|Any CPU + {1BA7884A-3D6F-4479-A0F9-44385662FE24}.Debug|x64.Build.0 = Debug|Any CPU + {1BA7884A-3D6F-4479-A0F9-44385662FE24}.Debug|x86.ActiveCfg = Debug|Any CPU + {1BA7884A-3D6F-4479-A0F9-44385662FE24}.Debug|x86.Build.0 = Debug|Any CPU + {1BA7884A-3D6F-4479-A0F9-44385662FE24}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1BA7884A-3D6F-4479-A0F9-44385662FE24}.Release|Any CPU.Build.0 = Release|Any CPU + {1BA7884A-3D6F-4479-A0F9-44385662FE24}.Release|x64.ActiveCfg = Release|Any CPU + {1BA7884A-3D6F-4479-A0F9-44385662FE24}.Release|x64.Build.0 = Release|Any CPU + {1BA7884A-3D6F-4479-A0F9-44385662FE24}.Release|x86.ActiveCfg = Release|Any CPU + {1BA7884A-3D6F-4479-A0F9-44385662FE24}.Release|x86.Build.0 = Release|Any CPU + {FBE7E7D4-EBF1-4B0C-B63E-540DA1C9CEAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FBE7E7D4-EBF1-4B0C-B63E-540DA1C9CEAA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FBE7E7D4-EBF1-4B0C-B63E-540DA1C9CEAA}.Debug|x64.ActiveCfg = Debug|Any CPU + {FBE7E7D4-EBF1-4B0C-B63E-540DA1C9CEAA}.Debug|x64.Build.0 = Debug|Any CPU + {FBE7E7D4-EBF1-4B0C-B63E-540DA1C9CEAA}.Debug|x86.ActiveCfg = Debug|Any CPU + {FBE7E7D4-EBF1-4B0C-B63E-540DA1C9CEAA}.Debug|x86.Build.0 = Debug|Any CPU + {FBE7E7D4-EBF1-4B0C-B63E-540DA1C9CEAA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FBE7E7D4-EBF1-4B0C-B63E-540DA1C9CEAA}.Release|Any CPU.Build.0 = Release|Any CPU + {FBE7E7D4-EBF1-4B0C-B63E-540DA1C9CEAA}.Release|x64.ActiveCfg = Release|Any CPU + {FBE7E7D4-EBF1-4B0C-B63E-540DA1C9CEAA}.Release|x64.Build.0 = Release|Any CPU + {FBE7E7D4-EBF1-4B0C-B63E-540DA1C9CEAA}.Release|x86.ActiveCfg = Release|Any CPU + {FBE7E7D4-EBF1-4B0C-B63E-540DA1C9CEAA}.Release|x86.Build.0 = Release|Any CPU + {7E047279-FD70-440F-8FB9-B47E88747EF4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7E047279-FD70-440F-8FB9-B47E88747EF4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7E047279-FD70-440F-8FB9-B47E88747EF4}.Debug|x64.ActiveCfg = Debug|Any CPU + {7E047279-FD70-440F-8FB9-B47E88747EF4}.Debug|x64.Build.0 = Debug|Any CPU + {7E047279-FD70-440F-8FB9-B47E88747EF4}.Debug|x86.ActiveCfg = Debug|Any CPU + {7E047279-FD70-440F-8FB9-B47E88747EF4}.Debug|x86.Build.0 = Debug|Any CPU + {7E047279-FD70-440F-8FB9-B47E88747EF4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7E047279-FD70-440F-8FB9-B47E88747EF4}.Release|Any CPU.Build.0 = Release|Any CPU + {7E047279-FD70-440F-8FB9-B47E88747EF4}.Release|x64.ActiveCfg = Release|Any CPU + {7E047279-FD70-440F-8FB9-B47E88747EF4}.Release|x64.Build.0 = Release|Any CPU + {7E047279-FD70-440F-8FB9-B47E88747EF4}.Release|x86.ActiveCfg = Release|Any CPU + {7E047279-FD70-440F-8FB9-B47E88747EF4}.Release|x86.Build.0 = Release|Any CPU + {A60E1C9A-6E52-42F7-ACA2-BB58DA64361E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A60E1C9A-6E52-42F7-ACA2-BB58DA64361E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A60E1C9A-6E52-42F7-ACA2-BB58DA64361E}.Debug|x64.ActiveCfg = Debug|Any CPU + {A60E1C9A-6E52-42F7-ACA2-BB58DA64361E}.Debug|x64.Build.0 = Debug|Any CPU + {A60E1C9A-6E52-42F7-ACA2-BB58DA64361E}.Debug|x86.ActiveCfg = Debug|Any CPU + {A60E1C9A-6E52-42F7-ACA2-BB58DA64361E}.Debug|x86.Build.0 = Debug|Any CPU + {A60E1C9A-6E52-42F7-ACA2-BB58DA64361E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A60E1C9A-6E52-42F7-ACA2-BB58DA64361E}.Release|Any CPU.Build.0 = Release|Any CPU + {A60E1C9A-6E52-42F7-ACA2-BB58DA64361E}.Release|x64.ActiveCfg = Release|Any CPU + {A60E1C9A-6E52-42F7-ACA2-BB58DA64361E}.Release|x64.Build.0 = Release|Any CPU + {A60E1C9A-6E52-42F7-ACA2-BB58DA64361E}.Release|x86.ActiveCfg = Release|Any CPU + {A60E1C9A-6E52-42F7-ACA2-BB58DA64361E}.Release|x86.Build.0 = Release|Any CPU + {427A9EFA-5E06-4176-A287-0DC0E0CD3E86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {427A9EFA-5E06-4176-A287-0DC0E0CD3E86}.Debug|Any CPU.Build.0 = Debug|Any CPU + {427A9EFA-5E06-4176-A287-0DC0E0CD3E86}.Debug|x64.ActiveCfg = Debug|Any CPU + {427A9EFA-5E06-4176-A287-0DC0E0CD3E86}.Debug|x64.Build.0 = Debug|Any CPU + {427A9EFA-5E06-4176-A287-0DC0E0CD3E86}.Debug|x86.ActiveCfg = Debug|Any CPU + {427A9EFA-5E06-4176-A287-0DC0E0CD3E86}.Debug|x86.Build.0 = Debug|Any CPU + {427A9EFA-5E06-4176-A287-0DC0E0CD3E86}.Release|Any CPU.ActiveCfg = Release|Any CPU + {427A9EFA-5E06-4176-A287-0DC0E0CD3E86}.Release|Any CPU.Build.0 = Release|Any CPU + {427A9EFA-5E06-4176-A287-0DC0E0CD3E86}.Release|x64.ActiveCfg = Release|Any CPU + {427A9EFA-5E06-4176-A287-0DC0E0CD3E86}.Release|x64.Build.0 = Release|Any CPU + {427A9EFA-5E06-4176-A287-0DC0E0CD3E86}.Release|x86.ActiveCfg = Release|Any CPU + {427A9EFA-5E06-4176-A287-0DC0E0CD3E86}.Release|x86.Build.0 = Release|Any CPU + {4B864ACE-495C-46FB-870F-4D794C02C8F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4B864ACE-495C-46FB-870F-4D794C02C8F9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4B864ACE-495C-46FB-870F-4D794C02C8F9}.Debug|x64.ActiveCfg = Debug|Any CPU + {4B864ACE-495C-46FB-870F-4D794C02C8F9}.Debug|x64.Build.0 = Debug|Any CPU + {4B864ACE-495C-46FB-870F-4D794C02C8F9}.Debug|x86.ActiveCfg = Debug|Any CPU + {4B864ACE-495C-46FB-870F-4D794C02C8F9}.Debug|x86.Build.0 = Debug|Any CPU + {4B864ACE-495C-46FB-870F-4D794C02C8F9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4B864ACE-495C-46FB-870F-4D794C02C8F9}.Release|Any CPU.Build.0 = Release|Any CPU + {4B864ACE-495C-46FB-870F-4D794C02C8F9}.Release|x64.ActiveCfg = Release|Any CPU + {4B864ACE-495C-46FB-870F-4D794C02C8F9}.Release|x64.Build.0 = Release|Any CPU + {4B864ACE-495C-46FB-870F-4D794C02C8F9}.Release|x86.ActiveCfg = Release|Any CPU + {4B864ACE-495C-46FB-870F-4D794C02C8F9}.Release|x86.Build.0 = Release|Any CPU + {17419CBD-2AC6-479F-ACA7-D478F9FBF397}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {17419CBD-2AC6-479F-ACA7-D478F9FBF397}.Debug|Any CPU.Build.0 = Debug|Any CPU + {17419CBD-2AC6-479F-ACA7-D478F9FBF397}.Debug|x64.ActiveCfg = Debug|Any CPU + {17419CBD-2AC6-479F-ACA7-D478F9FBF397}.Debug|x64.Build.0 = Debug|Any CPU + {17419CBD-2AC6-479F-ACA7-D478F9FBF397}.Debug|x86.ActiveCfg = Debug|Any CPU + {17419CBD-2AC6-479F-ACA7-D478F9FBF397}.Debug|x86.Build.0 = Debug|Any CPU + {17419CBD-2AC6-479F-ACA7-D478F9FBF397}.Release|Any CPU.ActiveCfg = Release|Any CPU + {17419CBD-2AC6-479F-ACA7-D478F9FBF397}.Release|Any CPU.Build.0 = Release|Any CPU + {17419CBD-2AC6-479F-ACA7-D478F9FBF397}.Release|x64.ActiveCfg = Release|Any CPU + {17419CBD-2AC6-479F-ACA7-D478F9FBF397}.Release|x64.Build.0 = Release|Any CPU + {17419CBD-2AC6-479F-ACA7-D478F9FBF397}.Release|x86.ActiveCfg = Release|Any CPU + {17419CBD-2AC6-479F-ACA7-D478F9FBF397}.Release|x86.Build.0 = Release|Any CPU + {03856292-CE47-45EE-91D4-6ACF27E1925F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {03856292-CE47-45EE-91D4-6ACF27E1925F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {03856292-CE47-45EE-91D4-6ACF27E1925F}.Debug|x64.ActiveCfg = Debug|Any CPU + {03856292-CE47-45EE-91D4-6ACF27E1925F}.Debug|x64.Build.0 = Debug|Any CPU + {03856292-CE47-45EE-91D4-6ACF27E1925F}.Debug|x86.ActiveCfg = Debug|Any CPU + {03856292-CE47-45EE-91D4-6ACF27E1925F}.Debug|x86.Build.0 = Debug|Any CPU + {03856292-CE47-45EE-91D4-6ACF27E1925F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {03856292-CE47-45EE-91D4-6ACF27E1925F}.Release|Any CPU.Build.0 = Release|Any CPU + {03856292-CE47-45EE-91D4-6ACF27E1925F}.Release|x64.ActiveCfg = Release|Any CPU + {03856292-CE47-45EE-91D4-6ACF27E1925F}.Release|x64.Build.0 = Release|Any CPU + {03856292-CE47-45EE-91D4-6ACF27E1925F}.Release|x86.ActiveCfg = Release|Any CPU + {03856292-CE47-45EE-91D4-6ACF27E1925F}.Release|x86.Build.0 = Release|Any CPU + {762A1A84-4B1E-49A1-BC58-4988BB489F7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {762A1A84-4B1E-49A1-BC58-4988BB489F7C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {762A1A84-4B1E-49A1-BC58-4988BB489F7C}.Debug|x64.ActiveCfg = Debug|Any CPU + {762A1A84-4B1E-49A1-BC58-4988BB489F7C}.Debug|x64.Build.0 = Debug|Any CPU + {762A1A84-4B1E-49A1-BC58-4988BB489F7C}.Debug|x86.ActiveCfg = Debug|Any CPU + {762A1A84-4B1E-49A1-BC58-4988BB489F7C}.Debug|x86.Build.0 = Debug|Any CPU + {762A1A84-4B1E-49A1-BC58-4988BB489F7C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {762A1A84-4B1E-49A1-BC58-4988BB489F7C}.Release|Any CPU.Build.0 = Release|Any CPU + {762A1A84-4B1E-49A1-BC58-4988BB489F7C}.Release|x64.ActiveCfg = Release|Any CPU + {762A1A84-4B1E-49A1-BC58-4988BB489F7C}.Release|x64.Build.0 = Release|Any CPU + {762A1A84-4B1E-49A1-BC58-4988BB489F7C}.Release|x86.ActiveCfg = Release|Any CPU + {762A1A84-4B1E-49A1-BC58-4988BB489F7C}.Release|x86.Build.0 = Release|Any CPU + {3B42D204-BFB1-456F-B5F5-9421EECE465A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3B42D204-BFB1-456F-B5F5-9421EECE465A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3B42D204-BFB1-456F-B5F5-9421EECE465A}.Debug|x64.ActiveCfg = Debug|Any CPU + {3B42D204-BFB1-456F-B5F5-9421EECE465A}.Debug|x64.Build.0 = Debug|Any CPU + {3B42D204-BFB1-456F-B5F5-9421EECE465A}.Debug|x86.ActiveCfg = Debug|Any CPU + {3B42D204-BFB1-456F-B5F5-9421EECE465A}.Debug|x86.Build.0 = Debug|Any CPU + {3B42D204-BFB1-456F-B5F5-9421EECE465A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3B42D204-BFB1-456F-B5F5-9421EECE465A}.Release|Any CPU.Build.0 = Release|Any CPU + {3B42D204-BFB1-456F-B5F5-9421EECE465A}.Release|x64.ActiveCfg = Release|Any CPU + {3B42D204-BFB1-456F-B5F5-9421EECE465A}.Release|x64.Build.0 = Release|Any CPU + {3B42D204-BFB1-456F-B5F5-9421EECE465A}.Release|x86.ActiveCfg = Release|Any CPU + {3B42D204-BFB1-456F-B5F5-9421EECE465A}.Release|x86.Build.0 = Release|Any CPU + {F8BC96E4-15E2-4F64-9D25-E167EC207404}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F8BC96E4-15E2-4F64-9D25-E167EC207404}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F8BC96E4-15E2-4F64-9D25-E167EC207404}.Debug|x64.ActiveCfg = Debug|Any CPU + {F8BC96E4-15E2-4F64-9D25-E167EC207404}.Debug|x64.Build.0 = Debug|Any CPU + {F8BC96E4-15E2-4F64-9D25-E167EC207404}.Debug|x86.ActiveCfg = Debug|Any CPU + {F8BC96E4-15E2-4F64-9D25-E167EC207404}.Debug|x86.Build.0 = Debug|Any CPU + {F8BC96E4-15E2-4F64-9D25-E167EC207404}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F8BC96E4-15E2-4F64-9D25-E167EC207404}.Release|Any CPU.Build.0 = Release|Any CPU + {F8BC96E4-15E2-4F64-9D25-E167EC207404}.Release|x64.ActiveCfg = Release|Any CPU + {F8BC96E4-15E2-4F64-9D25-E167EC207404}.Release|x64.Build.0 = Release|Any CPU + {F8BC96E4-15E2-4F64-9D25-E167EC207404}.Release|x86.ActiveCfg = Release|Any CPU + {F8BC96E4-15E2-4F64-9D25-E167EC207404}.Release|x86.Build.0 = Release|Any CPU + {A2EB7FD7-7660-4297-B431-9833CB65A848}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A2EB7FD7-7660-4297-B431-9833CB65A848}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A2EB7FD7-7660-4297-B431-9833CB65A848}.Debug|x64.ActiveCfg = Debug|Any CPU + {A2EB7FD7-7660-4297-B431-9833CB65A848}.Debug|x64.Build.0 = Debug|Any CPU + {A2EB7FD7-7660-4297-B431-9833CB65A848}.Debug|x86.ActiveCfg = Debug|Any CPU + {A2EB7FD7-7660-4297-B431-9833CB65A848}.Debug|x86.Build.0 = Debug|Any CPU + {A2EB7FD7-7660-4297-B431-9833CB65A848}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A2EB7FD7-7660-4297-B431-9833CB65A848}.Release|Any CPU.Build.0 = Release|Any CPU + {A2EB7FD7-7660-4297-B431-9833CB65A848}.Release|x64.ActiveCfg = Release|Any CPU + {A2EB7FD7-7660-4297-B431-9833CB65A848}.Release|x64.Build.0 = Release|Any CPU + {A2EB7FD7-7660-4297-B431-9833CB65A848}.Release|x86.ActiveCfg = Release|Any CPU + {A2EB7FD7-7660-4297-B431-9833CB65A848}.Release|x86.Build.0 = Release|Any CPU + {086D5907-AAF8-4488-A2AD-4A3430D74FAB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {086D5907-AAF8-4488-A2AD-4A3430D74FAB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {086D5907-AAF8-4488-A2AD-4A3430D74FAB}.Debug|x64.ActiveCfg = Debug|Any CPU + {086D5907-AAF8-4488-A2AD-4A3430D74FAB}.Debug|x64.Build.0 = Debug|Any CPU + {086D5907-AAF8-4488-A2AD-4A3430D74FAB}.Debug|x86.ActiveCfg = Debug|Any CPU + {086D5907-AAF8-4488-A2AD-4A3430D74FAB}.Debug|x86.Build.0 = Debug|Any CPU + {086D5907-AAF8-4488-A2AD-4A3430D74FAB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {086D5907-AAF8-4488-A2AD-4A3430D74FAB}.Release|Any CPU.Build.0 = Release|Any CPU + {086D5907-AAF8-4488-A2AD-4A3430D74FAB}.Release|x64.ActiveCfg = Release|Any CPU + {086D5907-AAF8-4488-A2AD-4A3430D74FAB}.Release|x64.Build.0 = Release|Any CPU + {086D5907-AAF8-4488-A2AD-4A3430D74FAB}.Release|x86.ActiveCfg = Release|Any CPU + {086D5907-AAF8-4488-A2AD-4A3430D74FAB}.Release|x86.Build.0 = Release|Any CPU + {6ACF8F5B-B1E1-439B-AFFF-42D6B143760E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6ACF8F5B-B1E1-439B-AFFF-42D6B143760E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6ACF8F5B-B1E1-439B-AFFF-42D6B143760E}.Debug|x64.ActiveCfg = Debug|Any CPU + {6ACF8F5B-B1E1-439B-AFFF-42D6B143760E}.Debug|x64.Build.0 = Debug|Any CPU + {6ACF8F5B-B1E1-439B-AFFF-42D6B143760E}.Debug|x86.ActiveCfg = Debug|Any CPU + {6ACF8F5B-B1E1-439B-AFFF-42D6B143760E}.Debug|x86.Build.0 = Debug|Any CPU + {6ACF8F5B-B1E1-439B-AFFF-42D6B143760E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6ACF8F5B-B1E1-439B-AFFF-42D6B143760E}.Release|Any CPU.Build.0 = Release|Any CPU + {6ACF8F5B-B1E1-439B-AFFF-42D6B143760E}.Release|x64.ActiveCfg = Release|Any CPU + {6ACF8F5B-B1E1-439B-AFFF-42D6B143760E}.Release|x64.Build.0 = Release|Any CPU + {6ACF8F5B-B1E1-439B-AFFF-42D6B143760E}.Release|x86.ActiveCfg = Release|Any CPU + {6ACF8F5B-B1E1-439B-AFFF-42D6B143760E}.Release|x86.Build.0 = Release|Any CPU + {50FB388F-6D68-400C-A919-0414B87466A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {50FB388F-6D68-400C-A919-0414B87466A7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {50FB388F-6D68-400C-A919-0414B87466A7}.Debug|x64.ActiveCfg = Debug|Any CPU + {50FB388F-6D68-400C-A919-0414B87466A7}.Debug|x64.Build.0 = Debug|Any CPU + {50FB388F-6D68-400C-A919-0414B87466A7}.Debug|x86.ActiveCfg = Debug|Any CPU + {50FB388F-6D68-400C-A919-0414B87466A7}.Debug|x86.Build.0 = Debug|Any CPU + {50FB388F-6D68-400C-A919-0414B87466A7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {50FB388F-6D68-400C-A919-0414B87466A7}.Release|Any CPU.Build.0 = Release|Any CPU + {50FB388F-6D68-400C-A919-0414B87466A7}.Release|x64.ActiveCfg = Release|Any CPU + {50FB388F-6D68-400C-A919-0414B87466A7}.Release|x64.Build.0 = Release|Any CPU + {50FB388F-6D68-400C-A919-0414B87466A7}.Release|x86.ActiveCfg = Release|Any CPU + {50FB388F-6D68-400C-A919-0414B87466A7}.Release|x86.Build.0 = Release|Any CPU + {F1957BE5-4CA4-494B-A62B-AA4F5E4D460A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F1957BE5-4CA4-494B-A62B-AA4F5E4D460A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F1957BE5-4CA4-494B-A62B-AA4F5E4D460A}.Debug|x64.ActiveCfg = Debug|Any CPU + {F1957BE5-4CA4-494B-A62B-AA4F5E4D460A}.Debug|x64.Build.0 = Debug|Any CPU + {F1957BE5-4CA4-494B-A62B-AA4F5E4D460A}.Debug|x86.ActiveCfg = Debug|Any CPU + {F1957BE5-4CA4-494B-A62B-AA4F5E4D460A}.Debug|x86.Build.0 = Debug|Any CPU + {F1957BE5-4CA4-494B-A62B-AA4F5E4D460A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F1957BE5-4CA4-494B-A62B-AA4F5E4D460A}.Release|Any CPU.Build.0 = Release|Any CPU + {F1957BE5-4CA4-494B-A62B-AA4F5E4D460A}.Release|x64.ActiveCfg = Release|Any CPU + {F1957BE5-4CA4-494B-A62B-AA4F5E4D460A}.Release|x64.Build.0 = Release|Any CPU + {F1957BE5-4CA4-494B-A62B-AA4F5E4D460A}.Release|x86.ActiveCfg = Release|Any CPU + {F1957BE5-4CA4-494B-A62B-AA4F5E4D460A}.Release|x86.Build.0 = Release|Any CPU + {F2077E7E-7305-4FC7-8D67-D90037B3F370}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F2077E7E-7305-4FC7-8D67-D90037B3F370}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F2077E7E-7305-4FC7-8D67-D90037B3F370}.Debug|x64.ActiveCfg = Debug|Any CPU + {F2077E7E-7305-4FC7-8D67-D90037B3F370}.Debug|x64.Build.0 = Debug|Any CPU + {F2077E7E-7305-4FC7-8D67-D90037B3F370}.Debug|x86.ActiveCfg = Debug|Any CPU + {F2077E7E-7305-4FC7-8D67-D90037B3F370}.Debug|x86.Build.0 = Debug|Any CPU + {F2077E7E-7305-4FC7-8D67-D90037B3F370}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F2077E7E-7305-4FC7-8D67-D90037B3F370}.Release|Any CPU.Build.0 = Release|Any CPU + {F2077E7E-7305-4FC7-8D67-D90037B3F370}.Release|x64.ActiveCfg = Release|Any CPU + {F2077E7E-7305-4FC7-8D67-D90037B3F370}.Release|x64.Build.0 = Release|Any CPU + {F2077E7E-7305-4FC7-8D67-D90037B3F370}.Release|x86.ActiveCfg = Release|Any CPU + {F2077E7E-7305-4FC7-8D67-D90037B3F370}.Release|x86.Build.0 = Release|Any CPU + {3A3D27B8-10FE-4E72-A3CE-183EBC11503B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3A3D27B8-10FE-4E72-A3CE-183EBC11503B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3A3D27B8-10FE-4E72-A3CE-183EBC11503B}.Debug|x64.ActiveCfg = Debug|Any CPU + {3A3D27B8-10FE-4E72-A3CE-183EBC11503B}.Debug|x64.Build.0 = Debug|Any CPU + {3A3D27B8-10FE-4E72-A3CE-183EBC11503B}.Debug|x86.ActiveCfg = Debug|Any CPU + {3A3D27B8-10FE-4E72-A3CE-183EBC11503B}.Debug|x86.Build.0 = Debug|Any CPU + {3A3D27B8-10FE-4E72-A3CE-183EBC11503B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3A3D27B8-10FE-4E72-A3CE-183EBC11503B}.Release|Any CPU.Build.0 = Release|Any CPU + {3A3D27B8-10FE-4E72-A3CE-183EBC11503B}.Release|x64.ActiveCfg = Release|Any CPU + {3A3D27B8-10FE-4E72-A3CE-183EBC11503B}.Release|x64.Build.0 = Release|Any CPU + {3A3D27B8-10FE-4E72-A3CE-183EBC11503B}.Release|x86.ActiveCfg = Release|Any CPU + {3A3D27B8-10FE-4E72-A3CE-183EBC11503B}.Release|x86.Build.0 = Release|Any CPU + {A8777E05-E344-4673-915B-E9224002C423}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A8777E05-E344-4673-915B-E9224002C423}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A8777E05-E344-4673-915B-E9224002C423}.Debug|x64.ActiveCfg = Debug|Any CPU + {A8777E05-E344-4673-915B-E9224002C423}.Debug|x64.Build.0 = Debug|Any CPU + {A8777E05-E344-4673-915B-E9224002C423}.Debug|x86.ActiveCfg = Debug|Any CPU + {A8777E05-E344-4673-915B-E9224002C423}.Debug|x86.Build.0 = Debug|Any CPU + {A8777E05-E344-4673-915B-E9224002C423}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A8777E05-E344-4673-915B-E9224002C423}.Release|Any CPU.Build.0 = Release|Any CPU + {A8777E05-E344-4673-915B-E9224002C423}.Release|x64.ActiveCfg = Release|Any CPU + {A8777E05-E344-4673-915B-E9224002C423}.Release|x64.Build.0 = Release|Any CPU + {A8777E05-E344-4673-915B-E9224002C423}.Release|x86.ActiveCfg = Release|Any CPU + {A8777E05-E344-4673-915B-E9224002C423}.Release|x86.Build.0 = Release|Any CPU + {05B08A0C-5BCA-4FF6-9C42-9DFF5E7DCDEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {05B08A0C-5BCA-4FF6-9C42-9DFF5E7DCDEA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {05B08A0C-5BCA-4FF6-9C42-9DFF5E7DCDEA}.Debug|x64.ActiveCfg = Debug|Any CPU + {05B08A0C-5BCA-4FF6-9C42-9DFF5E7DCDEA}.Debug|x64.Build.0 = Debug|Any CPU + {05B08A0C-5BCA-4FF6-9C42-9DFF5E7DCDEA}.Debug|x86.ActiveCfg = Debug|Any CPU + {05B08A0C-5BCA-4FF6-9C42-9DFF5E7DCDEA}.Debug|x86.Build.0 = Debug|Any CPU + {05B08A0C-5BCA-4FF6-9C42-9DFF5E7DCDEA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {05B08A0C-5BCA-4FF6-9C42-9DFF5E7DCDEA}.Release|Any CPU.Build.0 = Release|Any CPU + {05B08A0C-5BCA-4FF6-9C42-9DFF5E7DCDEA}.Release|x64.ActiveCfg = Release|Any CPU + {05B08A0C-5BCA-4FF6-9C42-9DFF5E7DCDEA}.Release|x64.Build.0 = Release|Any CPU + {05B08A0C-5BCA-4FF6-9C42-9DFF5E7DCDEA}.Release|x86.ActiveCfg = Release|Any CPU + {05B08A0C-5BCA-4FF6-9C42-9DFF5E7DCDEA}.Release|x86.Build.0 = Release|Any CPU + {C9CFE66E-6921-4CCE-83A7-D5B54812122F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C9CFE66E-6921-4CCE-83A7-D5B54812122F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C9CFE66E-6921-4CCE-83A7-D5B54812122F}.Debug|x64.ActiveCfg = Debug|Any CPU + {C9CFE66E-6921-4CCE-83A7-D5B54812122F}.Debug|x64.Build.0 = Debug|Any CPU + {C9CFE66E-6921-4CCE-83A7-D5B54812122F}.Debug|x86.ActiveCfg = Debug|Any CPU + {C9CFE66E-6921-4CCE-83A7-D5B54812122F}.Debug|x86.Build.0 = Debug|Any CPU + {C9CFE66E-6921-4CCE-83A7-D5B54812122F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C9CFE66E-6921-4CCE-83A7-D5B54812122F}.Release|Any CPU.Build.0 = Release|Any CPU + {C9CFE66E-6921-4CCE-83A7-D5B54812122F}.Release|x64.ActiveCfg = Release|Any CPU + {C9CFE66E-6921-4CCE-83A7-D5B54812122F}.Release|x64.Build.0 = Release|Any CPU + {C9CFE66E-6921-4CCE-83A7-D5B54812122F}.Release|x86.ActiveCfg = Release|Any CPU + {C9CFE66E-6921-4CCE-83A7-D5B54812122F}.Release|x86.Build.0 = Release|Any CPU + {A0FD4472-99E5-4FBC-A6A7-20786EA167DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A0FD4472-99E5-4FBC-A6A7-20786EA167DF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A0FD4472-99E5-4FBC-A6A7-20786EA167DF}.Debug|x64.ActiveCfg = Debug|Any CPU + {A0FD4472-99E5-4FBC-A6A7-20786EA167DF}.Debug|x64.Build.0 = Debug|Any CPU + {A0FD4472-99E5-4FBC-A6A7-20786EA167DF}.Debug|x86.ActiveCfg = Debug|Any CPU + {A0FD4472-99E5-4FBC-A6A7-20786EA167DF}.Debug|x86.Build.0 = Debug|Any CPU + {A0FD4472-99E5-4FBC-A6A7-20786EA167DF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A0FD4472-99E5-4FBC-A6A7-20786EA167DF}.Release|Any CPU.Build.0 = Release|Any CPU + {A0FD4472-99E5-4FBC-A6A7-20786EA167DF}.Release|x64.ActiveCfg = Release|Any CPU + {A0FD4472-99E5-4FBC-A6A7-20786EA167DF}.Release|x64.Build.0 = Release|Any CPU + {A0FD4472-99E5-4FBC-A6A7-20786EA167DF}.Release|x86.ActiveCfg = Release|Any CPU + {A0FD4472-99E5-4FBC-A6A7-20786EA167DF}.Release|x86.Build.0 = Release|Any CPU + {86272012-C994-41F7-BFAF-4BED50797B22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {86272012-C994-41F7-BFAF-4BED50797B22}.Debug|Any CPU.Build.0 = Debug|Any CPU + {86272012-C994-41F7-BFAF-4BED50797B22}.Debug|x64.ActiveCfg = Debug|Any CPU + {86272012-C994-41F7-BFAF-4BED50797B22}.Debug|x64.Build.0 = Debug|Any CPU + {86272012-C994-41F7-BFAF-4BED50797B22}.Debug|x86.ActiveCfg = Debug|Any CPU + {86272012-C994-41F7-BFAF-4BED50797B22}.Debug|x86.Build.0 = Debug|Any CPU + {86272012-C994-41F7-BFAF-4BED50797B22}.Release|Any CPU.ActiveCfg = Release|Any CPU + {86272012-C994-41F7-BFAF-4BED50797B22}.Release|Any CPU.Build.0 = Release|Any CPU + {86272012-C994-41F7-BFAF-4BED50797B22}.Release|x64.ActiveCfg = Release|Any CPU + {86272012-C994-41F7-BFAF-4BED50797B22}.Release|x64.Build.0 = Release|Any CPU + {86272012-C994-41F7-BFAF-4BED50797B22}.Release|x86.ActiveCfg = Release|Any CPU + {86272012-C994-41F7-BFAF-4BED50797B22}.Release|x86.Build.0 = Release|Any CPU + {94B89563-1E74-42F9-96A5-19CD800AFECB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {94B89563-1E74-42F9-96A5-19CD800AFECB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {94B89563-1E74-42F9-96A5-19CD800AFECB}.Debug|x64.ActiveCfg = Debug|Any CPU + {94B89563-1E74-42F9-96A5-19CD800AFECB}.Debug|x64.Build.0 = Debug|Any CPU + {94B89563-1E74-42F9-96A5-19CD800AFECB}.Debug|x86.ActiveCfg = Debug|Any CPU + {94B89563-1E74-42F9-96A5-19CD800AFECB}.Debug|x86.Build.0 = Debug|Any CPU + {94B89563-1E74-42F9-96A5-19CD800AFECB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {94B89563-1E74-42F9-96A5-19CD800AFECB}.Release|Any CPU.Build.0 = Release|Any CPU + {94B89563-1E74-42F9-96A5-19CD800AFECB}.Release|x64.ActiveCfg = Release|Any CPU + {94B89563-1E74-42F9-96A5-19CD800AFECB}.Release|x64.Build.0 = Release|Any CPU + {94B89563-1E74-42F9-96A5-19CD800AFECB}.Release|x86.ActiveCfg = Release|Any CPU + {94B89563-1E74-42F9-96A5-19CD800AFECB}.Release|x86.Build.0 = Release|Any CPU + {E5D2964E-CFE9-4DE6-99B5-1F54F9984F65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E5D2964E-CFE9-4DE6-99B5-1F54F9984F65}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E5D2964E-CFE9-4DE6-99B5-1F54F9984F65}.Debug|x64.ActiveCfg = Debug|Any CPU + {E5D2964E-CFE9-4DE6-99B5-1F54F9984F65}.Debug|x64.Build.0 = Debug|Any CPU + {E5D2964E-CFE9-4DE6-99B5-1F54F9984F65}.Debug|x86.ActiveCfg = Debug|Any CPU + {E5D2964E-CFE9-4DE6-99B5-1F54F9984F65}.Debug|x86.Build.0 = Debug|Any CPU + {E5D2964E-CFE9-4DE6-99B5-1F54F9984F65}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E5D2964E-CFE9-4DE6-99B5-1F54F9984F65}.Release|Any CPU.Build.0 = Release|Any CPU + {E5D2964E-CFE9-4DE6-99B5-1F54F9984F65}.Release|x64.ActiveCfg = Release|Any CPU + {E5D2964E-CFE9-4DE6-99B5-1F54F9984F65}.Release|x64.Build.0 = Release|Any CPU + {E5D2964E-CFE9-4DE6-99B5-1F54F9984F65}.Release|x86.ActiveCfg = Release|Any CPU + {E5D2964E-CFE9-4DE6-99B5-1F54F9984F65}.Release|x86.Build.0 = Release|Any CPU + {C92F8E81-6FB1-46FF-9B68-2D126F8903E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C92F8E81-6FB1-46FF-9B68-2D126F8903E6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C92F8E81-6FB1-46FF-9B68-2D126F8903E6}.Debug|x64.ActiveCfg = Debug|Any CPU + {C92F8E81-6FB1-46FF-9B68-2D126F8903E6}.Debug|x64.Build.0 = Debug|Any CPU + {C92F8E81-6FB1-46FF-9B68-2D126F8903E6}.Debug|x86.ActiveCfg = Debug|Any CPU + {C92F8E81-6FB1-46FF-9B68-2D126F8903E6}.Debug|x86.Build.0 = Debug|Any CPU + {C92F8E81-6FB1-46FF-9B68-2D126F8903E6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C92F8E81-6FB1-46FF-9B68-2D126F8903E6}.Release|Any CPU.Build.0 = Release|Any CPU + {C92F8E81-6FB1-46FF-9B68-2D126F8903E6}.Release|x64.ActiveCfg = Release|Any CPU + {C92F8E81-6FB1-46FF-9B68-2D126F8903E6}.Release|x64.Build.0 = Release|Any CPU + {C92F8E81-6FB1-46FF-9B68-2D126F8903E6}.Release|x86.ActiveCfg = Release|Any CPU + {C92F8E81-6FB1-46FF-9B68-2D126F8903E6}.Release|x86.Build.0 = Release|Any CPU + {B9207BE6-2577-4C49-AF5F-130A17BBEA73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B9207BE6-2577-4C49-AF5F-130A17BBEA73}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B9207BE6-2577-4C49-AF5F-130A17BBEA73}.Debug|x64.ActiveCfg = Debug|Any CPU + {B9207BE6-2577-4C49-AF5F-130A17BBEA73}.Debug|x64.Build.0 = Debug|Any CPU + {B9207BE6-2577-4C49-AF5F-130A17BBEA73}.Debug|x86.ActiveCfg = Debug|Any CPU + {B9207BE6-2577-4C49-AF5F-130A17BBEA73}.Debug|x86.Build.0 = Debug|Any CPU + {B9207BE6-2577-4C49-AF5F-130A17BBEA73}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B9207BE6-2577-4C49-AF5F-130A17BBEA73}.Release|Any CPU.Build.0 = Release|Any CPU + {B9207BE6-2577-4C49-AF5F-130A17BBEA73}.Release|x64.ActiveCfg = Release|Any CPU + {B9207BE6-2577-4C49-AF5F-130A17BBEA73}.Release|x64.Build.0 = Release|Any CPU + {B9207BE6-2577-4C49-AF5F-130A17BBEA73}.Release|x86.ActiveCfg = Release|Any CPU + {B9207BE6-2577-4C49-AF5F-130A17BBEA73}.Release|x86.Build.0 = Release|Any CPU + {40C19FFA-E1E1-4589-86E4-B7BEF336CE79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {40C19FFA-E1E1-4589-86E4-B7BEF336CE79}.Debug|Any CPU.Build.0 = Debug|Any CPU + {40C19FFA-E1E1-4589-86E4-B7BEF336CE79}.Debug|x64.ActiveCfg = Debug|Any CPU + {40C19FFA-E1E1-4589-86E4-B7BEF336CE79}.Debug|x64.Build.0 = Debug|Any CPU + {40C19FFA-E1E1-4589-86E4-B7BEF336CE79}.Debug|x86.ActiveCfg = Debug|Any CPU + {40C19FFA-E1E1-4589-86E4-B7BEF336CE79}.Debug|x86.Build.0 = Debug|Any CPU + {40C19FFA-E1E1-4589-86E4-B7BEF336CE79}.Release|Any CPU.ActiveCfg = Release|Any CPU + {40C19FFA-E1E1-4589-86E4-B7BEF336CE79}.Release|Any CPU.Build.0 = Release|Any CPU + {40C19FFA-E1E1-4589-86E4-B7BEF336CE79}.Release|x64.ActiveCfg = Release|Any CPU + {40C19FFA-E1E1-4589-86E4-B7BEF336CE79}.Release|x64.Build.0 = Release|Any CPU + {40C19FFA-E1E1-4589-86E4-B7BEF336CE79}.Release|x86.ActiveCfg = Release|Any CPU + {40C19FFA-E1E1-4589-86E4-B7BEF336CE79}.Release|x86.Build.0 = Release|Any CPU + {64324C38-03F7-4624-8F00-B85183DDBF99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {64324C38-03F7-4624-8F00-B85183DDBF99}.Debug|Any CPU.Build.0 = Debug|Any CPU + {64324C38-03F7-4624-8F00-B85183DDBF99}.Debug|x64.ActiveCfg = Debug|Any CPU + {64324C38-03F7-4624-8F00-B85183DDBF99}.Debug|x64.Build.0 = Debug|Any CPU + {64324C38-03F7-4624-8F00-B85183DDBF99}.Debug|x86.ActiveCfg = Debug|Any CPU + {64324C38-03F7-4624-8F00-B85183DDBF99}.Debug|x86.Build.0 = Debug|Any CPU + {64324C38-03F7-4624-8F00-B85183DDBF99}.Release|Any CPU.ActiveCfg = Release|Any CPU + {64324C38-03F7-4624-8F00-B85183DDBF99}.Release|Any CPU.Build.0 = Release|Any CPU + {64324C38-03F7-4624-8F00-B85183DDBF99}.Release|x64.ActiveCfg = Release|Any CPU + {64324C38-03F7-4624-8F00-B85183DDBF99}.Release|x64.Build.0 = Release|Any CPU + {64324C38-03F7-4624-8F00-B85183DDBF99}.Release|x86.ActiveCfg = Release|Any CPU + {64324C38-03F7-4624-8F00-B85183DDBF99}.Release|x86.Build.0 = Release|Any CPU + {14C24193-D5E0-4D29-B270-C27B43CC1925}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {14C24193-D5E0-4D29-B270-C27B43CC1925}.Debug|Any CPU.Build.0 = Debug|Any CPU + {14C24193-D5E0-4D29-B270-C27B43CC1925}.Debug|x64.ActiveCfg = Debug|Any CPU + {14C24193-D5E0-4D29-B270-C27B43CC1925}.Debug|x64.Build.0 = Debug|Any CPU + {14C24193-D5E0-4D29-B270-C27B43CC1925}.Debug|x86.ActiveCfg = Debug|Any CPU + {14C24193-D5E0-4D29-B270-C27B43CC1925}.Debug|x86.Build.0 = Debug|Any CPU + {14C24193-D5E0-4D29-B270-C27B43CC1925}.Release|Any CPU.ActiveCfg = Release|Any CPU + {14C24193-D5E0-4D29-B270-C27B43CC1925}.Release|Any CPU.Build.0 = Release|Any CPU + {14C24193-D5E0-4D29-B270-C27B43CC1925}.Release|x64.ActiveCfg = Release|Any CPU + {14C24193-D5E0-4D29-B270-C27B43CC1925}.Release|x64.Build.0 = Release|Any CPU + {14C24193-D5E0-4D29-B270-C27B43CC1925}.Release|x86.ActiveCfg = Release|Any CPU + {14C24193-D5E0-4D29-B270-C27B43CC1925}.Release|x86.Build.0 = Release|Any CPU + {B25208A4-3C80-411E-A36A-7BC4AA506DC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B25208A4-3C80-411E-A36A-7BC4AA506DC7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B25208A4-3C80-411E-A36A-7BC4AA506DC7}.Debug|x64.ActiveCfg = Debug|Any CPU + {B25208A4-3C80-411E-A36A-7BC4AA506DC7}.Debug|x64.Build.0 = Debug|Any CPU + {B25208A4-3C80-411E-A36A-7BC4AA506DC7}.Debug|x86.ActiveCfg = Debug|Any CPU + {B25208A4-3C80-411E-A36A-7BC4AA506DC7}.Debug|x86.Build.0 = Debug|Any CPU + {B25208A4-3C80-411E-A36A-7BC4AA506DC7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B25208A4-3C80-411E-A36A-7BC4AA506DC7}.Release|Any CPU.Build.0 = Release|Any CPU + {B25208A4-3C80-411E-A36A-7BC4AA506DC7}.Release|x64.ActiveCfg = Release|Any CPU + {B25208A4-3C80-411E-A36A-7BC4AA506DC7}.Release|x64.Build.0 = Release|Any CPU + {B25208A4-3C80-411E-A36A-7BC4AA506DC7}.Release|x86.ActiveCfg = Release|Any CPU + {B25208A4-3C80-411E-A36A-7BC4AA506DC7}.Release|x86.Build.0 = Release|Any CPU + {2A56B16C-3980-4380-84E8-B20DEEEFB5D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2A56B16C-3980-4380-84E8-B20DEEEFB5D6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2A56B16C-3980-4380-84E8-B20DEEEFB5D6}.Debug|x64.ActiveCfg = Debug|Any CPU + {2A56B16C-3980-4380-84E8-B20DEEEFB5D6}.Debug|x64.Build.0 = Debug|Any CPU + {2A56B16C-3980-4380-84E8-B20DEEEFB5D6}.Debug|x86.ActiveCfg = Debug|Any CPU + {2A56B16C-3980-4380-84E8-B20DEEEFB5D6}.Debug|x86.Build.0 = Debug|Any CPU + {2A56B16C-3980-4380-84E8-B20DEEEFB5D6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2A56B16C-3980-4380-84E8-B20DEEEFB5D6}.Release|Any CPU.Build.0 = Release|Any CPU + {2A56B16C-3980-4380-84E8-B20DEEEFB5D6}.Release|x64.ActiveCfg = Release|Any CPU + {2A56B16C-3980-4380-84E8-B20DEEEFB5D6}.Release|x64.Build.0 = Release|Any CPU + {2A56B16C-3980-4380-84E8-B20DEEEFB5D6}.Release|x86.ActiveCfg = Release|Any CPU + {2A56B16C-3980-4380-84E8-B20DEEEFB5D6}.Release|x86.Build.0 = Release|Any CPU + {269971FF-B748-4B95-8507-534C229A60B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {269971FF-B748-4B95-8507-534C229A60B9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {269971FF-B748-4B95-8507-534C229A60B9}.Debug|x64.ActiveCfg = Debug|Any CPU + {269971FF-B748-4B95-8507-534C229A60B9}.Debug|x64.Build.0 = Debug|Any CPU + {269971FF-B748-4B95-8507-534C229A60B9}.Debug|x86.ActiveCfg = Debug|Any CPU + {269971FF-B748-4B95-8507-534C229A60B9}.Debug|x86.Build.0 = Debug|Any CPU + {269971FF-B748-4B95-8507-534C229A60B9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {269971FF-B748-4B95-8507-534C229A60B9}.Release|Any CPU.Build.0 = Release|Any CPU + {269971FF-B748-4B95-8507-534C229A60B9}.Release|x64.ActiveCfg = Release|Any CPU + {269971FF-B748-4B95-8507-534C229A60B9}.Release|x64.Build.0 = Release|Any CPU + {269971FF-B748-4B95-8507-534C229A60B9}.Release|x86.ActiveCfg = Release|Any CPU + {269971FF-B748-4B95-8507-534C229A60B9}.Release|x86.Build.0 = Release|Any CPU + {F6244150-1AD9-470E-B0F0-72389B10639E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F6244150-1AD9-470E-B0F0-72389B10639E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F6244150-1AD9-470E-B0F0-72389B10639E}.Debug|x64.ActiveCfg = Debug|Any CPU + {F6244150-1AD9-470E-B0F0-72389B10639E}.Debug|x64.Build.0 = Debug|Any CPU + {F6244150-1AD9-470E-B0F0-72389B10639E}.Debug|x86.ActiveCfg = Debug|Any CPU + {F6244150-1AD9-470E-B0F0-72389B10639E}.Debug|x86.Build.0 = Debug|Any CPU + {F6244150-1AD9-470E-B0F0-72389B10639E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F6244150-1AD9-470E-B0F0-72389B10639E}.Release|Any CPU.Build.0 = Release|Any CPU + {F6244150-1AD9-470E-B0F0-72389B10639E}.Release|x64.ActiveCfg = Release|Any CPU + {F6244150-1AD9-470E-B0F0-72389B10639E}.Release|x64.Build.0 = Release|Any CPU + {F6244150-1AD9-470E-B0F0-72389B10639E}.Release|x86.ActiveCfg = Release|Any CPU + {F6244150-1AD9-470E-B0F0-72389B10639E}.Release|x86.Build.0 = Release|Any CPU + {D1102F23-265A-4CA8-975C-75564DFFAA04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D1102F23-265A-4CA8-975C-75564DFFAA04}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D1102F23-265A-4CA8-975C-75564DFFAA04}.Debug|x64.ActiveCfg = Debug|Any CPU + {D1102F23-265A-4CA8-975C-75564DFFAA04}.Debug|x64.Build.0 = Debug|Any CPU + {D1102F23-265A-4CA8-975C-75564DFFAA04}.Debug|x86.ActiveCfg = Debug|Any CPU + {D1102F23-265A-4CA8-975C-75564DFFAA04}.Debug|x86.Build.0 = Debug|Any CPU + {D1102F23-265A-4CA8-975C-75564DFFAA04}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D1102F23-265A-4CA8-975C-75564DFFAA04}.Release|Any CPU.Build.0 = Release|Any CPU + {D1102F23-265A-4CA8-975C-75564DFFAA04}.Release|x64.ActiveCfg = Release|Any CPU + {D1102F23-265A-4CA8-975C-75564DFFAA04}.Release|x64.Build.0 = Release|Any CPU + {D1102F23-265A-4CA8-975C-75564DFFAA04}.Release|x86.ActiveCfg = Release|Any CPU + {D1102F23-265A-4CA8-975C-75564DFFAA04}.Release|x86.Build.0 = Release|Any CPU + {F4C5ECB6-2C17-4BC9-BF8F-BA9117BD2843}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F4C5ECB6-2C17-4BC9-BF8F-BA9117BD2843}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F4C5ECB6-2C17-4BC9-BF8F-BA9117BD2843}.Debug|x64.ActiveCfg = Debug|Any CPU + {F4C5ECB6-2C17-4BC9-BF8F-BA9117BD2843}.Debug|x64.Build.0 = Debug|Any CPU + {F4C5ECB6-2C17-4BC9-BF8F-BA9117BD2843}.Debug|x86.ActiveCfg = Debug|Any CPU + {F4C5ECB6-2C17-4BC9-BF8F-BA9117BD2843}.Debug|x86.Build.0 = Debug|Any CPU + {F4C5ECB6-2C17-4BC9-BF8F-BA9117BD2843}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F4C5ECB6-2C17-4BC9-BF8F-BA9117BD2843}.Release|Any CPU.Build.0 = Release|Any CPU + {F4C5ECB6-2C17-4BC9-BF8F-BA9117BD2843}.Release|x64.ActiveCfg = Release|Any CPU + {F4C5ECB6-2C17-4BC9-BF8F-BA9117BD2843}.Release|x64.Build.0 = Release|Any CPU + {F4C5ECB6-2C17-4BC9-BF8F-BA9117BD2843}.Release|x86.ActiveCfg = Release|Any CPU + {F4C5ECB6-2C17-4BC9-BF8F-BA9117BD2843}.Release|x86.Build.0 = Release|Any CPU + {B9C4BF5F-2D56-4B06-A1EE-1E1CC642D14B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B9C4BF5F-2D56-4B06-A1EE-1E1CC642D14B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B9C4BF5F-2D56-4B06-A1EE-1E1CC642D14B}.Debug|x64.ActiveCfg = Debug|Any CPU + {B9C4BF5F-2D56-4B06-A1EE-1E1CC642D14B}.Debug|x64.Build.0 = Debug|Any CPU + {B9C4BF5F-2D56-4B06-A1EE-1E1CC642D14B}.Debug|x86.ActiveCfg = Debug|Any CPU + {B9C4BF5F-2D56-4B06-A1EE-1E1CC642D14B}.Debug|x86.Build.0 = Debug|Any CPU + {B9C4BF5F-2D56-4B06-A1EE-1E1CC642D14B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B9C4BF5F-2D56-4B06-A1EE-1E1CC642D14B}.Release|Any CPU.Build.0 = Release|Any CPU + {B9C4BF5F-2D56-4B06-A1EE-1E1CC642D14B}.Release|x64.ActiveCfg = Release|Any CPU + {B9C4BF5F-2D56-4B06-A1EE-1E1CC642D14B}.Release|x64.Build.0 = Release|Any CPU + {B9C4BF5F-2D56-4B06-A1EE-1E1CC642D14B}.Release|x86.ActiveCfg = Release|Any CPU + {B9C4BF5F-2D56-4B06-A1EE-1E1CC642D14B}.Release|x86.Build.0 = Release|Any CPU + {6CE987BF-9677-476C-8BB9-1BE7CC16F932}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6CE987BF-9677-476C-8BB9-1BE7CC16F932}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6CE987BF-9677-476C-8BB9-1BE7CC16F932}.Debug|x64.ActiveCfg = Debug|Any CPU + {6CE987BF-9677-476C-8BB9-1BE7CC16F932}.Debug|x64.Build.0 = Debug|Any CPU + {6CE987BF-9677-476C-8BB9-1BE7CC16F932}.Debug|x86.ActiveCfg = Debug|Any CPU + {6CE987BF-9677-476C-8BB9-1BE7CC16F932}.Debug|x86.Build.0 = Debug|Any CPU + {6CE987BF-9677-476C-8BB9-1BE7CC16F932}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6CE987BF-9677-476C-8BB9-1BE7CC16F932}.Release|Any CPU.Build.0 = Release|Any CPU + {6CE987BF-9677-476C-8BB9-1BE7CC16F932}.Release|x64.ActiveCfg = Release|Any CPU + {6CE987BF-9677-476C-8BB9-1BE7CC16F932}.Release|x64.Build.0 = Release|Any CPU + {6CE987BF-9677-476C-8BB9-1BE7CC16F932}.Release|x86.ActiveCfg = Release|Any CPU + {6CE987BF-9677-476C-8BB9-1BE7CC16F932}.Release|x86.Build.0 = Release|Any CPU + {BD63E691-0A53-46CE-B687-E3CD95F1D4B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BD63E691-0A53-46CE-B687-E3CD95F1D4B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BD63E691-0A53-46CE-B687-E3CD95F1D4B1}.Debug|x64.ActiveCfg = Debug|Any CPU + {BD63E691-0A53-46CE-B687-E3CD95F1D4B1}.Debug|x64.Build.0 = Debug|Any CPU + {BD63E691-0A53-46CE-B687-E3CD95F1D4B1}.Debug|x86.ActiveCfg = Debug|Any CPU + {BD63E691-0A53-46CE-B687-E3CD95F1D4B1}.Debug|x86.Build.0 = Debug|Any CPU + {BD63E691-0A53-46CE-B687-E3CD95F1D4B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BD63E691-0A53-46CE-B687-E3CD95F1D4B1}.Release|Any CPU.Build.0 = Release|Any CPU + {BD63E691-0A53-46CE-B687-E3CD95F1D4B1}.Release|x64.ActiveCfg = Release|Any CPU + {BD63E691-0A53-46CE-B687-E3CD95F1D4B1}.Release|x64.Build.0 = Release|Any CPU + {BD63E691-0A53-46CE-B687-E3CD95F1D4B1}.Release|x86.ActiveCfg = Release|Any CPU + {BD63E691-0A53-46CE-B687-E3CD95F1D4B1}.Release|x86.Build.0 = Release|Any CPU + {FCF9AB0E-4310-4BCB-8682-833450658B97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FCF9AB0E-4310-4BCB-8682-833450658B97}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FCF9AB0E-4310-4BCB-8682-833450658B97}.Debug|x64.ActiveCfg = Debug|Any CPU + {FCF9AB0E-4310-4BCB-8682-833450658B97}.Debug|x64.Build.0 = Debug|Any CPU + {FCF9AB0E-4310-4BCB-8682-833450658B97}.Debug|x86.ActiveCfg = Debug|Any CPU + {FCF9AB0E-4310-4BCB-8682-833450658B97}.Debug|x86.Build.0 = Debug|Any CPU + {FCF9AB0E-4310-4BCB-8682-833450658B97}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FCF9AB0E-4310-4BCB-8682-833450658B97}.Release|Any CPU.Build.0 = Release|Any CPU + {FCF9AB0E-4310-4BCB-8682-833450658B97}.Release|x64.ActiveCfg = Release|Any CPU + {FCF9AB0E-4310-4BCB-8682-833450658B97}.Release|x64.Build.0 = Release|Any CPU + {FCF9AB0E-4310-4BCB-8682-833450658B97}.Release|x86.ActiveCfg = Release|Any CPU + {FCF9AB0E-4310-4BCB-8682-833450658B97}.Release|x86.Build.0 = Release|Any CPU + {607AB17F-1305-4002-A980-DB60699688F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {607AB17F-1305-4002-A980-DB60699688F1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {607AB17F-1305-4002-A980-DB60699688F1}.Debug|x64.ActiveCfg = Debug|Any CPU + {607AB17F-1305-4002-A980-DB60699688F1}.Debug|x64.Build.0 = Debug|Any CPU + {607AB17F-1305-4002-A980-DB60699688F1}.Debug|x86.ActiveCfg = Debug|Any CPU + {607AB17F-1305-4002-A980-DB60699688F1}.Debug|x86.Build.0 = Debug|Any CPU + {607AB17F-1305-4002-A980-DB60699688F1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {607AB17F-1305-4002-A980-DB60699688F1}.Release|Any CPU.Build.0 = Release|Any CPU + {607AB17F-1305-4002-A980-DB60699688F1}.Release|x64.ActiveCfg = Release|Any CPU + {607AB17F-1305-4002-A980-DB60699688F1}.Release|x64.Build.0 = Release|Any CPU + {607AB17F-1305-4002-A980-DB60699688F1}.Release|x86.ActiveCfg = Release|Any CPU + {607AB17F-1305-4002-A980-DB60699688F1}.Release|x86.Build.0 = Release|Any CPU + {128B3A5D-E28C-4C7F-8B16-3202D0F73A00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {128B3A5D-E28C-4C7F-8B16-3202D0F73A00}.Debug|Any CPU.Build.0 = Debug|Any CPU + {128B3A5D-E28C-4C7F-8B16-3202D0F73A00}.Debug|x64.ActiveCfg = Debug|Any CPU + {128B3A5D-E28C-4C7F-8B16-3202D0F73A00}.Debug|x64.Build.0 = Debug|Any CPU + {128B3A5D-E28C-4C7F-8B16-3202D0F73A00}.Debug|x86.ActiveCfg = Debug|Any CPU + {128B3A5D-E28C-4C7F-8B16-3202D0F73A00}.Debug|x86.Build.0 = Debug|Any CPU + {128B3A5D-E28C-4C7F-8B16-3202D0F73A00}.Release|Any CPU.ActiveCfg = Release|Any CPU + {128B3A5D-E28C-4C7F-8B16-3202D0F73A00}.Release|Any CPU.Build.0 = Release|Any CPU + {128B3A5D-E28C-4C7F-8B16-3202D0F73A00}.Release|x64.ActiveCfg = Release|Any CPU + {128B3A5D-E28C-4C7F-8B16-3202D0F73A00}.Release|x64.Build.0 = Release|Any CPU + {128B3A5D-E28C-4C7F-8B16-3202D0F73A00}.Release|x86.ActiveCfg = Release|Any CPU + {128B3A5D-E28C-4C7F-8B16-3202D0F73A00}.Release|x86.Build.0 = Release|Any CPU + {B98F63AB-F0C8-4594-98BD-0BBBAEA4C4E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B98F63AB-F0C8-4594-98BD-0BBBAEA4C4E9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B98F63AB-F0C8-4594-98BD-0BBBAEA4C4E9}.Debug|x64.ActiveCfg = Debug|Any CPU + {B98F63AB-F0C8-4594-98BD-0BBBAEA4C4E9}.Debug|x64.Build.0 = Debug|Any CPU + {B98F63AB-F0C8-4594-98BD-0BBBAEA4C4E9}.Debug|x86.ActiveCfg = Debug|Any CPU + {B98F63AB-F0C8-4594-98BD-0BBBAEA4C4E9}.Debug|x86.Build.0 = Debug|Any CPU + {B98F63AB-F0C8-4594-98BD-0BBBAEA4C4E9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B98F63AB-F0C8-4594-98BD-0BBBAEA4C4E9}.Release|Any CPU.Build.0 = Release|Any CPU + {B98F63AB-F0C8-4594-98BD-0BBBAEA4C4E9}.Release|x64.ActiveCfg = Release|Any CPU + {B98F63AB-F0C8-4594-98BD-0BBBAEA4C4E9}.Release|x64.Build.0 = Release|Any CPU + {B98F63AB-F0C8-4594-98BD-0BBBAEA4C4E9}.Release|x86.ActiveCfg = Release|Any CPU + {B98F63AB-F0C8-4594-98BD-0BBBAEA4C4E9}.Release|x86.Build.0 = Release|Any CPU + {62EBA4E5-BD13-4F7C-85E6-65D633B3FB6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {62EBA4E5-BD13-4F7C-85E6-65D633B3FB6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {62EBA4E5-BD13-4F7C-85E6-65D633B3FB6C}.Debug|x64.ActiveCfg = Debug|Any CPU + {62EBA4E5-BD13-4F7C-85E6-65D633B3FB6C}.Debug|x64.Build.0 = Debug|Any CPU + {62EBA4E5-BD13-4F7C-85E6-65D633B3FB6C}.Debug|x86.ActiveCfg = Debug|Any CPU + {62EBA4E5-BD13-4F7C-85E6-65D633B3FB6C}.Debug|x86.Build.0 = Debug|Any CPU + {62EBA4E5-BD13-4F7C-85E6-65D633B3FB6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {62EBA4E5-BD13-4F7C-85E6-65D633B3FB6C}.Release|Any CPU.Build.0 = Release|Any CPU + {62EBA4E5-BD13-4F7C-85E6-65D633B3FB6C}.Release|x64.ActiveCfg = Release|Any CPU + {62EBA4E5-BD13-4F7C-85E6-65D633B3FB6C}.Release|x64.Build.0 = Release|Any CPU + {62EBA4E5-BD13-4F7C-85E6-65D633B3FB6C}.Release|x86.ActiveCfg = Release|Any CPU + {62EBA4E5-BD13-4F7C-85E6-65D633B3FB6C}.Release|x86.Build.0 = Release|Any CPU + {DFE95B37-24F5-417A-8C3F-788255CE8A04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DFE95B37-24F5-417A-8C3F-788255CE8A04}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DFE95B37-24F5-417A-8C3F-788255CE8A04}.Debug|x64.ActiveCfg = Debug|Any CPU + {DFE95B37-24F5-417A-8C3F-788255CE8A04}.Debug|x64.Build.0 = Debug|Any CPU + {DFE95B37-24F5-417A-8C3F-788255CE8A04}.Debug|x86.ActiveCfg = Debug|Any CPU + {DFE95B37-24F5-417A-8C3F-788255CE8A04}.Debug|x86.Build.0 = Debug|Any CPU + {DFE95B37-24F5-417A-8C3F-788255CE8A04}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DFE95B37-24F5-417A-8C3F-788255CE8A04}.Release|Any CPU.Build.0 = Release|Any CPU + {DFE95B37-24F5-417A-8C3F-788255CE8A04}.Release|x64.ActiveCfg = Release|Any CPU + {DFE95B37-24F5-417A-8C3F-788255CE8A04}.Release|x64.Build.0 = Release|Any CPU + {DFE95B37-24F5-417A-8C3F-788255CE8A04}.Release|x86.ActiveCfg = Release|Any CPU + {DFE95B37-24F5-417A-8C3F-788255CE8A04}.Release|x86.Build.0 = Release|Any CPU + {77E253C3-5FCE-45A4-B285-BE24945E0D70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {77E253C3-5FCE-45A4-B285-BE24945E0D70}.Debug|Any CPU.Build.0 = Debug|Any CPU + {77E253C3-5FCE-45A4-B285-BE24945E0D70}.Debug|x64.ActiveCfg = Debug|Any CPU + {77E253C3-5FCE-45A4-B285-BE24945E0D70}.Debug|x64.Build.0 = Debug|Any CPU + {77E253C3-5FCE-45A4-B285-BE24945E0D70}.Debug|x86.ActiveCfg = Debug|Any CPU + {77E253C3-5FCE-45A4-B285-BE24945E0D70}.Debug|x86.Build.0 = Debug|Any CPU + {77E253C3-5FCE-45A4-B285-BE24945E0D70}.Release|Any CPU.ActiveCfg = Release|Any CPU + {77E253C3-5FCE-45A4-B285-BE24945E0D70}.Release|Any CPU.Build.0 = Release|Any CPU + {77E253C3-5FCE-45A4-B285-BE24945E0D70}.Release|x64.ActiveCfg = Release|Any CPU + {77E253C3-5FCE-45A4-B285-BE24945E0D70}.Release|x64.Build.0 = Release|Any CPU + {77E253C3-5FCE-45A4-B285-BE24945E0D70}.Release|x86.ActiveCfg = Release|Any CPU + {77E253C3-5FCE-45A4-B285-BE24945E0D70}.Release|x86.Build.0 = Release|Any CPU + {32ECF281-6D99-42D4-AD00-C8B56A8270F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {32ECF281-6D99-42D4-AD00-C8B56A8270F8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {32ECF281-6D99-42D4-AD00-C8B56A8270F8}.Debug|x64.ActiveCfg = Debug|Any CPU + {32ECF281-6D99-42D4-AD00-C8B56A8270F8}.Debug|x64.Build.0 = Debug|Any CPU + {32ECF281-6D99-42D4-AD00-C8B56A8270F8}.Debug|x86.ActiveCfg = Debug|Any CPU + {32ECF281-6D99-42D4-AD00-C8B56A8270F8}.Debug|x86.Build.0 = Debug|Any CPU + {32ECF281-6D99-42D4-AD00-C8B56A8270F8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {32ECF281-6D99-42D4-AD00-C8B56A8270F8}.Release|Any CPU.Build.0 = Release|Any CPU + {32ECF281-6D99-42D4-AD00-C8B56A8270F8}.Release|x64.ActiveCfg = Release|Any CPU + {32ECF281-6D99-42D4-AD00-C8B56A8270F8}.Release|x64.Build.0 = Release|Any CPU + {32ECF281-6D99-42D4-AD00-C8B56A8270F8}.Release|x86.ActiveCfg = Release|Any CPU + {32ECF281-6D99-42D4-AD00-C8B56A8270F8}.Release|x86.Build.0 = Release|Any CPU + {2EBD1C45-9D80-413A-9BE8-4ECB43C06843}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2EBD1C45-9D80-413A-9BE8-4ECB43C06843}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2EBD1C45-9D80-413A-9BE8-4ECB43C06843}.Debug|x64.ActiveCfg = Debug|Any CPU + {2EBD1C45-9D80-413A-9BE8-4ECB43C06843}.Debug|x64.Build.0 = Debug|Any CPU + {2EBD1C45-9D80-413A-9BE8-4ECB43C06843}.Debug|x86.ActiveCfg = Debug|Any CPU + {2EBD1C45-9D80-413A-9BE8-4ECB43C06843}.Debug|x86.Build.0 = Debug|Any CPU + {2EBD1C45-9D80-413A-9BE8-4ECB43C06843}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2EBD1C45-9D80-413A-9BE8-4ECB43C06843}.Release|Any CPU.Build.0 = Release|Any CPU + {2EBD1C45-9D80-413A-9BE8-4ECB43C06843}.Release|x64.ActiveCfg = Release|Any CPU + {2EBD1C45-9D80-413A-9BE8-4ECB43C06843}.Release|x64.Build.0 = Release|Any CPU + {2EBD1C45-9D80-413A-9BE8-4ECB43C06843}.Release|x86.ActiveCfg = Release|Any CPU + {2EBD1C45-9D80-413A-9BE8-4ECB43C06843}.Release|x86.Build.0 = Release|Any CPU + {79198D56-C3F2-49D6-B8BF-5BB674B6F7A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {79198D56-C3F2-49D6-B8BF-5BB674B6F7A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {79198D56-C3F2-49D6-B8BF-5BB674B6F7A2}.Debug|x64.ActiveCfg = Debug|Any CPU + {79198D56-C3F2-49D6-B8BF-5BB674B6F7A2}.Debug|x64.Build.0 = Debug|Any CPU + {79198D56-C3F2-49D6-B8BF-5BB674B6F7A2}.Debug|x86.ActiveCfg = Debug|Any CPU + {79198D56-C3F2-49D6-B8BF-5BB674B6F7A2}.Debug|x86.Build.0 = Debug|Any CPU + {79198D56-C3F2-49D6-B8BF-5BB674B6F7A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {79198D56-C3F2-49D6-B8BF-5BB674B6F7A2}.Release|Any CPU.Build.0 = Release|Any CPU + {79198D56-C3F2-49D6-B8BF-5BB674B6F7A2}.Release|x64.ActiveCfg = Release|Any CPU + {79198D56-C3F2-49D6-B8BF-5BB674B6F7A2}.Release|x64.Build.0 = Release|Any CPU + {79198D56-C3F2-49D6-B8BF-5BB674B6F7A2}.Release|x86.ActiveCfg = Release|Any CPU + {79198D56-C3F2-49D6-B8BF-5BB674B6F7A2}.Release|x86.Build.0 = Release|Any CPU + {83504141-FF2A-427E-8A51-9FA0E9037A78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {83504141-FF2A-427E-8A51-9FA0E9037A78}.Debug|Any CPU.Build.0 = Debug|Any CPU + {83504141-FF2A-427E-8A51-9FA0E9037A78}.Debug|x64.ActiveCfg = Debug|Any CPU + {83504141-FF2A-427E-8A51-9FA0E9037A78}.Debug|x64.Build.0 = Debug|Any CPU + {83504141-FF2A-427E-8A51-9FA0E9037A78}.Debug|x86.ActiveCfg = Debug|Any CPU + {83504141-FF2A-427E-8A51-9FA0E9037A78}.Debug|x86.Build.0 = Debug|Any CPU + {83504141-FF2A-427E-8A51-9FA0E9037A78}.Release|Any CPU.ActiveCfg = Release|Any CPU + {83504141-FF2A-427E-8A51-9FA0E9037A78}.Release|Any CPU.Build.0 = Release|Any CPU + {83504141-FF2A-427E-8A51-9FA0E9037A78}.Release|x64.ActiveCfg = Release|Any CPU + {83504141-FF2A-427E-8A51-9FA0E9037A78}.Release|x64.Build.0 = Release|Any CPU + {83504141-FF2A-427E-8A51-9FA0E9037A78}.Release|x86.ActiveCfg = Release|Any CPU + {83504141-FF2A-427E-8A51-9FA0E9037A78}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/exercises/flatten-array/FlattenArray.cs b/exercises/flatten-array/FlattenArray.cs new file mode 100644 index 0000000000..e3ff8b1b1c --- /dev/null +++ b/exercises/flatten-array/FlattenArray.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections; + +public static class Flattener +{ + public static IEnumerable Flatten(IEnumerable input) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/flatten-array/FlattenArray.csproj b/exercises/flatten-array/FlattenArray.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/flatten-array/FlattenArray.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/flatten-array/FlattenArrayTest.cs b/exercises/flatten-array/FlattenArrayTest.cs index d609e3add5..e9d1e93e1c 100644 --- a/exercises/flatten-array/FlattenArrayTest.cs +++ b/exercises/flatten-array/FlattenArrayTest.cs @@ -1,25 +1,25 @@ -using System.Collections.Generic; -using NUnit.Framework; +using System; +using System.Collections.Generic; +using System.Linq; +using Xunit; public class FlattenArrayTest { - [Test] + [Fact] public void Flattens_A_Nested_List() { var nestedList = new List { new List() }; - Assert.That(Flattener.Flatten(nestedList), Is.Empty); + Assert.Empty(Flattener.Flatten(nestedList)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Flattens_2_Level_Nested_List() { var nestedList = new List { 1, new List { 2, 3, 4 }, 5 }; - Assert.That(Flattener.Flatten(nestedList), Is.EquivalentTo(new List { 1, 2, 3, 4, 5 })); + Assert.Equal(new List { 1, 2, 3, 4, 5 }, Flattener.Flatten(nestedList).Cast()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Flattens_3_Level_Nested_List() { var nestedList = new List @@ -29,11 +29,10 @@ public void Flattens_3_Level_Nested_List() 5, new List { 6, new List { 7, 8 } } }; - Assert.That(Flattener.Flatten(nestedList), Is.EquivalentTo(new List { 1, 2, 3, 4, 5, 6, 7, 8 })); + Assert.Equal(new List { 1, 2, 3, 4, 5, 6, 7, 8 }, Flattener.Flatten(nestedList).Cast()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Flattens_5_Level_Nested_List() { var nestedList = new List @@ -50,11 +49,10 @@ public void Flattens_5_Level_Nested_List() -2 } }; - Assert.That(Flattener.Flatten(nestedList), Is.EquivalentTo(new List { 0, 2, 2, 3, 8, 100, 4, 50, -2 })); + Assert.Equal(new List { 0, 2, 2, 3, 8, 100, 4, 50, -2 }, Flattener.Flatten(nestedList).Cast()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Flattens_6_Level_Nested_List() { var nestedList = new List @@ -70,11 +68,10 @@ public void Flattens_6_Level_Nested_List() }, 8 }; - Assert.That(Flattener.Flatten(nestedList), Is.EquivalentTo(new List { 1, 2, 3, 4, 5, 6, 7, 8 })); + Assert.Equal(new List { 1, 2, 3, 4, 5, 6, 7, 8 }, Flattener.Flatten(nestedList).Cast()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Flattens_6_Level_Nested_List_With_Nulls() { var nestedList = new List @@ -93,11 +90,10 @@ public void Flattens_6_Level_Nested_List_With_Nulls() 8, null }; - Assert.That(Flattener.Flatten(nestedList), Is.EquivalentTo(new List { 1, 2, 3, 4, 5, 6, 7, 8 })); + Assert.Equal(new List { 1, 2, 3, 4, 5, 6, 7, 8 }, Flattener.Flatten(nestedList).Cast()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void All_Null_Nested_List_Returns_Empty_List() { var nestedList = new List @@ -111,6 +107,6 @@ public void All_Null_Nested_List_Returns_Empty_List() }, null }; - Assert.That(Flattener.Flatten(nestedList), Is.Empty); + Assert.Empty(Flattener.Flatten(nestedList)); } } \ No newline at end of file diff --git a/exercises/food-chain/FoodChain.cs b/exercises/food-chain/FoodChain.cs new file mode 100644 index 0000000000..5023fb38af --- /dev/null +++ b/exercises/food-chain/FoodChain.cs @@ -0,0 +1,14 @@ +using System; + +public static class FoodChain +{ + public static string Song() + { + throw new NotImplementedException("You need to implement this function."); + } + + public static string Verse(int number) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/food-chain/FoodChain.csproj b/exercises/food-chain/FoodChain.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/food-chain/FoodChain.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/food-chain/FoodChainTest.cs b/exercises/food-chain/FoodChainTest.cs index 3493c0b079..f625e58cf8 100644 --- a/exercises/food-chain/FoodChainTest.cs +++ b/exercises/food-chain/FoodChainTest.cs @@ -1,18 +1,17 @@ -using NUnit.Framework; +using Xunit; public class FoodChainTest { - [Test] + [Fact] public void Verse_one() { const string expected = "I know an old lady who swallowed a fly.\n" + "I don't know why she swallowed the fly. Perhaps she'll die."; - Assert.That(FoodChain.Verse(1), Is.EqualTo(expected)); + Assert.Equal(expected, FoodChain.Verse(1)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Verse_two() { const string expected = "I know an old lady who swallowed a spider.\n" + @@ -20,11 +19,10 @@ public void Verse_two() "She swallowed the spider to catch the fly.\n" + "I don't know why she swallowed the fly. Perhaps she'll die."; - Assert.That(FoodChain.Verse(2), Is.EqualTo(expected)); + Assert.Equal(expected, FoodChain.Verse(2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Verse_four() { const string expected = "I know an old lady who swallowed a cat.\n" + @@ -34,21 +32,19 @@ public void Verse_four() "She swallowed the spider to catch the fly.\n" + "I don't know why she swallowed the fly. Perhaps she'll die."; - Assert.That(FoodChain.Verse(4), Is.EqualTo(expected)); + Assert.Equal(expected, FoodChain.Verse(4)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Verse_eight() { const string expected = "I know an old lady who swallowed a horse.\n" + "She's dead, of course!"; - Assert.That(FoodChain.Verse(8), Is.EqualTo(expected)); + Assert.Equal(expected, FoodChain.Verse(8)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Complete_song() { const string expected = "I know an old lady who swallowed a fly.\n" + @@ -102,6 +98,6 @@ public void Complete_song() "I know an old lady who swallowed a horse.\n" + "She's dead, of course!"; - Assert.That(FoodChain.Song(), Is.EqualTo(expected)); + Assert.Equal(expected, FoodChain.Song()); } } \ No newline at end of file diff --git a/exercises/forth/Forth.cs b/exercises/forth/Forth.cs new file mode 100644 index 0000000000..8fc0e91cd7 --- /dev/null +++ b/exercises/forth/Forth.cs @@ -0,0 +1,27 @@ +using System; + +public enum ForthError +{ + DivisionByZero, + StackUnderflow, + InvalidWord, + UnknownWord +} + +public class ForthException : Exception +{ + public ForthException(ForthError error) + { + Error = error; + } + + public ForthError Error { get; } +} + +public static class Forth +{ + public static string Eval(string input) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/forth/Forth.csproj b/exercises/forth/Forth.csproj new file mode 100644 index 0000000000..c826cd5794 --- /dev/null +++ b/exercises/forth/Forth.csproj @@ -0,0 +1,19 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + + diff --git a/exercises/forth/ForthTest.cs b/exercises/forth/ForthTest.cs index fb64ad1166..88ec2e67a7 100644 --- a/exercises/forth/ForthTest.cs +++ b/exercises/forth/ForthTest.cs @@ -1,134 +1,120 @@ -using NUnit.Framework; +using Xunit; public class ForthTest { - [Test] + [Fact] public void No_input() { - Assert.That(Forth.Eval(""), Is.EqualTo("")); + Assert.Equal("", Forth.Eval("")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Numbers_just_get_pushed_onto_the_stack() { - Assert.That(Forth.Eval("1 2 3 4 5"), Is.EqualTo("1 2 3 4 5")); + Assert.Equal("1 2 3 4 5", Forth.Eval("1 2 3 4 5")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Non_word_characters_are_separators() { - Assert.That(Forth.Eval("1\v2\t3\n4\r5 6\t7"), Is.EqualTo("1 2 3 4 5 6 7")); + Assert.Equal("1 2 3 4 5 6 7", Forth.Eval("1\v2\t3\n4\r5 6\t7")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Basic_arithmetic() { - Assert.That(Forth.Eval("1 2 + 4 -"), Is.EqualTo("-1")); - Assert.That(Forth.Eval("2 4 * 3 /"), Is.EqualTo("2")); + Assert.Equal("-1", Forth.Eval("1 2 + 4 -")); + Assert.Equal("2", Forth.Eval("2 4 * 3 /")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Division_by_zero() { var exception = Assert.Throws(() => Forth.Eval("4 2 2 - /")); - Assert.That(exception.Error, Is.EqualTo(ForthError.DivisionByZero)); + Assert.Equal(ForthError.DivisionByZero, exception.Error); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void dup() { - Assert.That(Forth.Eval("1 DUP"), Is.EqualTo("1 1")); - Assert.That(Forth.Eval("1 2 Dup"), Is.EqualTo("1 2 2")); + Assert.Equal("1 1", Forth.Eval("1 DUP")); + Assert.Equal("1 2 2", Forth.Eval("1 2 Dup")); var exception = Assert.Throws(() => Forth.Eval("dup")); - Assert.That(exception.Error, Is.EqualTo(ForthError.StackUnderflow)); + Assert.Equal(ForthError.StackUnderflow, exception.Error); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void drop() { - Assert.That(Forth.Eval("1 drop"), Is.EqualTo("")); - Assert.That(Forth.Eval("1 2 drop"), Is.EqualTo("1")); + Assert.Equal("", Forth.Eval("1 drop")); + Assert.Equal("1", Forth.Eval("1 2 drop")); var exception = Assert.Throws(() => Forth.Eval("drop")); - Assert.That(exception.Error, Is.EqualTo(ForthError.StackUnderflow)); + Assert.Equal(ForthError.StackUnderflow, exception.Error); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void swap() { - Assert.That(Forth.Eval("1 2 swap"), Is.EqualTo("2 1")); - Assert.That(Forth.Eval("1 2 3 swap"), Is.EqualTo("1 3 2")); + Assert.Equal("2 1", Forth.Eval("1 2 swap")); + Assert.Equal("1 3 2", Forth.Eval("1 2 3 swap")); var exception1 = Assert.Throws(() => Forth.Eval("1 swap")); - Assert.That(exception1.Error, Is.EqualTo(ForthError.StackUnderflow)); + Assert.Equal(ForthError.StackUnderflow, exception1.Error); var exception2 = Assert.Throws(() => Forth.Eval("swap")); - Assert.That(exception2.Error, Is.EqualTo(ForthError.StackUnderflow)); + Assert.Equal(ForthError.StackUnderflow, exception2.Error); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void over() { - Assert.That(Forth.Eval("1 2 over"), Is.EqualTo("1 2 1")); - Assert.That(Forth.Eval("1 2 3 over"), Is.EqualTo("1 2 3 2")); + Assert.Equal("1 2 1", Forth.Eval("1 2 over")); + Assert.Equal("1 2 3 2", Forth.Eval("1 2 3 over")); var exception1 = Assert.Throws(() => Forth.Eval("1 over")); - Assert.That(exception1.Error, Is.EqualTo(ForthError.StackUnderflow)); + Assert.Equal(ForthError.StackUnderflow, exception1.Error); var exception2 = Assert.Throws(() => Forth.Eval("over")); - Assert.That(exception2.Error, Is.EqualTo(ForthError.StackUnderflow)); + Assert.Equal(ForthError.StackUnderflow, exception2.Error); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Defining_a_new_word() { - Assert.That(Forth.Eval(": dup-twice dup dup ; 1 dup-twice"), Is.EqualTo("1 1 1")); + Assert.Equal("1 1 1", Forth.Eval(": dup-twice dup dup ; 1 dup-twice")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Redefining_an_existing_word() { - Assert.That(Forth.Eval(": foo dup ; : foo dup dup ; 1 foo"), Is.EqualTo("1 1 1")); + Assert.Equal("1 1 1", Forth.Eval(": foo dup ; : foo dup dup ; 1 foo")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Redefining_an_existing_built_in_word() { - Assert.That(Forth.Eval(": swap dup ; 1 swap"), Is.EqualTo("1 1")); + Assert.Equal("1 1", Forth.Eval(": swap dup ; 1 swap")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Defining_words_with_odd_characters() { - Assert.That(Forth.Eval(": € 220371 ; €"), Is.EqualTo("220371")); + Assert.Equal("220371", Forth.Eval(": € 220371 ; €")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Defining_a_number() { var exception = Assert.Throws(() => Forth.Eval(": 1 2 ;")); - Assert.That(exception.Error, Is.EqualTo(ForthError.InvalidWord)); + Assert.Equal(ForthError.InvalidWord, exception.Error); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Calling_a_non_existing_word() { var exception = Assert.Throws(() => Forth.Eval("1 foo")); - Assert.That(exception.Error, Is.EqualTo(ForthError.UnknownWord)); + Assert.Equal(ForthError.UnknownWord, exception.Error); } } diff --git a/exercises/gigasecond/Example.cs b/exercises/gigasecond/Example.cs index c30eb8bc72..451cdfb4fc 100644 --- a/exercises/gigasecond/Example.cs +++ b/exercises/gigasecond/Example.cs @@ -1,6 +1,6 @@ using System; -public class Gigasecond +public static class Gigasecond { public static DateTime Date(DateTime birthDate) { diff --git a/exercises/gigasecond/Gigasecond.cs b/exercises/gigasecond/Gigasecond.cs new file mode 100644 index 0000000000..6cd6c55854 --- /dev/null +++ b/exercises/gigasecond/Gigasecond.cs @@ -0,0 +1,9 @@ +using System; + +public static class Gigasecond +{ + public static DateTime Date(DateTime birthDate) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/gigasecond/Gigasecond.csproj b/exercises/gigasecond/Gigasecond.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/gigasecond/Gigasecond.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/gigasecond/GigasecondTest.cs b/exercises/gigasecond/GigasecondTest.cs index e8ab02053d..4f7322916d 100644 --- a/exercises/gigasecond/GigasecondTest.cs +++ b/exercises/gigasecond/GigasecondTest.cs @@ -1,29 +1,26 @@ using System; -using NUnit.Framework; +using Xunit; -[TestFixture] public class GigasecondTest { - [Test] + [Fact] public void First_date() { var date = Gigasecond.Date(new DateTime(2011, 4, 25, 0, 0, 0, DateTimeKind.Utc)); - Assert.That(date, Is.EqualTo(new DateTime(2043, 1, 1, 1, 46, 40, DateTimeKind.Utc))); + Assert.Equal(new DateTime(2043, 1, 1, 1, 46, 40, DateTimeKind.Utc), date); } - [Test] - [Ignore("Remove to run test")] + [Fact(Skip = "Remove to run test")] public void Another_date() { var date = Gigasecond.Date(new DateTime(1977, 6, 13, 0, 0, 0, DateTimeKind.Utc)); - Assert.That(date, Is.EqualTo(new DateTime(2009, 2, 19, 1, 46, 40, DateTimeKind.Utc))); + Assert.Equal(new DateTime(2009, 2, 19, 1, 46, 40, DateTimeKind.Utc), date); } - [Test] - [Ignore("Remove to run test")] + [Fact(Skip = "Remove to run test")] public void Yet_another_date() { var date = Gigasecond.Date(new DateTime(1959, 7, 19, 0, 0, 0, DateTimeKind.Utc)); - Assert.That(date, Is.EqualTo(new DateTime(1991, 3, 27, 1, 46, 40, DateTimeKind.Utc))); + Assert.Equal(new DateTime(1991, 3, 27, 1, 46, 40, DateTimeKind.Utc), date); } } \ No newline at end of file diff --git a/exercises/go-counting/Example.cs b/exercises/go-counting/Example.cs index 235b8f5430..0d3bc38ff5 100644 --- a/exercises/go-counting/Example.cs +++ b/exercises/go-counting/Example.cs @@ -1,35 +1,34 @@ using System; -using System.Drawing; using System.Collections.Generic; using System.Linq; -public class GoCounting +public enum GoPlayer { - public enum Player - { - None, - Black, - White - } + None, + Black, + White +} - private readonly Player[][] board; +public class GoCounting +{ + private readonly GoPlayer[][] board; public GoCounting(string input) { board = ParseBoard(input); } - private static Player CharToPlayer(char c) + private static GoPlayer CharToPlayer(char c) { switch (c) { - case 'B': return Player.Black; - case 'W': return Player.White; - default: return Player.None; + case 'B': return GoPlayer.Black; + case 'W': return GoPlayer.White; + default: return GoPlayer.None; } } - private static Player[][] ParseBoard(string input) + private static GoPlayer[][] ParseBoard(string input) { var split = input.Split('\n'); var rows = split.Length; @@ -41,45 +40,45 @@ private static Player[][] ParseBoard(string input) private int Cols => board[0].Length; private int Rows => board.Length; - private bool IsValidCoordinate(Point coordinate) => - coordinate.Y >= 0 && coordinate.Y < Rows && - coordinate.X >= 0 && coordinate.X < Cols; + private bool IsValidCoordinate(Tuple coordinate) => + coordinate.Item2 >= 0 && coordinate.Item2 < Rows && + coordinate.Item1 >= 0 && coordinate.Item1 < Cols; - private Player GetPlayer(Point coordinate) => board[coordinate.Y][coordinate.X]; + private GoPlayer GetPlayer(Tuple coordinate) => board[coordinate.Item2][coordinate.Item1]; - private bool IsEmpty(Point coordinate) => GetPlayer(coordinate) == Player.None; - private bool IsTaken(Point coordinate) => !IsEmpty(coordinate); + private bool IsEmpty(Tuple coordinate) => GetPlayer(coordinate) == GoPlayer.None; + private bool IsTaken(Tuple coordinate) => !IsEmpty(coordinate); - private IEnumerable EmptyCoordinates() + private IEnumerable> EmptyCoordinates() { return Enumerable.Range(0, Cols).SelectMany(col => - Enumerable.Range(0, Rows).Select(row => new Point(col, row))) + Enumerable.Range(0, Rows).Select(row => new Tuple(col, row))) .Where(IsEmpty); } - private IEnumerable NeighborCoordinates(Point coordinate) + private IEnumerable> NeighborCoordinates(Tuple coordinate) { - var row = coordinate.Y; - var col = coordinate.X; + var row = coordinate.Item2; + var col = coordinate.Item1; var coords = new[] { - new Point(col, row - 1), - new Point(col-1, row), - new Point(col+1, row), - new Point(col, row+1) + new Tuple(col, row - 1), + new Tuple(col-1, row), + new Tuple(col+1, row), + new Tuple(col, row+1) }; return coords.Where(IsValidCoordinate); } - private IEnumerable TakenNeighborCoordinates(Point coordinate) => + private IEnumerable> TakenNeighborCoordinates(Tuple coordinate) => NeighborCoordinates(coordinate).Where(IsTaken); - private IEnumerable EmptyNeighborCoordinates(Point coordinate) => + private IEnumerable> EmptyNeighborCoordinates(Tuple coordinate) => NeighborCoordinates(coordinate).Where(IsEmpty); - private Player TerritoryOwner(HashSet coords) + private GoPlayer TerritoryOwner(HashSet> coords) { var neighborColors = coords.SelectMany(TakenNeighborCoordinates).Select(GetPlayer); var uniqueNeighborColors = ToSet(neighborColors); @@ -87,15 +86,15 @@ private Player TerritoryOwner(HashSet coords) if (uniqueNeighborColors.Count == 1) return uniqueNeighborColors.First(); - return Player.None; + return GoPlayer.None; } - private HashSet TerritoryHelper(HashSet remainder, HashSet acc) + private HashSet> TerritoryHelper(HashSet> remainder, HashSet> acc) { if (!remainder.Any()) return acc; - var emptyNeighbors = new HashSet(remainder.SelectMany(EmptyNeighborCoordinates)); + var emptyNeighbors = new HashSet>(remainder.SelectMany(EmptyNeighborCoordinates)); emptyNeighbors.ExceptWith(acc); var newAcc = ToSet(acc); @@ -103,12 +102,12 @@ private HashSet TerritoryHelper(HashSet remainder, HashSet return TerritoryHelper(emptyNeighbors, newAcc); } - private HashSet Territory(Point coordinate) => + private HashSet> Territory(Tuple coordinate) => IsValidCoordinate(coordinate) && IsEmpty(coordinate) ? TerritoryHelper(ToSingletonSet(coordinate), ToSingletonSet(coordinate)) - : new HashSet(); + : new HashSet>(); - public Tuple> TerritoryFor(Point coord) + public Tuple>> TerritoryFor(Tuple coord) { var coords = Territory(coord); if (!coords.Any()) @@ -118,7 +117,7 @@ public Tuple> TerritoryFor(Point coord) return Tuple.Create(owner, coords.AsEnumerable()); } - private Dictionary> TerritoriesHelper(HashSet remainder, Dictionary> acc) + private Dictionary>> TerritoriesHelper(HashSet> remainder, Dictionary>> acc) { if (!remainder.Any()) return acc; @@ -130,16 +129,17 @@ private Dictionary> TerritoriesHelper(HashSet var newRemainder = ToSet(remainder); newRemainder.ExceptWith(coords); - var newAcc = new Dictionary>(acc); - newAcc[owner] = coords; - + var newAcc = new Dictionary>>(acc) + { + [owner] = coords + }; return TerritoriesHelper(newRemainder, newAcc); } - public Dictionary> Territories() + public Dictionary>> Territories() { var emptyCoords = EmptyCoordinates(); - return TerritoriesHelper(ToSet(emptyCoords), new Dictionary>()); + return TerritoriesHelper(ToSet(emptyCoords), new Dictionary>>()); } private static HashSet ToSet(IEnumerable value) => new HashSet(value); diff --git a/exercises/go-counting/GoCounting.cs b/exercises/go-counting/GoCounting.cs new file mode 100644 index 0000000000..b7dde33f9f --- /dev/null +++ b/exercises/go-counting/GoCounting.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; + +public enum GoPlayer +{ + None, + Black, + White +} + +public class GoCounting +{ + public GoCounting(string input) + { + throw new NotImplementedException("You need to implement this function."); + } + + public Tuple>> TerritoryFor(Tuple coord) + { + throw new NotImplementedException("You need to implement this function."); + } + + public Dictionary>> Territories() + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/go-counting/GoCounting.csproj b/exercises/go-counting/GoCounting.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/go-counting/GoCounting.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/go-counting/GoCountingTest.cs b/exercises/go-counting/GoCountingTest.cs index b16a3b9384..56381c9358 100644 --- a/exercises/go-counting/GoCountingTest.cs +++ b/exercises/go-counting/GoCountingTest.cs @@ -1,7 +1,7 @@ -using NUnit.Framework; +using Xunit; using System; using System.Collections.Generic; -using System.Drawing; +using System.Linq; public class GoCountingTest { @@ -29,99 +29,111 @@ public class GoCountingTest " B B " }); - [Test] + [Fact] public void FiveByFiveTerritoryForBlack() { var board = new GoCounting(boardFiveByFive); - var result = board.TerritoryFor(new Point(0, 1)); - Assert.That(result.Item1, Is.EqualTo(GoCounting.Player.Black)); - Assert.That(result.Item2, Is.EquivalentTo(new[] { new Point(0, 0), new Point(0, 1), new Point(1, 0) })); + var result = board.TerritoryFor(new Tuple(0, 1)); + var expected = new HashSet> { new Tuple(0, 0), new Tuple(0, 1), new Tuple(1, 0) }; + Assert.Equal(GoPlayer.Black, result.Item1); + Assert.True(expected.SetEquals(result.Item2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void FiveByFiveTerritoryForWhite() { var board = new GoCounting(boardFiveByFive); - var result = board.TerritoryFor(new Point(2, 3)); - Assert.That(result.Item1, Is.EqualTo(GoCounting.Player.White)); - Assert.That(result.Item2, Is.EquivalentTo(new[] { new Point(2, 3) })); + var result = board.TerritoryFor(new Tuple(2, 3)); + var expected = new HashSet> { new Tuple(2, 3) }; + Assert.Equal(GoPlayer.White, result.Item1); + Assert.True(expected.SetEquals(result.Item2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void FiveByFiveOpenTerritory() { var board = new GoCounting(boardFiveByFive); - var result = board.TerritoryFor(new Point(1, 4)); - Assert.That(result.Item1, Is.EqualTo(GoCounting.Player.None)); - Assert.That(result.Item2, Is.EquivalentTo(new[] { new Point(0, 3), new Point(0, 4), new Point(1, 4) })); + var result = board.TerritoryFor(new Tuple(1, 4)); + var expected = new HashSet> { new Tuple(0, 3), new Tuple(0, 4), new Tuple(1, 4) }; + Assert.Equal(GoPlayer.None, result.Item1); + Assert.True(expected.SetEquals(result.Item2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void FiveByFiveNonTerritoryStone() { var board = new GoCounting(boardFiveByFive); - Assert.That(board.TerritoryFor(new Point(1, 1)), Is.Null); + Assert.Null(board.TerritoryFor(new Tuple(1, 1))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void FiveByFiveNonTerritoryDueToTooLowCoordinate() { var board = new GoCounting(boardFiveByFive); - Assert.That(board.TerritoryFor(new Point(-1, 1)), Is.Null); + Assert.Null(board.TerritoryFor(new Tuple(-1, 1))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void FiveByFiveNonTerritoryDueToTooHighCoordinate() { var board = new GoCounting(boardFiveByFive); - Assert.That(board.TerritoryFor(new Point(1, 5)), Is.Null); + Assert.Null(board.TerritoryFor(new Tuple(1, 5))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void MinimalBoardWithNoTerritories() { var input = "B"; var board = new GoCounting(input); - var expected = new Dictionary>(); + var expected = new Dictionary>>(); - Assert.That(board.Territories(), Is.EquivalentTo(expected)); + Assert.Equal(expected, board.Territories()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void OneTerritoryCoveringTheWholeBoard() { var input = " "; var board = new GoCounting(input); + var actual = board.Territories(); - var expected = new Dictionary> + var expected = new Dictionary>> { - [GoCounting.Player.None] = new[] { new Point(0, 0) } + [GoPlayer.None] = new[] { new Tuple(0, 0) } }; - - Assert.That(board.Territories(), Is.EquivalentTo(expected)); + + Assert.Equal(expected.Keys, actual.Keys); + Assert.Equal(expected[GoPlayer.None], actual[GoPlayer.None]); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void TwoTerritoriesOnRectangularBoard() { var input = string.Join("\n", new[] { " BW ", " BW " }); var board = new GoCounting(input); + var actual = board.Territories(); - var expected = new Dictionary> + var expected = new Dictionary>> { - [GoCounting.Player.Black] = new[] { new Point(0, 0), new Point(0, 1) }, - [GoCounting.Player.White] = new[] { new Point(3, 0), new Point(3, 1) } + [GoPlayer.Black] = new[] { new Tuple(0, 0), new Tuple(0, 1) }, + [GoPlayer.White] = new[] { new Tuple(3, 0), new Tuple(3, 1) } }; + + Assert.Equal(expected.Keys, actual.Keys); + Assert.Equal(expected[GoPlayer.Black], actual[GoPlayer.Black]); + Assert.Equal(expected[GoPlayer.White], actual[GoPlayer.White]); + } + + private class EnumerableEqualityComparer : IEqualityComparer> + { + public static readonly EnumerableEqualityComparer Instance = new EnumerableEqualityComparer(); + + public bool Equals(IEnumerable x, IEnumerable y) => x.SequenceEqual(y); - Assert.That(board.Territories(), Is.EquivalentTo(expected)); + public int GetHashCode(IEnumerable obj) + { + throw new NotImplementedException(); + } } } diff --git a/exercises/grade-school/Example.cs b/exercises/grade-school/Example.cs index b556d33043..165a62e452 100644 --- a/exercises/grade-school/Example.cs +++ b/exercises/grade-school/Example.cs @@ -1,28 +1,26 @@ using System.Collections.Generic; +using System.Linq; public class School { - public IDictionary> Roster { get; private set; } - - public School() - { - Roster = new Dictionary>(); - } - + private readonly Dictionary> roster = new Dictionary>(); + public void Add(string student, int grade) { - if (Roster.ContainsKey(grade)) - Roster[grade].Add(student); + if (roster.ContainsKey(grade)) + roster[grade].Add(student); else - Roster.Add(grade, new SortedList { student }); + roster.Add(grade, new SortedList { student }); } - public IList Grade(int grade) + public IEnumerable Roster(int grade) => roster[grade]; + + public IEnumerable Grade(int grade) { IList students; - if (Roster.TryGetValue(grade, out students)) - return students; - return new List(0); + if (roster.TryGetValue(grade, out students)) + return students.AsEnumerable(); + return Enumerable.Empty(); } } diff --git a/exercises/grade-school/GradeSchool.cs b/exercises/grade-school/GradeSchool.cs new file mode 100644 index 0000000000..7d359a4bfb --- /dev/null +++ b/exercises/grade-school/GradeSchool.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; + +public class School +{ + public void Add(string student, int grade) + { + throw new NotImplementedException("You need to implement this function."); + } + + public IEnumerable Roster(int grade) + { + throw new NotImplementedException("You need to implement this function."); + } + + public IEnumerable Grade(int grade) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/grade-school/GradeSchool.csproj b/exercises/grade-school/GradeSchool.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/grade-school/GradeSchool.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/grade-school/GradeSchoolTest.cs b/exercises/grade-school/GradeSchoolTest.cs index e38e09ac48..1391d164d1 100644 --- a/exercises/grade-school/GradeSchoolTest.cs +++ b/exercises/grade-school/GradeSchoolTest.cs @@ -1,81 +1,61 @@ -using System.Collections.Generic; -using NUnit.Framework; +using Xunit; -[TestFixture] public class GradeSchoolTest { - private School school; - - [SetUp] - public void Setup() - { - school = new School(); - } - - [Test] - public void New_school_has_an_empty_roster() - { - Assert.That(school.Roster, Has.Count.EqualTo(0)); - } - - [Ignore("Remove to run test")] - [Test] + private readonly School school = new School(); + + [Fact] public void Adding_a_student_adds_them_to_the_roster_for_the_given_grade() { school.Add("Aimee", 2); - var expected = new List { "Aimee" }; - Assert.That(school.Roster[2], Is.EqualTo(expected)); + var expected = new [] { "Aimee" }; + Assert.Equal(expected, school.Roster(2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Adding_more_students_to_the_same_grade_adds_them_to_the_roster() { school.Add("Blair", 2); school.Add("James", 2); school.Add("Paul", 2); - var expected = new List { "Blair", "James", "Paul" }; - Assert.That(school.Roster[2], Is.EqualTo(expected)); + var expected = new [] { "Blair", "James", "Paul" }; + Assert.Equal(expected, school.Roster(2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Adding_students_to_different_grades_adds_them_to_the_roster() { school.Add("Chelsea", 3); school.Add("Logan", 7); - Assert.That(school.Roster[3], Is.EqualTo(new List { "Chelsea" })); - Assert.That(school.Roster[7], Is.EqualTo(new List { "Logan" })); + Assert.Equal(new [] { "Chelsea" }, school.Roster(3)); + Assert.Equal(new [] { "Logan" }, school.Roster(7)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Grade_returns_the_students_in_that_grade_in_alphabetical_order() { school.Add("Franklin", 5); school.Add("Bradley", 5); school.Add("Jeff", 1); - var expected = new List { "Bradley", "Franklin" }; - Assert.That(school.Grade(5), Is.EqualTo(expected)); + var expected = new [] { "Bradley", "Franklin" }; + Assert.Equal(expected, school.Grade(5)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Grade_returns_an_empty_list_if_there_are_no_students_in_that_grade() { - Assert.That(school.Grade(1), Is.EqualTo(new List())); + Assert.Empty(school.Grade(1)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Student_names_in_each_grade_in_roster_are_sorted() { school.Add("Jennifer", 4); school.Add("Kareem", 6); school.Add("Christopher", 4); school.Add("Kyle", 3); - Assert.That(school.Roster[3], Is.EqualTo(new List { "Kyle" })); - Assert.That(school.Roster[4], Is.EqualTo(new List { "Christopher", "Jennifer" })); - Assert.That(school.Roster[6], Is.EqualTo(new List { "Kareem" })); + Assert.Equal(new [] { "Kyle" }, school.Roster(3)); + Assert.Equal(new [] { "Christopher", "Jennifer" }, school.Roster(4)); + Assert.Equal(new [] { "Kareem" }, school.Roster(6)); } } \ No newline at end of file diff --git a/exercises/grains/Example.cs b/exercises/grains/Example.cs index 65de26bfcd..4b152c4eed 100644 --- a/exercises/grains/Example.cs +++ b/exercises/grains/Example.cs @@ -1,4 +1,4 @@ -public class Grains +public static class Grains { public static ulong Square(int n) { diff --git a/exercises/grains/Grains.cs b/exercises/grains/Grains.cs new file mode 100644 index 0000000000..54162d0958 --- /dev/null +++ b/exercises/grains/Grains.cs @@ -0,0 +1,14 @@ +using System; + +public static class Grains +{ + public static ulong Square(int n) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static ulong Total() + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/grains/Grains.csproj b/exercises/grains/Grains.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/grains/Grains.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/grains/GrainsTest.cs b/exercises/grains/GrainsTest.cs index b540e25576..c02f35c2b3 100644 --- a/exercises/grains/GrainsTest.cs +++ b/exercises/grains/GrainsTest.cs @@ -1,60 +1,52 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class GrainsTest { - [Test] + [Fact] public void Test_square_1() { - Assert.That(Grains.Square(1), Is.EqualTo(1)); + Assert.Equal(1ul, Grains.Square(1)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_square_2() { - Assert.That(Grains.Square(2), Is.EqualTo(2)); + Assert.Equal(2ul, Grains.Square(2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_square_3() { - Assert.That(Grains.Square(3), Is.EqualTo(4)); + Assert.Equal(4ul, Grains.Square(3)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_square_4() { - Assert.That(Grains.Square(4), Is.EqualTo(8)); + Assert.Equal(8ul, Grains.Square(4)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_square_16() { - Assert.That(Grains.Square(16), Is.EqualTo(32768)); + Assert.Equal(32768ul, Grains.Square(16)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_square_32() { - Assert.That(Grains.Square(32), Is.EqualTo(2147483648)); + Assert.Equal(2147483648ul, Grains.Square(32)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_square_64() { - Assert.That(Grains.Square(64), Is.EqualTo(9223372036854775808)); + Assert.Equal(9223372036854775808ul, Grains.Square(64)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_total_grains() { - Assert.That(Grains.Total(), Is.EqualTo(18446744073709551615)); + Assert.Equal(18446744073709551615ul, Grains.Total()); } } \ No newline at end of file diff --git a/exercises/grep/Grep.cs b/exercises/grep/Grep.cs new file mode 100644 index 0000000000..119049f93d --- /dev/null +++ b/exercises/grep/Grep.cs @@ -0,0 +1,9 @@ +using System; + +public static class Grep +{ + public static string Find(string pattern, string flags, string[] files) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/grep/Grep.csproj b/exercises/grep/Grep.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/grep/Grep.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/grep/GrepTest.cs b/exercises/grep/GrepTest.cs index b3538fbd5b..7fff8ebcf0 100644 --- a/exercises/grep/GrepTest.cs +++ b/exercises/grep/GrepTest.cs @@ -1,7 +1,8 @@ -using System.IO; -using NUnit.Framework; +using System; +using System.IO; +using Xunit; -public class GrepTest +public class GrepTest : IDisposable { private const string IliadFileName = "iliad.txt"; private const string IliadContents = @@ -38,18 +39,16 @@ If I refuse to wed Demetrius. Of Oreb, or of Sinai, didst inspire That Shepherd, who first taught the chosen Seed "; - - [OneTimeSetUp] - public void SetUp() + + public GrepTest() { Directory.SetCurrentDirectory(Path.GetTempPath()); File.WriteAllText(IliadFileName, IliadContents); File.WriteAllText(MidsummerNightFileName, MidsummerNightContents); File.WriteAllText(ParadiseLostFileName, ParadiseLostContents); } - - [OneTimeTearDown] - public void TearDown() + + public void Dispose() { Directory.SetCurrentDirectory(Path.GetTempPath()); File.Delete(IliadFileName); @@ -57,7 +56,7 @@ public void TearDown() File.Delete(ParadiseLostFileName); } - [Test] + [Fact] public void One_file_one_match_no_flags() { const string pattern = "Agamemnon"; @@ -67,11 +66,10 @@ public void One_file_one_match_no_flags() const string expected = "Of Atreus, Agamemnon, King of men.\n"; - Assert.That(Grep.Find(pattern, flags, files), Is.EqualTo(expected)); + Assert.Equal(expected, Grep.Find(pattern, flags, files)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One_file_one_match_print_line_numbers_flag() { const string pattern = "Forbidden"; @@ -81,11 +79,10 @@ public void One_file_one_match_print_line_numbers_flag() const string expected = "2:Of that Forbidden Tree, whose mortal tast\n"; - Assert.That(Grep.Find(pattern, flags, files), Is.EqualTo(expected)); + Assert.Equal(expected, Grep.Find(pattern, flags, files)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One_file_one_match_case_insensitive_flag() { const string pattern = "Forbidden"; @@ -95,11 +92,10 @@ public void One_file_one_match_case_insensitive_flag() const string expected = "Of that Forbidden Tree, whose mortal tast\n"; - Assert.That(Grep.Find(pattern, flags, files), Is.EqualTo(expected)); + Assert.Equal(expected, Grep.Find(pattern, flags, files)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One_file_one_match_print_file_names_flag() { const string pattern = "Forbidden"; @@ -109,11 +105,10 @@ public void One_file_one_match_print_file_names_flag() var expected = $"{ParadiseLostFileName}\n"; - Assert.That(Grep.Find(pattern, flags, files), Is.EqualTo(expected)); + Assert.Equal(expected, Grep.Find(pattern, flags, files)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One_file_one_match_match_entire_lines_flag() { const string pattern = "With loss of Eden, till one greater Man"; @@ -123,11 +118,10 @@ public void One_file_one_match_match_entire_lines_flag() const string expected = "With loss of Eden, till one greater Man\n"; - Assert.That(Grep.Find(pattern, flags, files), Is.EqualTo(expected)); + Assert.Equal(expected, Grep.Find(pattern, flags, files)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One_file_one_match_multiple_flags() { const string pattern = "OF ATREUS, Agamemnon, KIng of MEN."; @@ -136,11 +130,10 @@ public void One_file_one_match_multiple_flags() const string expected = "9:Of Atreus, Agamemnon, King of men.\n"; - Assert.That(Grep.Find(pattern, flags, files), Is.EqualTo(expected)); + Assert.Equal(expected, Grep.Find(pattern, flags, files)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One_file_several_matches_no_flags() { const string pattern = "may"; @@ -152,11 +145,10 @@ public void One_file_several_matches_no_flags() "But I beseech your grace that I may know\n" + "The worst that may befall me in this case,\n"; - Assert.That(Grep.Find(pattern, flags, files), Is.EqualTo(expected)); + Assert.Equal(expected, Grep.Find(pattern, flags, files)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One_file_several_matches_print_line_numbers_flag() { const string pattern = "may"; @@ -168,11 +160,10 @@ public void One_file_several_matches_print_line_numbers_flag() "5:But I beseech your grace that I may know\n" + "6:The worst that may befall me in this case,\n"; - Assert.That(Grep.Find(pattern, flags, files), Is.EqualTo(expected)); + Assert.Equal(expected, Grep.Find(pattern, flags, files)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One_file_several_matches_match_entire_lines_flag() { const string pattern = "may"; @@ -181,11 +172,10 @@ public void One_file_several_matches_match_entire_lines_flag() const string expected = ""; - Assert.That(Grep.Find(pattern, flags, files), Is.EqualTo(expected)); + Assert.Equal(expected, Grep.Find(pattern, flags, files)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One_file_several_matches_case_insensitive_flag() { const string pattern = "ACHILLES"; @@ -196,11 +186,10 @@ public void One_file_several_matches_case_insensitive_flag() "Achilles sing, O Goddess! Peleus' son;\n" + "The noble Chief Achilles from the son\n"; - Assert.That(Grep.Find(pattern, flags, files), Is.EqualTo(expected)); + Assert.Equal(expected, Grep.Find(pattern, flags, files)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One_file_several_matches_inverted_flag() { const string pattern = "Of"; @@ -214,26 +203,26 @@ public void One_file_several_matches_inverted_flag() "Sing Heav'nly Muse, that on the secret top\n" + "That Shepherd, who first taught the chosen Seed\n"; - Assert.That(Grep.Find(pattern, flags, files), Is.EqualTo(expected)); + Assert.Equal(expected, Grep.Find(pattern, flags, files)); } - [TestCase("", Ignore = "Remove to run test case")] - [TestCase("-n", Ignore = "Remove to run test case")] - [TestCase("-l", Ignore = "Remove to run test case")] - [TestCase("-x", Ignore = "Remove to run test case")] - [TestCase("-i", Ignore = "Remove to run test case")] - [TestCase("-n -l -x -i", Ignore = "Remove to run test case")] + [Theory(Skip = "Remove to run test")] + [InlineData("")] + [InlineData("-n")] + [InlineData("-l")] + [InlineData("-x")] + [InlineData("-i")] + [InlineData("-n -l -x -i")] public void One_file_no_matches_various_flags(string flags) { const string pattern = "Gandalf"; var files = new[] { IliadFileName }; const string expected = ""; - Assert.That(Grep.Find(pattern, flags, files), Is.EqualTo(expected)); + Assert.Equal(expected, Grep.Find(pattern, flags, files)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Multiple_files_one_match_no_flags() { const string pattern = "Agamemnon"; @@ -243,11 +232,10 @@ public void Multiple_files_one_match_no_flags() var expected = $"{IliadFileName}:Of Atreus, Agamemnon, King of men.\n"; - Assert.That(Grep.Find(pattern, flags, files), Is.EqualTo(expected)); + Assert.Equal(expected, Grep.Find(pattern, flags, files)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Multiple_files_several_matches_no_flags() { const string pattern = "may"; @@ -259,11 +247,10 @@ public void Multiple_files_several_matches_no_flags() $"{MidsummerNightFileName}:But I beseech your grace that I may know\n" + $"{MidsummerNightFileName}:The worst that may befall me in this case,\n"; - Assert.That(Grep.Find(pattern, flags, files), Is.EqualTo(expected)); + Assert.Equal(expected, Grep.Find(pattern, flags, files)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Multiple_files_several_matches_print_line_numbers_flag() { const string pattern = "that"; @@ -276,11 +263,10 @@ public void Multiple_files_several_matches_print_line_numbers_flag() $"{ParadiseLostFileName}:2:Of that Forbidden Tree, whose mortal tast\n" + $"{ParadiseLostFileName}:6:Sing Heav'nly Muse, that on the secret top\n"; - Assert.That(Grep.Find(pattern, flags, files), Is.EqualTo(expected)); + Assert.Equal(expected, Grep.Find(pattern, flags, files)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Multiple_files_several_matches_print_file_names_flag() { const string pattern = "who"; @@ -291,11 +277,10 @@ public void Multiple_files_several_matches_print_file_names_flag() $"{IliadFileName}\n" + $"{ParadiseLostFileName}\n"; - Assert.That(Grep.Find(pattern, flags, files), Is.EqualTo(expected)); + Assert.Equal(expected, Grep.Find(pattern, flags, files)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Multiple_files_several_matches_case_insensitive_flag() { const string pattern = "TO"; @@ -314,11 +299,10 @@ public void Multiple_files_several_matches_case_insensitive_flag() $"{ParadiseLostFileName}:Restore us, and regain the blissful Seat,\n" + $"{ParadiseLostFileName}:Sing Heav'nly Muse, that on the secret top\n"; - Assert.That(Grep.Find(pattern, flags, files), Is.EqualTo(expected)); + Assert.Equal(expected, Grep.Find(pattern, flags, files)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Multiple_files_several_matches_inverted_flag() { const string pattern = "a"; @@ -330,11 +314,10 @@ public void Multiple_files_several_matches_inverted_flag() $"{IliadFileName}:The noble Chief Achilles from the son\n" + $"{MidsummerNightFileName}:If I refuse to wed Demetrius.\n"; - Assert.That(Grep.Find(pattern, flags, files), Is.EqualTo(expected)); + Assert.Equal(expected, Grep.Find(pattern, flags, files)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Multiple_files_one_match_match_entire_lines_flag() { const string pattern = "But I beseech your grace that I may know"; @@ -344,11 +327,10 @@ public void Multiple_files_one_match_match_entire_lines_flag() var expected = $"{MidsummerNightFileName}:But I beseech your grace that I may know\n"; - Assert.That(Grep.Find(pattern, flags, files), Is.EqualTo(expected)); + Assert.Equal(expected, Grep.Find(pattern, flags, files)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Multiple_files_one_match_multiple_flags() { const string pattern = "WITH LOSS OF EDEN, TILL ONE GREATER MAN"; @@ -357,15 +339,16 @@ public void Multiple_files_one_match_multiple_flags() var expected = $"{ParadiseLostFileName}:4:With loss of Eden, till one greater Man\n"; - Assert.That(Grep.Find(pattern, flags, files), Is.EqualTo(expected)); + Assert.Equal(expected, Grep.Find(pattern, flags, files)); } - [TestCase("", Ignore = "Remove to run test case")] - [TestCase("-n", Ignore = "Remove to run test case")] - [TestCase("-l", Ignore = "Remove to run test case")] - [TestCase("-x", Ignore = "Remove to run test case")] - [TestCase("-i", Ignore = "Remove to run test case")] - [TestCase("-n -l -x -i", Ignore = "Remove to run test case")] + [Theory(Skip = "Remove to run test")] + [InlineData("")] + [InlineData("-n")] + [InlineData("-l")] + [InlineData("-x")] + [InlineData("-i")] + [InlineData("-n -l -x -i")] public void Multiple_files_no_matches_various_flags(string flags) { const string pattern = "Frodo"; @@ -373,6 +356,6 @@ public void Multiple_files_no_matches_various_flags(string flags) const string expected = ""; - Assert.That(Grep.Find(pattern, flags, files), Is.EqualTo(expected)); + Assert.Equal(expected, Grep.Find(pattern, flags, files)); } } \ No newline at end of file diff --git a/exercises/hamming/Example.cs b/exercises/hamming/Example.cs index b5b09d30af..58abd7876e 100644 --- a/exercises/hamming/Example.cs +++ b/exercises/hamming/Example.cs @@ -1,22 +1,9 @@ +using System; using System.Linq; -public class Hamming +public static class Hamming { public static int Compute(string firstStrand, string secondStrand) - { - return new Hamming(firstStrand,secondStrand).Distance(); - } - - private readonly string firstStrand; - private readonly string secondStrand; - - public Hamming(string firstStrand, string secondStrand) - { - this.firstStrand = firstStrand; - this.secondStrand = secondStrand; - } - - public int Distance() { return firstStrand.Where((x, i) => x != secondStrand[i]).Count(); } diff --git a/exercises/hamming/Hamming.cs b/exercises/hamming/Hamming.cs new file mode 100644 index 0000000000..aef290b570 --- /dev/null +++ b/exercises/hamming/Hamming.cs @@ -0,0 +1,9 @@ +using System; + +public static class Hamming +{ + public static int Compute(string firstStrand, string secondStrand) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/hamming/Hamming.csproj b/exercises/hamming/Hamming.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/hamming/Hamming.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/hamming/HammingTest.cs b/exercises/hamming/HammingTest.cs index 30551e5c69..68cce26120 100644 --- a/exercises/hamming/HammingTest.cs +++ b/exercises/hamming/HammingTest.cs @@ -1,46 +1,40 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class HammingTest { - [Test] + [Fact] public void No_difference_between_empty_strands() { - Assert.That(Hamming.Compute("",""), Is.EqualTo(0)); + Assert.Equal(0, Hamming.Compute("","")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void No_difference_between_identical_strands() { - Assert.That(Hamming.Compute("GGACTGA","GGACTGA"), Is.EqualTo(0)); + Assert.Equal(0, Hamming.Compute("GGACTGA","GGACTGA")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Complete_hamming_distance_in_small_strand() { - Assert.That(Hamming.Compute("ACT","GGA"), Is.EqualTo(3)); + Assert.Equal(3, Hamming.Compute("ACT","GGA")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Hamming_distance_is_off_by_one_strand() { - Assert.That(Hamming.Compute("GGACGGATTCTG","AGGACGGATTCT"), Is.EqualTo(9)); + Assert.Equal(9, Hamming.Compute("GGACGGATTCTG","AGGACGGATTCT")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Smalling_hamming_distance_in_middle_somewhere() { - Assert.That(Hamming.Compute("GGACG","GGTCG"), Is.EqualTo(1)); + Assert.Equal(1, Hamming.Compute("GGACG","GGTCG")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Larger_distance() { - Assert.That(Hamming.Compute("ACCAGGG","ACTATGG"), Is.EqualTo(2)); + Assert.Equal(2, Hamming.Compute("ACCAGGG","ACTATGG")); } } \ No newline at end of file diff --git a/exercises/hangman/Example.cs b/exercises/hangman/Example.cs index ca9fc51847..a7c900c733 100644 --- a/exercises/hangman/Example.cs +++ b/exercises/hangman/Example.cs @@ -5,12 +5,19 @@ public class HangmanState { - public HangmanGame.Status Status { get; set; } + public HangmanStatus Status { get; set; } public int RemainingGuesses { get; set; } public string MaskedWord { get; set; } public HashSet Guesses { get; set; } } +public enum HangmanStatus +{ + Busy, + Win, + Lose +} + public class HangmanGame { private const int NumberOfAllowedGuesses = 9; @@ -19,13 +26,6 @@ public class HangmanGame private readonly string word; private readonly HangmanState state; - public enum Status - { - Busy, - Win, - Lose - } - public HangmanGame(string word) { this.word = word; @@ -76,10 +76,10 @@ private void UpdateMaskedWord() private void UpdateStatus() { if (state.MaskedWord == word) - state.Status = Status.Win; + state.Status = HangmanStatus.Win; else if (state.RemainingGuesses < 0) - state.Status = Status.Lose; + state.Status = HangmanStatus.Lose; else - state.Status = Status.Busy; + state.Status = HangmanStatus.Busy; } } \ No newline at end of file diff --git a/exercises/hangman/Hangman.cs b/exercises/hangman/Hangman.cs new file mode 100644 index 0000000000..df5ea98bcb --- /dev/null +++ b/exercises/hangman/Hangman.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; + +public class HangmanState +{ + public HangmanStatus Status { get; set; } + public int RemainingGuesses { get; set; } + public string MaskedWord { get; set; } + public HashSet Guesses { get; set; } +} + +public enum HangmanStatus +{ + Busy, + Win, + Lose +} + +public class HangmanGame +{ + public HangmanGame(string word) + { + } + + public void Start() + { + throw new NotImplementedException("You need to implement this function."); + } + + public void Guess(char c) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/hangman/Hangman.csproj b/exercises/hangman/Hangman.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/hangman/Hangman.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/hangman/HangmanTest.cs b/exercises/hangman/HangmanTest.cs index 1c8693f5a5..684f872e41 100644 --- a/exercises/hangman/HangmanTest.cs +++ b/exercises/hangman/HangmanTest.cs @@ -1,8 +1,8 @@ -using NUnit.Framework; +using Xunit; public class HangmanTest { - [Test] + [Fact] public void Initially_9_failures_are_allowed() { var game = new HangmanGame("foo"); @@ -12,12 +12,11 @@ public void Initially_9_failures_are_allowed() game.Start(); - Assert.That(lastState.Status, Is.EqualTo(HangmanGame.Status.Busy)); - Assert.That(lastState.RemainingGuesses, Is.EqualTo(9)); + Assert.Equal(HangmanStatus.Busy, lastState.Status); + Assert.Equal(9, lastState.RemainingGuesses); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Initially_no_letters_are_guessed() { var game = new HangmanGame("foo"); @@ -27,11 +26,10 @@ public void Initially_no_letters_are_guessed() game.Start(); - Assert.That(lastState.MaskedWord, Is.EqualTo("___")); + Assert.Equal("___", lastState.MaskedWord); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void After_10_failures_the_game_is_over() { var game = new HangmanGame("foo"); @@ -46,11 +44,10 @@ public void After_10_failures_the_game_is_over() game.Guess('x'); } - Assert.That(lastState.Status, Is.EqualTo(HangmanGame.Status.Lose)); + Assert.Equal(HangmanStatus.Lose, lastState.Status); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Feeding_a_correct_letter_removes_underscores() { var game = new HangmanGame("foobar"); @@ -62,19 +59,18 @@ public void Feeding_a_correct_letter_removes_underscores() game.Guess('b'); - Assert.That(lastState.Status, Is.EqualTo(HangmanGame.Status.Busy)); - Assert.That(lastState.RemainingGuesses, Is.EqualTo(9)); - Assert.That(lastState.MaskedWord, Is.EqualTo("___b__")); + Assert.Equal(HangmanStatus.Busy, lastState.Status); + Assert.Equal(9, lastState.RemainingGuesses); + Assert.Equal("___b__", lastState.MaskedWord); game.Guess('o'); - Assert.That(lastState.Status, Is.EqualTo(HangmanGame.Status.Busy)); - Assert.That(lastState.RemainingGuesses, Is.EqualTo(9)); - Assert.That(lastState.MaskedWord, Is.EqualTo("_oob__")); + Assert.Equal(HangmanStatus.Busy, lastState.Status); + Assert.Equal(9, lastState.RemainingGuesses); + Assert.Equal("_oob__", lastState.MaskedWord); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Feeding_a_correct_letter_twice_counts_as_a_failure() { var game = new HangmanGame("foobar"); @@ -86,19 +82,18 @@ public void Feeding_a_correct_letter_twice_counts_as_a_failure() game.Guess('b'); - Assert.That(lastState.Status, Is.EqualTo(HangmanGame.Status.Busy)); - Assert.That(lastState.RemainingGuesses, Is.EqualTo(9)); - Assert.That(lastState.MaskedWord, Is.EqualTo("___b__")); + Assert.Equal(HangmanStatus.Busy, lastState.Status); + Assert.Equal(9, lastState.RemainingGuesses); + Assert.Equal("___b__", lastState.MaskedWord); game.Guess('b'); - Assert.That(lastState.Status, Is.EqualTo(HangmanGame.Status.Busy)); - Assert.That(lastState.RemainingGuesses, Is.EqualTo(8)); - Assert.That(lastState.MaskedWord, Is.EqualTo("___b__")); + Assert.Equal(HangmanStatus.Busy, lastState.Status); + Assert.Equal(8, lastState.RemainingGuesses); + Assert.Equal("___b__", lastState.MaskedWord); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Getting_all_the_letters_right_makes_for_a_win() { var game = new HangmanGame("hello"); @@ -110,31 +105,31 @@ public void Getting_all_the_letters_right_makes_for_a_win() game.Guess('b'); - Assert.That(lastState.Status, Is.EqualTo(HangmanGame.Status.Busy)); - Assert.That(lastState.RemainingGuesses, Is.EqualTo(8)); - Assert.That(lastState.MaskedWord, Is.EqualTo("_____")); + Assert.Equal(HangmanStatus.Busy, lastState.Status); + Assert.Equal(8, lastState.RemainingGuesses); + Assert.Equal("_____", lastState.MaskedWord); game.Guess('e'); - Assert.That(lastState.Status, Is.EqualTo(HangmanGame.Status.Busy)); - Assert.That(lastState.RemainingGuesses, Is.EqualTo(8)); - Assert.That(lastState.MaskedWord, Is.EqualTo("_e___")); + Assert.Equal(HangmanStatus.Busy, lastState.Status); + Assert.Equal(8, lastState.RemainingGuesses); + Assert.Equal("_e___", lastState.MaskedWord); game.Guess('l'); - Assert.That(lastState.Status, Is.EqualTo(HangmanGame.Status.Busy)); - Assert.That(lastState.RemainingGuesses, Is.EqualTo(8)); - Assert.That(lastState.MaskedWord, Is.EqualTo("_ell_")); + Assert.Equal(HangmanStatus.Busy, lastState.Status); + Assert.Equal(8, lastState.RemainingGuesses); + Assert.Equal("_ell_", lastState.MaskedWord); game.Guess('o'); - Assert.That(lastState.Status, Is.EqualTo(HangmanGame.Status.Busy)); - Assert.That(lastState.RemainingGuesses, Is.EqualTo(8)); - Assert.That(lastState.MaskedWord, Is.EqualTo("_ello")); + Assert.Equal(HangmanStatus.Busy, lastState.Status); + Assert.Equal(8, lastState.RemainingGuesses); + Assert.Equal("_ello", lastState.MaskedWord); game.Guess('h'); - Assert.That(lastState.Status, Is.EqualTo(HangmanGame.Status.Win)); - Assert.That(lastState.MaskedWord, Is.EqualTo("hello")); + Assert.Equal(HangmanStatus.Win, lastState.Status); + Assert.Equal("hello", lastState.MaskedWord); } } \ No newline at end of file diff --git a/exercises/hello-world/HelloWorld.cs b/exercises/hello-world/HelloWorld.cs new file mode 100644 index 0000000000..505875aa3c --- /dev/null +++ b/exercises/hello-world/HelloWorld.cs @@ -0,0 +1,9 @@ +using System; + +public static class HelloWorld +{ + public static string Hello() + { + throw new NotImplementedException("You need to implement this function."); + } +} diff --git a/exercises/hello-world/HelloWorld.csproj b/exercises/hello-world/HelloWorld.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/hello-world/HelloWorld.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/hello-world/HelloWorldTest.cs b/exercises/hello-world/HelloWorldTest.cs index 6f731d95e4..8cd72f1d0e 100644 --- a/exercises/hello-world/HelloWorldTest.cs +++ b/exercises/hello-world/HelloWorldTest.cs @@ -1,11 +1,10 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class HelloWorldTest { - [Test] + [Fact] public void Say_hi() { - Assert.That(HelloWorld.Hello(), Is.EqualTo("Hello, World!")); + Assert.Equal("Hello, World!", HelloWorld.Hello()); } } diff --git a/exercises/house/House.cs b/exercises/house/House.cs new file mode 100644 index 0000000000..b1e008a06c --- /dev/null +++ b/exercises/house/House.cs @@ -0,0 +1,9 @@ +using System; + +public static class House +{ + public static string Rhyme() + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/house/House.csproj b/exercises/house/House.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/house/House.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/house/HouseTest.cs b/exercises/house/HouseTest.cs index 4ff6d6f2bd..69a10760ab 100644 --- a/exercises/house/HouseTest.cs +++ b/exercises/house/HouseTest.cs @@ -1,8 +1,8 @@ -using NUnit.Framework; +using Xunit; public class HouseTest { - [Test] + [Fact] public void Rhyme_is_correct() { const string expected = @@ -96,6 +96,6 @@ public void Rhyme_is_correct() "that ate the malt\n" + "that lay in the house that Jack built."; - Assert.That(House.Rhyme(), Is.EqualTo(expected)); + Assert.Equal(expected, House.Rhyme()); } } \ No newline at end of file diff --git a/exercises/isogram/Isogram.cs b/exercises/isogram/Isogram.cs new file mode 100644 index 0000000000..00996d3028 --- /dev/null +++ b/exercises/isogram/Isogram.cs @@ -0,0 +1,9 @@ +using System; + +public static class Isogram +{ + public static bool IsIsogram(string word) + { + throw new NotImplementedException("You need to implement this function."); + } +} diff --git a/exercises/isogram/Isogram.csproj b/exercises/isogram/Isogram.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/isogram/Isogram.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/isogram/IsogramTest.cs b/exercises/isogram/IsogramTest.cs index 9f51ae09f5..bb22e6afd9 100644 --- a/exercises/isogram/IsogramTest.cs +++ b/exercises/isogram/IsogramTest.cs @@ -1,20 +1,20 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class IsogramTest { - [TestCase("duplicates", ExpectedResult = true)] - [TestCase("eleven", ExpectedResult = false, Ignore = "Remove to run test case")] - [TestCase("subdermatoglyphic", ExpectedResult = true, Ignore = "Remove to run test case")] - [TestCase("Alphabet", ExpectedResult = false, Ignore = "Remove to run test case")] - [TestCase("thumbscrew-japingly", ExpectedResult = true, Ignore = "Remove to run test case")] - [TestCase("Hjelmqvist-Gryb-Zock-Pfund-Wax", ExpectedResult = true, Ignore = "Remove to run test case")] - [TestCase("Heizölrückstoßabdämpfung", ExpectedResult = true, Ignore = "Remove to run test case")] - [TestCase("the quick brown fox", ExpectedResult = false, Ignore = "Remove to run test case")] - [TestCase("Emily Jung Schwartzkopf", ExpectedResult = true, Ignore = "Remove to run test case")] - [TestCase("éléphant", ExpectedResult = false, Ignore = "Remove to run test case")] - public bool Isogram_correctly_detects_isograms(string input) + [Theory] + [InlineData("duplicates", true)] + [InlineData("eleven", false)] + [InlineData("subdermatoglyphic", true)] + [InlineData("Alphabet", false)] + [InlineData("thumbscrew-japingly", true)] + [InlineData("Hjelmqvist-Gryb-Zock-Pfund-Wax", true)] + [InlineData("Heizölrückstoßabdämpfung", true)] + [InlineData("the quick brown fox", false)] + [InlineData("Emily Jung Schwartzkopf", true)] + [InlineData("éléphant", false)] + public void Isogram_correctly_detects_isograms(string input, bool expected) { - return Isogram.IsIsogram(input); + Assert.Equal(expected, Isogram.IsIsogram(input)); } } \ No newline at end of file diff --git a/exercises/kindergarten-garden/KinderGartenGardenTest.cs b/exercises/kindergarten-garden/KinderGartenGardenTest.cs index 0c419aa364..6e16480c59 100644 --- a/exercises/kindergarten-garden/KinderGartenGardenTest.cs +++ b/exercises/kindergarten-garden/KinderGartenGardenTest.cs @@ -1,65 +1,60 @@ -using NUnit.Framework; +using Xunit; public class KinderGartenGardenTest { - [Test] + [Fact] public void Missing_child() { var actual = Garden.DefaultGarden("RC\nGG").GetPlants("Potter"); - Assert.That(actual, Is.Empty); + Assert.Empty(actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Alice() { - Assert.That(Garden.DefaultGarden("RC\nGG").GetPlants("Alice"), Is.EqualTo(new [] { Plant.Radishes, Plant.Clover, Plant.Grass, Plant.Grass })); - Assert.That(Garden.DefaultGarden("VC\nRC").GetPlants("Alice"), Is.EqualTo(new[] { Plant.Violets, Plant.Clover, Plant.Radishes, Plant.Clover })); + Assert.Equal(new [] { Plant.Radishes, Plant.Clover, Plant.Grass, Plant.Grass }, Garden.DefaultGarden("RC\nGG").GetPlants("Alice")); + Assert.Equal(new[] { Plant.Violets, Plant.Clover, Plant.Radishes, Plant.Clover }, Garden.DefaultGarden("VC\nRC").GetPlants("Alice")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Small_garden() { var actual = Garden.DefaultGarden("VVCG\nVVRC").GetPlants("Bob"); - Assert.That(actual, Is.EqualTo(new[] { Plant.Clover, Plant.Grass, Plant.Radishes, Plant.Clover })); + Assert.Equal(new[] { Plant.Clover, Plant.Grass, Plant.Radishes, Plant.Clover }, actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Medium_garden() { var garden = Garden.DefaultGarden("VVCCGG\nVVCCGG"); - Assert.That(garden.GetPlants("Bob"), Is.EqualTo(new[] { Plant.Clover, Plant.Clover, Plant.Clover, Plant.Clover })); - Assert.That(garden.GetPlants("Charlie"), Is.EqualTo(new[] { Plant.Grass, Plant.Grass, Plant.Grass, Plant.Grass })); + Assert.Equal(new[] { Plant.Clover, Plant.Clover, Plant.Clover, Plant.Clover }, garden.GetPlants("Bob")); + Assert.Equal(new[] { Plant.Grass, Plant.Grass, Plant.Grass, Plant.Grass }, garden.GetPlants("Charlie")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Full_garden() { var garden = Garden.DefaultGarden("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"); - Assert.That(garden.GetPlants("Alice"), Is.EqualTo(new[] { Plant.Violets, Plant.Radishes, Plant.Violets, Plant.Radishes })); - Assert.That(garden.GetPlants("Bob"), Is.EqualTo(new[] { Plant.Clover, Plant.Grass, Plant.Clover, Plant.Clover })); - Assert.That(garden.GetPlants("David"), Is.EqualTo(new[] { Plant.Radishes, Plant.Violets, Plant.Clover, Plant.Radishes })); - Assert.That(garden.GetPlants("Eve"), Is.EqualTo(new[] { Plant.Clover, Plant.Grass, Plant.Radishes, Plant.Grass })); - Assert.That(garden.GetPlants("Fred"), Is.EqualTo(new[] { Plant.Grass, Plant.Clover, Plant.Violets, Plant.Clover })); - Assert.That(garden.GetPlants("Ginny"), Is.EqualTo(new[] { Plant.Clover, Plant.Grass, Plant.Grass, Plant.Clover })); - Assert.That(garden.GetPlants("Harriet"), Is.EqualTo(new[] { Plant.Violets, Plant.Radishes, Plant.Radishes, Plant.Violets })); - Assert.That(garden.GetPlants("Ileana"), Is.EqualTo(new[] { Plant.Grass, Plant.Clover, Plant.Violets, Plant.Clover })); - Assert.That(garden.GetPlants("Joseph"), Is.EqualTo(new[] { Plant.Violets, Plant.Clover, Plant.Violets, Plant.Grass })); - Assert.That(garden.GetPlants("Kincaid"), Is.EqualTo(new[] { Plant.Grass, Plant.Clover, Plant.Clover, Plant.Grass })); - Assert.That(garden.GetPlants("Larry"), Is.EqualTo(new[] { Plant.Grass, Plant.Violets, Plant.Clover, Plant.Violets })); + Assert.Equal(new[] { Plant.Violets, Plant.Radishes, Plant.Violets, Plant.Radishes }, garden.GetPlants("Alice")); + Assert.Equal(new[] { Plant.Clover, Plant.Grass, Plant.Clover, Plant.Clover }, garden.GetPlants("Bob")); + Assert.Equal(new[] { Plant.Radishes, Plant.Violets, Plant.Clover, Plant.Radishes }, garden.GetPlants("David")); + Assert.Equal(new[] { Plant.Clover, Plant.Grass, Plant.Radishes, Plant.Grass }, garden.GetPlants("Eve")); + Assert.Equal(new[] { Plant.Grass, Plant.Clover, Plant.Violets, Plant.Clover }, garden.GetPlants("Fred")); + Assert.Equal(new[] { Plant.Clover, Plant.Grass, Plant.Grass, Plant.Clover }, garden.GetPlants("Ginny")); + Assert.Equal(new[] { Plant.Violets, Plant.Radishes, Plant.Radishes, Plant.Violets }, garden.GetPlants("Harriet")); + Assert.Equal(new[] { Plant.Grass, Plant.Clover, Plant.Violets, Plant.Clover }, garden.GetPlants("Ileana")); + Assert.Equal(new[] { Plant.Violets, Plant.Clover, Plant.Violets, Plant.Grass }, garden.GetPlants("Joseph")); + Assert.Equal(new[] { Plant.Grass, Plant.Clover, Plant.Clover, Plant.Grass }, garden.GetPlants("Kincaid")); + Assert.Equal(new[] { Plant.Grass, Plant.Violets, Plant.Clover, Plant.Violets }, garden.GetPlants("Larry")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Surprise_garden() { var garden = new Garden(new [] { "Samantha", "Patricia", "Xander", "Roger" }, "VCRRGVRG\nRVGCCGCV"); - Assert.That(garden.GetPlants("Patricia"), Is.EqualTo(new[] { Plant.Violets, Plant.Clover, Plant.Radishes, Plant.Violets })); - Assert.That(garden.GetPlants("Roger"), Is.EqualTo(new[] { Plant.Radishes, Plant.Radishes, Plant.Grass, Plant.Clover })); - Assert.That(garden.GetPlants("Samantha"), Is.EqualTo(new[] { Plant.Grass, Plant.Violets, Plant.Clover, Plant.Grass })); - Assert.That(garden.GetPlants("Xander"), Is.EqualTo(new[] { Plant.Radishes, Plant.Grass, Plant.Clover, Plant.Violets })); + Assert.Equal(new[] { Plant.Violets, Plant.Clover, Plant.Radishes, Plant.Violets }, garden.GetPlants("Patricia")); + Assert.Equal(new[] { Plant.Radishes, Plant.Radishes, Plant.Grass, Plant.Clover }, garden.GetPlants("Roger")); + Assert.Equal(new[] { Plant.Grass, Plant.Violets, Plant.Clover, Plant.Grass }, garden.GetPlants("Samantha")); + Assert.Equal(new[] { Plant.Radishes, Plant.Grass, Plant.Clover, Plant.Violets }, garden.GetPlants("Xander")); } } \ No newline at end of file diff --git a/exercises/kindergarten-garden/KindergartenGarden.cs b/exercises/kindergarten-garden/KindergartenGarden.cs new file mode 100644 index 0000000000..f81a3d0e92 --- /dev/null +++ b/exercises/kindergarten-garden/KindergartenGarden.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; + +public enum Plant +{ + Violets, + Radishes, + Clover, + Grass +} + +public class Garden +{ + public Garden(IEnumerable children, string windowSills) + { + } + + public IEnumerable GetPlants(string child) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static Garden DefaultGarden(string windowSills) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/kindergarten-garden/KindergartenGarden.csproj b/exercises/kindergarten-garden/KindergartenGarden.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/kindergarten-garden/KindergartenGarden.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/largest-series-product/LargestSeriesProduct.cs b/exercises/largest-series-product/LargestSeriesProduct.cs new file mode 100644 index 0000000000..6f28decb0c --- /dev/null +++ b/exercises/largest-series-product/LargestSeriesProduct.cs @@ -0,0 +1,9 @@ +using System; + +public static class LargestSeriesProduct +{ + public static long GetLargestProduct(string digits, int span) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/largest-series-product/LargestSeriesProduct.csproj b/exercises/largest-series-product/LargestSeriesProduct.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/largest-series-product/LargestSeriesProduct.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/largest-series-product/LargestSeriesProductTest.cs b/exercises/largest-series-product/LargestSeriesProductTest.cs index 996532e66b..d891dbd050 100644 --- a/exercises/largest-series-product/LargestSeriesProductTest.cs +++ b/exercises/largest-series-product/LargestSeriesProductTest.cs @@ -1,153 +1,139 @@ using System; -using NUnit.Framework; +using Xunit; -[TestFixture] public class LargestSeriesProductTest { - [Test] + [Fact] public void Can_find_the_largest_product_of_2_with_numbers_in_order() { const string digits = "0123456789"; const int span = 2; const int expected = 72; - Assert.That(LargestSeriesProduct.GetLargestProduct(digits, span), Is.EqualTo(expected)); + Assert.Equal(expected, LargestSeriesProduct.GetLargestProduct(digits, span)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_find_the_largest_product_of_2() { const string digits = "576802143"; const int span = 2; const int expected = 48; - Assert.That(LargestSeriesProduct.GetLargestProduct(digits, span), Is.EqualTo(expected)); + Assert.Equal(expected, LargestSeriesProduct.GetLargestProduct(digits, span)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Finds_the_largest_product_if_span_equals_length() { const string digits = "29"; const int span = 2; const int expected = 18; - Assert.That(LargestSeriesProduct.GetLargestProduct(digits, span), Is.EqualTo(expected)); + Assert.Equal(expected, LargestSeriesProduct.GetLargestProduct(digits, span)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_find_the_largest_product_of_3_with_numbers_in_order() { const string digits = "0123456789"; const int span = 3; const int expected = 504; - Assert.That(LargestSeriesProduct.GetLargestProduct(digits, span), Is.EqualTo(expected)); + Assert.Equal(expected, LargestSeriesProduct.GetLargestProduct(digits, span)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_find_the_largest_product_of_3() { const string digits = "1027839564"; const int span = 3; const int expected = 270; - Assert.That(LargestSeriesProduct.GetLargestProduct(digits, span), Is.EqualTo(expected)); + Assert.Equal(expected, LargestSeriesProduct.GetLargestProduct(digits, span)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_find_the_largest_product_of_5_with_numbers_in_order() { const string digits = "0123456789"; const int span = 5; const int expected = 15120; - Assert.That(LargestSeriesProduct.GetLargestProduct(digits, span), Is.EqualTo(expected)); + Assert.Equal(expected, LargestSeriesProduct.GetLargestProduct(digits, span)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_get_the_largest_product_of_a_big_number() { const string digits = "73167176531330624919225119674426574742355349194934"; const int span = 6; const int expected = 23520; - Assert.That(LargestSeriesProduct.GetLargestProduct(digits, span), Is.EqualTo(expected)); + Assert.Equal(expected, LargestSeriesProduct.GetLargestProduct(digits, span)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_get_the_largest_product_of_a_big_number_II() { const string digits = "52677741234314237566414902593461595376319419139427"; const int span = 6; const int expected = 28350; - Assert.That(LargestSeriesProduct.GetLargestProduct(digits, span), Is.EqualTo(expected)); + Assert.Equal(expected, LargestSeriesProduct.GetLargestProduct(digits, span)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_get_the_largest_product_of_a_big_number_III() { const string digits = "7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450"; const int span = 13; const long expected = 23514624000; - Assert.That(LargestSeriesProduct.GetLargestProduct(digits, span), Is.EqualTo(expected)); + Assert.Equal(expected, LargestSeriesProduct.GetLargestProduct(digits, span)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Reports_zero_if_the_only_digits_are_zero() { const string digits = "0000"; const int span = 2; const int expected = 0; - Assert.That(LargestSeriesProduct.GetLargestProduct(digits, span), Is.EqualTo(expected)); + Assert.Equal(expected, LargestSeriesProduct.GetLargestProduct(digits, span)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Reports_zero_if_all_spans_include_zero() { const string digits = "99099"; const int span = 3; const int expected = 0; - Assert.That(LargestSeriesProduct.GetLargestProduct(digits, span), Is.EqualTo(expected)); + Assert.Equal(expected, LargestSeriesProduct.GetLargestProduct(digits, span)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Reports_1_for_empty_string_and_empty_product_0_span() { const string digits = ""; const int span = 0; const int expected = 1; - Assert.That(LargestSeriesProduct.GetLargestProduct(digits, span), Is.EqualTo(expected)); + Assert.Equal(expected, LargestSeriesProduct.GetLargestProduct(digits, span)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Reports_1_for_nonempty_string_and_empty_product_0_span() { const string digits = "123"; const int span = 0; const int expected = 1; - Assert.That(LargestSeriesProduct.GetLargestProduct(digits, span), Is.EqualTo(expected)); + Assert.Equal(expected, LargestSeriesProduct.GetLargestProduct(digits, span)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Rejects_span_longer_than_string_length() { const string digits = "123"; @@ -156,8 +142,7 @@ public void Rejects_span_longer_than_string_length() Assert.Throws(() => LargestSeriesProduct.GetLargestProduct(digits, span)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Rejects_empty_string_and_nonzero_span() { const string digits = ""; @@ -166,8 +151,7 @@ public void Rejects_empty_string_and_nonzero_span() Assert.Throws(() => LargestSeriesProduct.GetLargestProduct(digits, span)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Rejects_invalid_character_in_digits() { const string digits = "1234a5"; @@ -176,8 +160,7 @@ public void Rejects_invalid_character_in_digits() Assert.Throws(() => LargestSeriesProduct.GetLargestProduct(digits, span)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Rejects_negative_span() { const string digits = "12345"; diff --git a/exercises/leap/Leap.cs b/exercises/leap/Leap.cs new file mode 100644 index 0000000000..b19a6d7fe1 --- /dev/null +++ b/exercises/leap/Leap.cs @@ -0,0 +1,9 @@ +using System; + +public static class Year +{ + public static bool IsLeap(int year) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/leap/Leap.csproj b/exercises/leap/Leap.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/leap/Leap.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/leap/LeapTest.cs b/exercises/leap/LeapTest.cs index 255f4f02e1..937717e055 100644 --- a/exercises/leap/LeapTest.cs +++ b/exercises/leap/LeapTest.cs @@ -1,32 +1,28 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class LeapTest { - [Test] + [Fact] public void Valid_leap_year() { - Assert.That(Year.IsLeap(1996), Is.True); + Assert.True(Year.IsLeap(1996)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Invalid_leap_year() { - Assert.That(Year.IsLeap(1997), Is.False); + Assert.False(Year.IsLeap(1997)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Turn_of_the_20th_century_is_not_a_leap_year() { - Assert.That(Year.IsLeap(1900), Is.False); + Assert.False(Year.IsLeap(1900)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Turn_of_the_25th_century_is_a_leap_year() { - Assert.That(Year.IsLeap(2400), Is.True); + Assert.True(Year.IsLeap(2400)); } } \ No newline at end of file diff --git a/exercises/ledger/Example.cs b/exercises/ledger/Example.cs index 3a1a0a7347..df9a0a2104 100644 --- a/exercises/ledger/Example.cs +++ b/exercises/ledger/Example.cs @@ -29,6 +29,16 @@ public static LedgerEntry CreateEntry(string date, string description, int chang private static float ParseChange(int change) => change / 100.0f; + private static CultureInfo CultureInfo(string locale) + { + switch (locale) + { + case "en-US": return new CultureInfo("en-US"); + case "nl-NL": return new CultureInfo("nl-NL"); + default: throw new ArgumentException("Invalid locale"); + } + } + private static string CurrencySymbol(string currency) { switch (currency) @@ -39,12 +49,12 @@ private static string CurrencySymbol(string currency) } } - private static CultureInfo CultureInfo(string locale) + private static int CurrencyNegativePattern(string locale) { switch (locale) { - case "en-US": return new CultureInfo(locale); - case "nl-NL": return new CultureInfo(locale); + case "en-US": return 0; + case "nl-NL": return 12; default: throw new ArgumentException("Invalid locale"); } } @@ -63,6 +73,7 @@ private static CultureInfo getCulture(string currency, string locale) { var culture = CultureInfo(locale); culture.NumberFormat.CurrencySymbol = CurrencySymbol(currency); + culture.NumberFormat.CurrencyNegativePattern = CurrencyNegativePattern(locale); culture.DateTimeFormat.ShortDatePattern = ShortDateFormat(locale); return culture; } @@ -79,14 +90,14 @@ private static string FormatHeader(CultureInfo culture) private static string FormatDate(IFormatProvider culture, DateTime date) => date.ToString("d", culture); - private static string FoormatDescription(string description) => + private static string FormatDescription(string description) => description.Length <= TruncateLength ? description : description.Substring(0, TruncateLength - TruncateSuffix.Length) + TruncateSuffix; private static string FormatChange(IFormatProvider culture, float change) => change < 0.0 ? change.ToString("C", culture) : change.ToString("C", culture) + " "; private static string FormatEntry(IFormatProvider culture, LedgerEntry entry) => - string.Format("{0} | {1,-25} | {2,13}", FormatDate(culture, entry.Date), FoormatDescription(entry.Description), FormatChange(culture, entry.Change)); + string.Format("{0} | {1,-25} | {2,13}", FormatDate(culture, entry.Date), FormatDescription(entry.Description), FormatChange(culture, entry.Change)); private static IEnumerable OrderEntries(LedgerEntry[] entries) => entries diff --git a/exercises/ledger/Ledger.cs b/exercises/ledger/Ledger.cs index 4f094d3121..c8de490661 100644 --- a/exercises/ledger/Ledger.cs +++ b/exercises/ledger/Ledger.cs @@ -27,6 +27,7 @@ public static LedgerEntry CreateEntry(string date, string desc, int chng) private static CultureInfo CreateCulture(string cur, string loc) { string curSymb = null; + int curNeg = 0; string datPat = null; if (cur != "USD" && cur != "EUR") @@ -50,11 +51,11 @@ private static CultureInfo CreateCulture(string cur, string loc) else if (loc == "nl-NL") { curSymb = "$"; + curNeg = 12; datPat = "dd/MM/yyyy"; } } - if (cur == "EUR") { if (loc == "en-US") @@ -65,6 +66,7 @@ private static CultureInfo CreateCulture(string cur, string loc) else if (loc == "nl-NL") { curSymb = "€"; + curNeg = 12; datPat = "dd/MM/yyyy"; } } @@ -72,6 +74,7 @@ private static CultureInfo CreateCulture(string cur, string loc) var culture = new CultureInfo(loc); culture.NumberFormat.CurrencySymbol = curSymb; + culture.NumberFormat.CurrencyNegativePattern = curNeg; culture.DateTimeFormat.ShortDatePattern = datPat; return culture; } diff --git a/exercises/ledger/Ledger.csproj b/exercises/ledger/Ledger.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/ledger/Ledger.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/ledger/LedgerTest.cs b/exercises/ledger/LedgerTest.cs index bf568201e3..2b6ec6bf3c 100644 --- a/exercises/ledger/LedgerTest.cs +++ b/exercises/ledger/LedgerTest.cs @@ -1,8 +1,8 @@ -using NUnit.Framework; +using Xunit; public class LedgerTest { - [Test] + [Fact] public void Empty_ledger() { var currency = "USD"; @@ -11,10 +11,10 @@ public void Empty_ledger() var expected = "Date | Description | Change "; - Assert.That(Ledger.Format(currency, locale, entries), Is.EqualTo(expected)); + Assert.Equal(expected, Ledger.Format(currency, locale, entries)); } - [Test] + [Fact(Skip = "Remove to run test")] public void One_entry() { var currency = "USD"; @@ -27,10 +27,10 @@ public void One_entry() "Date | Description | Change \n" + "01/01/2015 | Buy present | ($10.00)"; - Assert.That(Ledger.Format(currency, locale, entries), Is.EqualTo(expected)); + Assert.Equal(expected, Ledger.Format(currency, locale, entries)); } - [Test] + [Fact(Skip = "Remove to run test")] public void Credit_and_debit() { var currency = "USD"; @@ -45,10 +45,10 @@ public void Credit_and_debit() "01/01/2015 | Buy present | ($10.00)\n" + "01/02/2015 | Get present | $10.00 "; - Assert.That(Ledger.Format(currency, locale, entries), Is.EqualTo(expected)); + Assert.Equal(expected, Ledger.Format(currency, locale, entries)); } - [Test] + [Fact(Skip = "Remove to run test")] public void Multiple_entries_on_same_date_ordered_by_description() { var currency = "USD"; @@ -63,10 +63,10 @@ public void Multiple_entries_on_same_date_ordered_by_description() "01/01/2015 | Buy present | ($10.00)\n" + "01/01/2015 | Get present | $10.00 "; - Assert.That(Ledger.Format(currency, locale, entries), Is.EqualTo(expected)); + Assert.Equal(expected, Ledger.Format(currency, locale, entries)); } - [Test] + [Fact(Skip = "Remove to run test")] public void Final_order_tie_breaker_is_change() { var currency = "USD"; @@ -83,10 +83,10 @@ public void Final_order_tie_breaker_is_change() "01/01/2015 | Something | $0.00 \n" + "01/01/2015 | Something | $0.01 "; - Assert.That(Ledger.Format(currency, locale, entries), Is.EqualTo(expected)); + Assert.Equal(expected, Ledger.Format(currency, locale, entries)); } - [Test] + [Fact(Skip = "Remove to run test")] public void Overlong_descriptions() { var currency = "USD"; @@ -99,10 +99,10 @@ public void Overlong_descriptions() "Date | Description | Change \n" + "01/01/2015 | Freude schoner Gotterf... | ($1,234.56)"; - Assert.That(Ledger.Format(currency, locale, entries), Is.EqualTo(expected)); + Assert.Equal(expected, Ledger.Format(currency, locale, entries)); } - [Test] + [Fact(Skip = "Remove to run test")] public void Euros() { var currency = "EUR"; @@ -115,10 +115,10 @@ public void Euros() "Date | Description | Change \n" + "01/01/2015 | Buy present | (€10.00)"; - Assert.That(Ledger.Format(currency, locale, entries), Is.EqualTo(expected)); + Assert.Equal(expected, Ledger.Format(currency, locale, entries)); } - [Test] + [Fact(Skip = "Remove to run test")] public void Dutch_locale() { var currency = "USD"; @@ -131,10 +131,10 @@ public void Dutch_locale() "Datum | Omschrijving | Verandering \n" + "12-03-2015 | Buy present | $ 1.234,56 "; - Assert.That(Ledger.Format(currency, locale, entries), Is.EqualTo(expected)); + Assert.Equal(expected, Ledger.Format(currency, locale, entries)); } - [Test] + [Fact(Skip = "Remove to run test")] public void Dutch_negative_number_with_3_digits_before_decimal_point() { var currency = "USD"; @@ -147,10 +147,10 @@ public void Dutch_negative_number_with_3_digits_before_decimal_point() "Datum | Omschrijving | Verandering \n" + "12-03-2015 | Buy present | $ -123,45"; - Assert.That(Ledger.Format(currency, locale, entries), Is.EqualTo(expected)); + Assert.Equal(expected, Ledger.Format(currency, locale, entries)); } - [Test] + [Fact(Skip = "Remove to run test")] public void American_negative_number_with_3_digits_before_decimal_point() { var currency = "USD"; @@ -163,6 +163,6 @@ public void American_negative_number_with_3_digits_before_decimal_point() "Date | Description | Change \n" + "03/12/2015 | Buy present | ($123.45)"; - Assert.That(Ledger.Format(currency, locale, entries), Is.EqualTo(expected)); + Assert.Equal(expected, Ledger.Format(currency, locale, entries)); } } \ No newline at end of file diff --git a/exercises/linked-list/LinkedList.cs b/exercises/linked-list/LinkedList.cs new file mode 100644 index 0000000000..a9038e5bce --- /dev/null +++ b/exercises/linked-list/LinkedList.cs @@ -0,0 +1,24 @@ +using System; + +public class Deque +{ + public void Push(T value) + { + throw new NotImplementedException("You need to implement this function."); + } + + public T Pop() + { + throw new NotImplementedException("You need to implement this function."); + } + + public void Unshift(T value) + { + throw new NotImplementedException("You need to implement this function."); + } + + public T Shift() + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/linked-list/LinkedList.csproj b/exercises/linked-list/LinkedList.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/linked-list/LinkedList.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/linked-list/LinkedListTest.cs b/exercises/linked-list/LinkedListTest.cs index 135a47de27..d6516e45d5 100644 --- a/exercises/linked-list/LinkedListTest.cs +++ b/exercises/linked-list/LinkedListTest.cs @@ -1,94 +1,86 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class DequeTest { - private Deque deque; - - [SetUp] - public void Setup() - { - deque = new Deque(); - } - - [Test] + [Fact] public void Push_and_pop_are_first_in_last_out_order() { + var deque = new Deque(); deque.Push(10); deque.Push(20); - Assert.That(deque.Pop(), Is.EqualTo(20)); - Assert.That(deque.Pop(), Is.EqualTo(10)); + Assert.Equal(20, deque.Pop()); + Assert.Equal(10, deque.Pop()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Push_and_shift_are_first_in_first_out_order() { + var deque = new Deque(); deque.Push(10); deque.Push(20); - Assert.That(deque.Shift(), Is.EqualTo(10)); - Assert.That(deque.Shift(), Is.EqualTo(20)); + Assert.Equal(10, deque.Shift()); + Assert.Equal(20, deque.Shift()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Unshift_and_shift_are_last_in_first_out_order() { + var deque = new Deque(); deque.Unshift(10); deque.Unshift(20); - Assert.That(deque.Shift(), Is.EqualTo(20)); - Assert.That(deque.Shift(), Is.EqualTo(10)); + Assert.Equal(20, deque.Shift()); + Assert.Equal(10, deque.Shift()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Unshift_and_pop_are_last_in_last_out_order() { + var deque = new Deque(); deque.Unshift(10); deque.Unshift(20); - Assert.That(deque.Pop(), Is.EqualTo(10)); - Assert.That(deque.Pop(), Is.EqualTo(20)); + Assert.Equal(10, deque.Pop()); + Assert.Equal(20, deque.Pop()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Push_and_pop_can_handle_multiple_values() { + var deque = new Deque(); deque.Push(10); deque.Push(20); deque.Push(30); - Assert.That(deque.Pop(), Is.EqualTo(30)); - Assert.That(deque.Pop(), Is.EqualTo(20)); - Assert.That(deque.Pop(), Is.EqualTo(10)); + Assert.Equal(30, deque.Pop()); + Assert.Equal(20, deque.Pop()); + Assert.Equal(10, deque.Pop()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Unshift_and_shift_can_handle_multiple_values() { + var deque = new Deque(); deque.Unshift(10); deque.Unshift(20); deque.Unshift(30); - Assert.That(deque.Shift(), Is.EqualTo(30)); - Assert.That(deque.Shift(), Is.EqualTo(20)); - Assert.That(deque.Shift(), Is.EqualTo(10)); + Assert.Equal(30, deque.Shift()); + Assert.Equal(20, deque.Shift()); + Assert.Equal(10, deque.Shift()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void All_methods_of_manipulating_the_deque_can_be_used_together() { + var deque = new Deque(); deque.Push(10); deque.Push(20); - Assert.That(deque.Pop(), Is.EqualTo(20)); + Assert.Equal(20, deque.Pop()); deque.Push(30); - Assert.That(deque.Shift(), Is.EqualTo(10)); + Assert.Equal(10, deque.Shift()); deque.Unshift(40); deque.Push(50); - Assert.That(deque.Shift(), Is.EqualTo(40)); - Assert.That(deque.Pop(), Is.EqualTo(50)); - Assert.That(deque.Shift(), Is.EqualTo(30)); + Assert.Equal(40, deque.Shift()); + Assert.Equal(50, deque.Pop()); + Assert.Equal(30, deque.Shift()); } } \ No newline at end of file diff --git a/exercises/list-ops/ListOps.cs b/exercises/list-ops/ListOps.cs new file mode 100644 index 0000000000..c7b613c306 --- /dev/null +++ b/exercises/list-ops/ListOps.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +public static class ListOps +{ + public static int Length(List input) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static List Reverse(List input) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static List Map(Func map, List input) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static List Filter(Func predicate, List input) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static TOut Foldl(Func func, TOut start, List input) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static TOut Foldr(Func func, TOut start, List input) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static List Concat(List> input) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static List Append(List left, List right) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/list-ops/ListOps.csproj b/exercises/list-ops/ListOps.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/list-ops/ListOps.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/list-ops/ListOpsTest.cs b/exercises/list-ops/ListOpsTest.cs index 68dfbd3d53..68ce0414cb 100644 --- a/exercises/list-ops/ListOpsTest.cs +++ b/exercises/list-ops/ListOpsTest.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using System.Linq; -using NUnit.Framework; +using Xunit; public class ListOpsTest { @@ -19,177 +19,154 @@ private static List Cons(T x, List input) return list; } - [Test] + [Fact] public void LengthOfEmptyList() { - Assert.That(ListOps.Length(EmptyList), Is.EqualTo(0)); + Assert.Equal(0, ListOps.Length(EmptyList)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void LengthOfNonEmptyList() { - Assert.That(ListOps.Length(Range(1, 4)), Is.EqualTo(4)); + Assert.Equal(4, ListOps.Length(Range(1, 4))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void LengthOfLargeList() { - Assert.That(ListOps.Length(Range(1, Big)), Is.EqualTo(Big)); + Assert.Equal(Big, ListOps.Length(Range(1, Big))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void ReverseOfEmptylist() { - Assert.That(ListOps.Reverse(EmptyList), Is.EquivalentTo(EmptyList)); + Assert.Equal(EmptyList, ListOps.Reverse(EmptyList)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void ReverseOfNonEmptyList() { - Assert.That(ListOps.Reverse(Range(1, 100)), Is.EquivalentTo(Range(1, 100).OrderByDescending(x => x).ToList())); + Assert.Equal(Range(1, 100).OrderByDescending(x => x).ToList(), ListOps.Reverse(Range(1, 100))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void MapOfEmptylist() { - Assert.That(ListOps.Map(x => x + 1, EmptyList), Is.EquivalentTo(EmptyList)); + Assert.Equal(EmptyList, ListOps.Map(x => x + 1, EmptyList)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void MapOfNonEmptyList() { - Assert.That(ListOps.Map(x => x + 1, new List {1, 3, 5, 7}), Is.EquivalentTo(new List {2, 4, 6, 8})); + Assert.Equal(new List {2, 4, 6, 8}, ListOps.Map(x => x + 1, new List {1, 3, 5, 7})); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void FilterOfEmptylist() { - Assert.That(ListOps.Filter(x => true, EmptyList), Is.EquivalentTo(EmptyList)); + Assert.Equal(EmptyList, ListOps.Filter(x => true, EmptyList)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void FilterOfNormalList() { - Assert.That(ListOps.Filter(Odd, Range(1, 4)), Is.EquivalentTo(new List {1, 3})); + Assert.Equal(new List {1, 3}, ListOps.Filter(Odd, Range(1, 4))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void FoldlOfEmptylist() { - Assert.That(ListOps.Foldl((acc, x) => acc + x, 0, EmptyList), Is.EqualTo(0)); + Assert.Equal(0, ListOps.Foldl((acc, x) => acc + x, 0, EmptyList)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void FoldlOfNonEmptyList() { - Assert.That(ListOps.Foldl((acc, x) => acc + x, -3, Range(1, 4)), Is.EqualTo(7)); + Assert.Equal(7, ListOps.Foldl((acc, x) => acc + x, -3, Range(1, 4))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void FoldlOfHugeList() { - Assert.That(ListOps.Foldl((acc, x) => acc + x, 0L, Range(1, Big)), Is.EqualTo(Big * (Big + 1L) / 2L)); + Assert.Equal(Big * (Big + 1L) / 2L, ListOps.Foldl((acc, x) => acc + x, 0L, Range(1, Big))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void FoldlWithNonCommutativeFunction() { - Assert.That(ListOps.Foldl((acc, x) => acc - x, 10, Range(1, 4)), Is.EqualTo(0)); + Assert.Equal(0, ListOps.Foldl((acc, x) => acc - x, 10, Range(1, 4))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void FoldlIsNotJustFoldrFlip() { - Assert.That(ListOps.Foldl((acc, x) => Cons(x, acc), EmptyList, "asdf".ToList()), Is.EqualTo("fdsa".ToList())); + Assert.Equal("fdsa", new string(ListOps.Foldl((acc, x) => Cons(x, acc), new List(), "asdf".ToList()).ToArray())); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void FoldrAsId() { - Assert.That(ListOps.Foldr((x, acc) => Cons(x, acc), EmptyList, Range(1, Big)), Is.EquivalentTo(BigList)); + Assert.Equal(BigList, ListOps.Foldr((x, acc) => Cons(x, acc), EmptyList, Range(1, Big))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void FoldrAsAppend() { - Assert.That(ListOps.Foldr((x, acc) => Cons(x, acc), Range(100, Big), Range(1, 99)), Is.EquivalentTo(BigList)); + Assert.Equal(BigList, ListOps.Foldr((x, acc) => Cons(x, acc), Range(100, Big), Range(1, 99))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void AppendOfEmptylists() { - Assert.That(ListOps.Append(EmptyList, EmptyList), Is.EqualTo(EmptyList)); + Assert.Equal(EmptyList, ListOps.Append(EmptyList, EmptyList)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void AppendOfEmptyAndNonEmptyLists() { - Assert.That(ListOps.Append(EmptyList, Range(1, 4)), Is.EqualTo(Range(1, 4))); + Assert.Equal(Range(1, 4), ListOps.Append(EmptyList, Range(1, 4))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void AppendOfNonEmptyAndEmptyLists() { - Assert.That(ListOps.Append(Range(1, 4), EmptyList), Is.EqualTo(Range(1, 4))); + Assert.Equal(Range(1, 4), ListOps.Append(Range(1, 4), EmptyList)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void AppendOfNonEmptylists() { - Assert.That(ListOps.Append(Range(1, 3), new List {4, 5}), Is.EqualTo(Range(1, 5))); + Assert.Equal(Range(1, 5), ListOps.Append(Range(1, 3), new List {4, 5})); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void AppendOfLargeLists() { - Assert.That(ListOps.Append(Range(1, Big / 2), Range(1 + Big / 2, Big)), Is.EquivalentTo(BigList)); + Assert.Equal(BigList, ListOps.Append(Range(1, Big / 2), Range(1 + Big / 2, Big))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void ConcatOfNoLists() { - Assert.That(ListOps.Concat(new List>()), Is.EqualTo(EmptyList)); + Assert.Equal(EmptyList, ListOps.Concat(new List>())); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void ConcatOfListOfLists() { - Assert.That( + Assert.Equal(Range(1, 6), ListOps.Concat(new List> { new List {1, 2}, new List {3}, EmptyList, new List {4, 5, 6} - }), Is.EqualTo(Range(1, 6))); + })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void ConcatOfLargeListOfSmallLists() { - Assert.That(ListOps.Concat(ListOps.Map(x => new List {x}, Range(1, Big))), Is.EquivalentTo(BigList)); + Assert.Equal(BigList, ListOps.Concat(ListOps.Map(x => new List {x}, Range(1, Big)))); } } \ No newline at end of file diff --git a/exercises/luhn/Luhn.cs b/exercises/luhn/Luhn.cs new file mode 100644 index 0000000000..69502bc91f --- /dev/null +++ b/exercises/luhn/Luhn.cs @@ -0,0 +1,9 @@ +using System; + +public static class Luhn +{ + public static bool IsValid(string number) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/luhn/Luhn.csproj b/exercises/luhn/Luhn.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/luhn/Luhn.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/luhn/LuhnTest.cs b/exercises/luhn/LuhnTest.cs index f7b05b9208..a5568bb093 100644 --- a/exercises/luhn/LuhnTest.cs +++ b/exercises/luhn/LuhnTest.cs @@ -1,16 +1,16 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class LuhnTest { - [TestCase("1", ExpectedResult = false)] // single digit strings can not be valid - [TestCase("0", ExpectedResult = false, Ignore = "Remove to run test case")] // a single zero is invalid - [TestCase("046 454 286", ExpectedResult = true, Ignore = "Remove to run test case")] // valid Canadian SIN - [TestCase("046 454 287", ExpectedResult = false, Ignore = "Remove to run test case")] // invalid Canadian SIN - [TestCase("8273 1232 7352 0569", ExpectedResult = false, Ignore = "Remove to run test case")] // invalid credit card - [TestCase("827a 1232 7352 0569", ExpectedResult = false, Ignore = "Remove to run test case")] // strings that contain non-digits are not valid - public bool ValidateChecksum(string number) + [Theory] + [InlineData("1", false)] // single digit strings can not be valid + [InlineData("0", false)] // a single zero is invalid + [InlineData("046 454 286", true)] // valid Canadian SIN + [InlineData("046 454 287", false)] // invalid Canadian SIN + [InlineData("8273 1232 7352 0569", false)] // invalid credit card + [InlineData("827a 1232 7352 0569", false)] // strings that contain non-digits are not valid + public void ValidateChecksum(string number, bool expected) { - return Luhn.IsValid(number); + Assert.Equal(expected, Luhn.IsValid(number)); } } \ No newline at end of file diff --git a/exercises/markdown/Markdown.csproj b/exercises/markdown/Markdown.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/markdown/Markdown.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/markdown/MarkdownTest.cs b/exercises/markdown/MarkdownTest.cs index 9262bdabcf..6ffffb9c46 100644 --- a/exercises/markdown/MarkdownTest.cs +++ b/exercises/markdown/MarkdownTest.cs @@ -1,76 +1,76 @@ -using NUnit.Framework; +using Xunit; public class MarkdownTest { - [Test] + [Fact] public void Parses_normal_text_as_a_paragraph() { var input = "This will be a paragraph"; var expected = "

This will be a paragraph

"; - Assert.That(Markdown.Parse(input), Is.EqualTo(expected)); + Assert.Equal(expected, Markdown.Parse(input)); } - [Test] + [Fact(Skip = "Remove to run test")] public void Parsing_italics() { var input = "_This will be italic_"; var expected = "

This will be italic

"; - Assert.That(Markdown.Parse(input), Is.EqualTo(expected)); + Assert.Equal(expected, Markdown.Parse(input)); } - [Test] + [Fact(Skip = "Remove to run test")] public void Parsing_bold_text() { var input = "__This will be bold__"; var expected = "

This will be bold

"; - Assert.That(Markdown.Parse(input), Is.EqualTo(expected)); + Assert.Equal(expected, Markdown.Parse(input)); } - [Test] + [Fact(Skip = "Remove to run test")] public void Mixed_normal_italics_and_bold_text() { var input = "This will _be_ __mixed__"; var expected = "

This will be mixed

"; - Assert.That(Markdown.Parse(input), Is.EqualTo(expected)); + Assert.Equal(expected, Markdown.Parse(input)); } - [Test] + [Fact(Skip = "Remove to run test")] public void With_h1_header_level() { var input = "# This will be an h1"; var expected = "

This will be an h1

"; - Assert.That(Markdown.Parse(input), Is.EqualTo(expected)); + Assert.Equal(expected, Markdown.Parse(input)); } - [Test] + [Fact(Skip = "Remove to run test")] public void With_h2_header_level() { var input = "## This will be an h2"; var expected = "

This will be an h2

"; - Assert.That(Markdown.Parse(input), Is.EqualTo(expected)); + Assert.Equal(expected, Markdown.Parse(input)); } - [Test] + [Fact(Skip = "Remove to run test")] public void With_h6_header_level() { var input = "###### This will be an h6"; var expected = "
This will be an h6
"; - Assert.That(Markdown.Parse(input), Is.EqualTo(expected)); + Assert.Equal(expected, Markdown.Parse(input)); } - [Test] + [Fact(Skip = "Remove to run test")] public void Unordered_lists() { var input = "* Item 1\n* Item 2"; var expected = "
  • Item 1
  • Item 2
"; - Assert.That(Markdown.Parse(input), Is.EqualTo(expected)); + Assert.Equal(expected, Markdown.Parse(input)); } - [Test] + [Fact(Skip = "Remove to run test")] public void With_a_little_bit_of_everything() { var input = "# Header!\n* __Bold Item__\n* _Italic Item_"; var expected = "

Header!

  • Bold Item
  • Italic Item
"; - Assert.That(Markdown.Parse(input), Is.EqualTo(expected)); + Assert.Equal(expected, Markdown.Parse(input)); } } \ No newline at end of file diff --git a/exercises/matrix/Matrix.cs b/exercises/matrix/Matrix.cs new file mode 100644 index 0000000000..6bd6f4f125 --- /dev/null +++ b/exercises/matrix/Matrix.cs @@ -0,0 +1,34 @@ +using System; + +public class Matrix +{ + public Matrix(string input) + { + } + + public int Rows + { + get + { + throw new NotImplementedException("You need to implement this function."); + } + } + + public int Cols + { + get + { + throw new NotImplementedException("You need to implement this function."); + } + } + + public int[] Row(int row) + { + throw new NotImplementedException("You need to implement this function."); + } + + public int[] Col(int col) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/matrix/Matrix.csproj b/exercises/matrix/Matrix.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/matrix/Matrix.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/matrix/MatrixTest.cs b/exercises/matrix/MatrixTest.cs index 193aa1883e..13d79af770 100644 --- a/exercises/matrix/MatrixTest.cs +++ b/exercises/matrix/MatrixTest.cs @@ -1,63 +1,69 @@ -using NUnit.Framework; +using Xunit; public class MatrixTest { - [TestCase("1", ExpectedResult = new[] { 1 })] - [TestCase("4 7", ExpectedResult = new[] { 4, 7 }, Ignore = "Remove to run test case")] - [TestCase("1 2\n10 20", ExpectedResult = new[] { 1, 2 }, Ignore = "Remove to run test case")] - [TestCase("9 7 6\n8 6 5\n5 3 2", ExpectedResult = new[] { 9, 7, 6 }, Ignore = "Remove to run test case")] - public int[] Extract_first_row(string input) + [Theory] + [InlineData("1", new[] { 1 })] + [InlineData("4 7", new[] { 4, 7 })] + [InlineData("1 2\n10 20", new[] { 1, 2 })] + [InlineData("9 7 6\n8 6 5\n5 3 2", new[] { 9, 7, 6 })] + public void Extract_first_row(string input, int[] expected) { var matrix = new Matrix(input); - return matrix.Row(0); + Assert.Equal(expected, matrix.Row(0)); } - [TestCase("5", ExpectedResult = new[] { 5 }, Ignore = "Remove to run test case")] - [TestCase("9 7", ExpectedResult = new[] { 9, 7 }, Ignore = "Remove to run test case")] - [TestCase("9 8 7\n19 18 17", ExpectedResult = new[] { 19, 18, 17 }, Ignore = "Remove to run test case")] - [TestCase("1 4 9\n16 25 36\n5 6 7", ExpectedResult = new[] { 5, 6, 7 }, Ignore = "Remove to run test case")] - public int[] Extract_last_row(string input) + [Theory(Skip = "Remove to run test")] + [InlineData("5", new[] { 5 })] + [InlineData("9 7", new[] { 9, 7 })] + [InlineData("9 8 7\n19 18 17", new[] { 19, 18, 17 })] + [InlineData("1 4 9\n16 25 36\n5 6 7", new[] { 5, 6, 7 })] + public void Extract_last_row(string input, int[] expected) { var matrix = new Matrix(input); - return matrix.Row(matrix.Rows - 1); + Assert.Equal(expected, matrix.Row(matrix.Rows - 1)); } - [TestCase("55 44", ExpectedResult = new[] { 55 }, Ignore = "Remove to run test case")] - [TestCase("89 1903\n18 3", ExpectedResult = new[] { 89, 18 }, Ignore = "Remove to run test case")] - [TestCase("1 2 3\n4 5 6\n7 8 9\n8 7 6", ExpectedResult = new[] { 1, 4, 7, 8 }, Ignore = "Remove to run test case")] - public int[] Extract_first_column(string input) + [Theory(Skip = "Remove to run test")] + [InlineData("55 44", new[] { 55 })] + [InlineData("89 1903\n18 3", new[] { 89, 18 })] + [InlineData("1 2 3\n4 5 6\n7 8 9\n8 7 6", new[] { 1, 4, 7, 8 })] + public void Extract_first_column(string input, int[] expected) { var matrix = new Matrix(input); - return matrix.Col(0); + Assert.Equal(expected, matrix.Col(0)); } - [TestCase("28", ExpectedResult = new[] { 28 }, Ignore = "Remove to run test case")] - [TestCase("13\n16\n19", ExpectedResult = new[] { 13, 16, 19 }, Ignore = "Remove to run test case")] - [TestCase("289 21903 23\n218 23 21", ExpectedResult = new[] { 23, 21 }, Ignore = "Remove to run test case")] - [TestCase("11 12 13\n14 15 16\n17 18 19\n18 17 16", ExpectedResult = new[] { 13, 16, 19, 16 }, Ignore = "Remove to run test case")] - public int[] Extract_last_column(string input) + [Theory(Skip = "Remove to run test")] + [InlineData("28", new[] { 28 })] + [InlineData("13\n16\n19", new[] { 13, 16, 19 })] + [InlineData("289 21903 23\n218 23 21", new[] { 23, 21 })] + [InlineData("11 12 13\n14 15 16\n17 18 19\n18 17 16", new[] { 13, 16, 19, 16 })] + public void Extract_last_column(string input, int[] expected) { var matrix = new Matrix(input); - return matrix.Col(matrix.Cols - 1); + Assert.Equal(expected, matrix.Col(matrix.Cols - 1)); } - [TestCase("28", ExpectedResult = 1, Ignore = "Remove to run test case")] - [TestCase("13\n16", ExpectedResult = 2, Ignore = "Remove to run test case")] - [TestCase("289 21903\n23 218\n23 21", ExpectedResult = 3, Ignore = "Remove to run test case")] - [TestCase("11 12 13\n14 15 16\n17 18 19\n18 17 16", ExpectedResult = 4, Ignore = "Remove to run test case")] - public int Number_of_rows(string input) + [Theory(Skip = "Remove to run test")] + [InlineData("28", 1)] + [InlineData("13\n16", 2)] + [InlineData("289 21903\n23 218\n23 21", 3)] + [InlineData("11 12 13\n14 15 16\n17 18 19\n18 17 16", 4)] + public void Number_of_rows(string input, int expected) { var matrix = new Matrix(input); - return matrix.Rows; + Assert.Equal(expected, matrix.Rows); } - [TestCase("28", ExpectedResult = 1, Ignore = "Remove to run test case")] - [TestCase("13 2\n16 3\n19 4", ExpectedResult = 2, Ignore = "Remove to run test case")] - [TestCase("289 21903\n23 218\n23 21", ExpectedResult = 2, Ignore = "Remove to run test case")] - [TestCase("11 12 13\n14 15 16\n17 18 19\n18 17 16", ExpectedResult = 3, Ignore = "Remove to run test case")] - public int Number_of_columns(string input) + [Theory(Skip = "Remove to run test")] + [InlineData("28", 1)] + [InlineData("13 2\n16 3\n19 4", 2)] + [InlineData("289 21903\n23 218\n23 21", 2)] + [InlineData("11 12 13\n14 15 16\n17 18 19\n18 17 16", 3)] + public void Number_of_columns(string input, int expected) { var matrix = new Matrix(input); - return matrix.Cols; + Assert.Equal(expected, matrix.Cols); } } \ No newline at end of file diff --git a/exercises/meetup/Meetup.cs b/exercises/meetup/Meetup.cs new file mode 100644 index 0000000000..23043bb48c --- /dev/null +++ b/exercises/meetup/Meetup.cs @@ -0,0 +1,23 @@ +using System; + +public enum Schedule +{ + Teenth, + First, + Second, + Third, + Fourth, + Last +} + +public class Meetup +{ + public Meetup(int month, int year) + { + } + + public DateTime Day(DayOfWeek dayOfWeek, Schedule schedule) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/meetup/Meetup.csproj b/exercises/meetup/Meetup.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/meetup/Meetup.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/meetup/MeetupTest.cs b/exercises/meetup/MeetupTest.cs index 0bbad6055a..5b1ea909f8 100644 --- a/exercises/meetup/MeetupTest.cs +++ b/exercises/meetup/MeetupTest.cs @@ -1,89 +1,89 @@ using System; -using NUnit.Framework; +using Xunit; -[TestFixture] public class MeetupTest { - [TestCase(5, DayOfWeek.Monday, ExpectedResult = "2013-5-13")] - [TestCase(3, DayOfWeek.Tuesday, ExpectedResult = "2013-3-19")] - [TestCase(1, DayOfWeek.Wednesday, ExpectedResult = "2013-1-16")] - [TestCase(5, DayOfWeek.Thursday, ExpectedResult = "2013-5-16")] - [TestCase(4, DayOfWeek.Friday, ExpectedResult = "2013-4-19")] - [TestCase(2, DayOfWeek.Saturday, ExpectedResult = "2013-2-16")] - [TestCase(10, DayOfWeek.Sunday, ExpectedResult = "2013-10-13")] - public string Finds_first_teenth_day_of_week_in_a_month(int month, DayOfWeek dayOfWeek) + [Theory] + [InlineData(5, DayOfWeek.Monday, "2013-5-13")] + [InlineData(3, DayOfWeek.Tuesday, "2013-3-19")] + [InlineData(1, DayOfWeek.Wednesday, "2013-1-16")] + [InlineData(5, DayOfWeek.Thursday, "2013-5-16")] + [InlineData(4, DayOfWeek.Friday, "2013-4-19")] + [InlineData(2, DayOfWeek.Saturday, "2013-2-16")] + [InlineData(10, DayOfWeek.Sunday, "2013-10-13")] + public void Finds_first_teenth_day_of_week_in_a_month(int month, DayOfWeek dayOfWeek, string expected) { DateTime day = new Meetup(month, 2013).Day(dayOfWeek, Schedule.Teenth); - return day.ToString("yyyy-M-d"); + Assert.Equal(expected, day.ToString("yyyy-M-d")); } - [Ignore("Remove to run test")] - [TestCase(3, DayOfWeek.Monday, ExpectedResult = "2013-3-4")] - [TestCase(5, DayOfWeek.Tuesday, ExpectedResult = "2013-5-7")] - [TestCase(7, DayOfWeek.Wednesday, ExpectedResult = "2013-7-3")] - [TestCase(9, DayOfWeek.Thursday, ExpectedResult = "2013-9-5")] - [TestCase(11, DayOfWeek.Friday, ExpectedResult = "2013-11-1")] - [TestCase(1, DayOfWeek.Saturday, ExpectedResult = "2013-1-5")] - [TestCase(4, DayOfWeek.Sunday, ExpectedResult = "2013-4-7")] - public string Finds_first_day_of_week_in_a_month(int month, DayOfWeek dayOfWeek) + [Theory(Skip = "Remove to run test")] + [InlineData(3, DayOfWeek.Monday, "2013-3-4")] + [InlineData(5, DayOfWeek.Tuesday, "2013-5-7")] + [InlineData(7, DayOfWeek.Wednesday, "2013-7-3")] + [InlineData(9, DayOfWeek.Thursday, "2013-9-5")] + [InlineData(11, DayOfWeek.Friday, "2013-11-1")] + [InlineData(1, DayOfWeek.Saturday, "2013-1-5")] + [InlineData(4, DayOfWeek.Sunday, "2013-4-7")] + public void Finds_first_day_of_week_in_a_month(int month, DayOfWeek dayOfWeek, string expected) { DateTime day = new Meetup(month, 2013).Day(dayOfWeek, Schedule.First); - return day.ToString("yyyy-M-d"); + Assert.Equal(expected, day.ToString("yyyy-M-d")); } - [Ignore("Remove to run test")] - [TestCase(3, DayOfWeek.Monday, ExpectedResult = "2013-3-11")] - [TestCase(5, DayOfWeek.Tuesday, ExpectedResult = "2013-5-14")] - [TestCase(7, DayOfWeek.Wednesday, ExpectedResult = "2013-7-10")] - [TestCase(9, DayOfWeek.Thursday, ExpectedResult = "2013-9-12")] - [TestCase(12, DayOfWeek.Friday, ExpectedResult = "2013-12-13")] - [TestCase(2, DayOfWeek.Saturday, ExpectedResult = "2013-2-9")] - [TestCase(4, DayOfWeek.Sunday, ExpectedResult = "2013-4-14")] - public string Finds_second_day_of_week_in_a_month(int month, DayOfWeek dayOfWeek) + [Theory(Skip = "Remove to run test")] + [InlineData(3, DayOfWeek.Monday, "2013-3-11")] + [InlineData(5, DayOfWeek.Tuesday, "2013-5-14")] + [InlineData(7, DayOfWeek.Wednesday, "2013-7-10")] + [InlineData(9, DayOfWeek.Thursday, "2013-9-12")] + [InlineData(12, DayOfWeek.Friday, "2013-12-13")] + [InlineData(2, DayOfWeek.Saturday, "2013-2-9")] + [InlineData(4, DayOfWeek.Sunday, "2013-4-14")] + public void Finds_second_day_of_week_in_a_month(int month, DayOfWeek dayOfWeek, string expected) { DateTime day = new Meetup(month, 2013).Day(dayOfWeek, Schedule.Second); - return day.ToString("yyyy-M-d"); + Assert.Equal(expected, day.ToString("yyyy-M-d")); } - [Ignore("Remove to run test")] - [TestCase(3, DayOfWeek.Monday, ExpectedResult = "2013-3-18")] - [TestCase(5, DayOfWeek.Tuesday, ExpectedResult = "2013-5-21")] - [TestCase(7, DayOfWeek.Wednesday, ExpectedResult = "2013-7-17")] - [TestCase(9, DayOfWeek.Thursday, ExpectedResult = "2013-9-19")] - [TestCase(12, DayOfWeek.Friday, ExpectedResult = "2013-12-20")] - [TestCase(2, DayOfWeek.Saturday, ExpectedResult = "2013-2-16")] - [TestCase(4, DayOfWeek.Sunday, ExpectedResult = "2013-4-21")] - public string Finds_third_day_of_week_in_a_month(int month, DayOfWeek dayOfWeek) + [Theory(Skip = "Remove to run test")] + [InlineData(3, DayOfWeek.Monday, "2013-3-18")] + [InlineData(5, DayOfWeek.Tuesday, "2013-5-21")] + [InlineData(7, DayOfWeek.Wednesday, "2013-7-17")] + [InlineData(9, DayOfWeek.Thursday, "2013-9-19")] + [InlineData(12, DayOfWeek.Friday, "2013-12-20")] + [InlineData(2, DayOfWeek.Saturday, "2013-2-16")] + [InlineData(4, DayOfWeek.Sunday, "2013-4-21")] + public void Finds_third_day_of_week_in_a_month(int month, DayOfWeek dayOfWeek, string expected) { DateTime day = new Meetup(month, 2013).Day(dayOfWeek, Schedule.Third); - return day.ToString("yyyy-M-d"); + Assert.Equal(expected, day.ToString("yyyy-M-d")); } - [Ignore("Remove to run test")] - [TestCase(3, DayOfWeek.Monday, ExpectedResult = "2013-3-25")] - [TestCase(5, DayOfWeek.Tuesday, ExpectedResult = "2013-5-28")] - [TestCase(7, DayOfWeek.Wednesday, ExpectedResult = "2013-7-24")] - [TestCase(9, DayOfWeek.Thursday, ExpectedResult = "2013-9-26")] - [TestCase(12, DayOfWeek.Friday, ExpectedResult = "2013-12-27")] - [TestCase(2, DayOfWeek.Saturday, ExpectedResult = "2013-2-23")] - [TestCase(4, DayOfWeek.Sunday, ExpectedResult = "2013-4-28")] - public string Finds_fourth_day_of_week_in_a_month(int month, DayOfWeek dayOfWeek) + [Theory(Skip = "Remove to run test")] + [InlineData(3, DayOfWeek.Monday, "2013-3-25")] + [InlineData(5, DayOfWeek.Tuesday, "2013-5-28")] + [InlineData(7, DayOfWeek.Wednesday, "2013-7-24")] + [InlineData(9, DayOfWeek.Thursday, "2013-9-26")] + [InlineData(12, DayOfWeek.Friday, "2013-12-27")] + [InlineData(2, DayOfWeek.Saturday, "2013-2-23")] + [InlineData(4, DayOfWeek.Sunday, "2013-4-28")] + public void Finds_fourth_day_of_week_in_a_month(int month, DayOfWeek dayOfWeek, string expected) { DateTime day = new Meetup(month, 2013).Day(dayOfWeek, Schedule.Fourth); - return day.ToString("yyyy-M-d"); + Assert.Equal(expected, day.ToString("yyyy-M-d")); } - [Ignore("Remove to run test")] - [TestCase(3, DayOfWeek.Monday, ExpectedResult = "2013-3-25")] - [TestCase(5, DayOfWeek.Tuesday, ExpectedResult = "2013-5-28")] - [TestCase(7, DayOfWeek.Wednesday, ExpectedResult = "2013-7-31")] - [TestCase(9, DayOfWeek.Thursday, ExpectedResult = "2013-9-26")] - [TestCase(12, DayOfWeek.Friday, ExpectedResult = "2013-12-27")] - [TestCase(2, DayOfWeek.Saturday, ExpectedResult = "2013-2-23")] - [TestCase(3, DayOfWeek.Sunday, ExpectedResult = "2013-3-31")] - public string Finds_last_day_of_week_in_a_month(int month, DayOfWeek dayOfWeek) + [Theory(Skip = "Remove to run test")] + [InlineData(3, DayOfWeek.Monday, "2013-3-25")] + [InlineData(5, DayOfWeek.Tuesday, "2013-5-28")] + [InlineData(7, DayOfWeek.Wednesday, "2013-7-31")] + [InlineData(9, DayOfWeek.Thursday, "2013-9-26")] + [InlineData(12, DayOfWeek.Friday, "2013-12-27")] + [InlineData(2, DayOfWeek.Saturday, "2013-2-23")] + [InlineData(3, DayOfWeek.Sunday, "2013-3-31")] + public void Finds_last_day_of_week_in_a_month(int month, DayOfWeek dayOfWeek, string expected) { DateTime day = new Meetup(month, 2013).Day(dayOfWeek, Schedule.Last); - return day.ToString("yyyy-M-d"); + Assert.Equal(expected, day.ToString("yyyy-M-d")); } } \ No newline at end of file diff --git a/exercises/minesweeper/Minesweeper.cs b/exercises/minesweeper/Minesweeper.cs new file mode 100644 index 0000000000..dfb0212384 --- /dev/null +++ b/exercises/minesweeper/Minesweeper.cs @@ -0,0 +1,9 @@ +using System; + +public static class Minesweeper +{ + public static string Annotate(string input) + { + throw new NotImplementedException("You need to implement this function."); + } +} diff --git a/exercises/minesweeper/Minesweeper.csproj b/exercises/minesweeper/Minesweeper.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/minesweeper/Minesweeper.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/minesweeper/MinesweeperTest.cs b/exercises/minesweeper/MinesweeperTest.cs index bcd95b1312..8d76497689 100644 --- a/exercises/minesweeper/MinesweeperTest.cs +++ b/exercises/minesweeper/MinesweeperTest.cs @@ -1,19 +1,17 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class MinesweeperTest { - [Test] + [Fact] public void Zero_sized_board() { var input = ""; var expected = ""; - Assert.That(Minesweeper.Annotate(input), Is.EqualTo(expected)); + Assert.Equal(expected, Minesweeper.Annotate(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Empty_board() { var input = FormatInput(new[] @@ -30,11 +28,10 @@ public void Empty_board() " " }); - Assert.That(Minesweeper.Annotate(input), Is.EqualTo(expected)); + Assert.Equal(expected, Minesweeper.Annotate(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Board_full_of_mines() { var input = FormatInput(new[] @@ -51,11 +48,10 @@ public void Board_full_of_mines() "***" }); - Assert.That(Minesweeper.Annotate(input), Is.EqualTo(expected)); + Assert.Equal(expected, Minesweeper.Annotate(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Surrounded() { var input = FormatInput(new[] @@ -72,11 +68,10 @@ public void Surrounded() "***" }); - Assert.That(Minesweeper.Annotate(input), Is.EqualTo(expected)); + Assert.Equal(expected, Minesweeper.Annotate(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Horizontal_line() { var input = FormatInput(new[] @@ -89,11 +84,10 @@ public void Horizontal_line() "1*2*1" }); - Assert.That(Minesweeper.Annotate(input), Is.EqualTo(expected)); + Assert.Equal(expected, Minesweeper.Annotate(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Vertical_line() { var input = FormatInput(new[] @@ -114,11 +108,10 @@ public void Vertical_line() "1" }); - Assert.That(Minesweeper.Annotate(input), Is.EqualTo(expected)); + Assert.Equal(expected, Minesweeper.Annotate(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Cross() { var input = FormatInput(new[] @@ -139,7 +132,7 @@ public void Cross() " 2*2 " }); - Assert.That(Minesweeper.Annotate(input), Is.EqualTo(expected)); + Assert.Equal(expected, Minesweeper.Annotate(input)); } private string FormatInput(string[] input) diff --git a/exercises/nth-prime/NthPrime.cs b/exercises/nth-prime/NthPrime.cs new file mode 100644 index 0000000000..66af194b1e --- /dev/null +++ b/exercises/nth-prime/NthPrime.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +public static class NthPrime +{ + public static int Nth(int nth) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/nth-prime/NthPrime.csproj b/exercises/nth-prime/NthPrime.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/nth-prime/NthPrime.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/nth-prime/NthPrimeTest.cs b/exercises/nth-prime/NthPrimeTest.cs index 4e214f1a54..bbb33a6955 100644 --- a/exercises/nth-prime/NthPrimeTest.cs +++ b/exercises/nth-prime/NthPrimeTest.cs @@ -1,20 +1,21 @@ -using NUnit.Framework; +using Xunit; public class NthPrimeTest { - [TestCase(1, ExpectedResult = 2)] - [TestCase(2, ExpectedResult = 3, Ignore = "Remove to run test case")] - [TestCase(3, ExpectedResult = 5, Ignore = "Remove to run test case")] - [TestCase(4, ExpectedResult = 7, Ignore = "Remove to run test case")] - [TestCase(5, ExpectedResult = 11, Ignore = "Remove to run test case")] - [TestCase(6, ExpectedResult = 13, Ignore = "Remove to run test case")] - [TestCase(7, ExpectedResult = 17, Ignore = "Remove to run test case")] - [TestCase(8, ExpectedResult = 19, Ignore = "Remove to run test case")] - [TestCase(1000, ExpectedResult = 7919, Ignore = "Remove to run test case")] - [TestCase(10000, ExpectedResult = 104729, Ignore = "Remove to run test case")] - [TestCase(10001, ExpectedResult = 104743, Ignore = "Remove to run test case")] - public int Nth_prime_calculated(int nth) + [Theory] + [InlineData(1, 2)] + [InlineData(2, 3)] + [InlineData(3, 5)] + [InlineData(4, 7)] + [InlineData(5, 11)] + [InlineData(6, 13)] + [InlineData(7, 17)] + [InlineData(8, 19)] + [InlineData(1000, 7919)] + [InlineData(10000, 104729)] + [InlineData(10001, 104743)] + public void Nth_prime_calculated(int nth, int expected) { - return NthPrime.Nth(nth); + Assert.Equal(expected, NthPrime.Nth(nth)); } } \ No newline at end of file diff --git a/exercises/nucleotide-count/NucleotideCount.cs b/exercises/nucleotide-count/NucleotideCount.cs new file mode 100644 index 0000000000..1c5782f612 --- /dev/null +++ b/exercises/nucleotide-count/NucleotideCount.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; + +public class DNA +{ + public DNA(string sequence) + { + } + + public IDictionary NucleotideCounts + { + get + { + throw new NotImplementedException("You need to implement this function."); + } + } + + public int Count(char nucleotide) + { + throw new NotImplementedException("You need to implement this function."); + } +} + +public class InvalidNucleotideException : Exception { } diff --git a/exercises/nucleotide-count/NucleotideCount.csproj b/exercises/nucleotide-count/NucleotideCount.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/nucleotide-count/NucleotideCount.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/nucleotide-count/NucleotideCountTest.cs b/exercises/nucleotide-count/NucleotideCountTest.cs index b66b6b953a..71ce18f736 100644 --- a/exercises/nucleotide-count/NucleotideCountTest.cs +++ b/exercises/nucleotide-count/NucleotideCountTest.cs @@ -1,73 +1,65 @@ using System.Collections.Generic; -using NUnit.Framework; +using Xunit; -[TestFixture] public class NucleoTideCountTest { - [Test] + [Fact] public void Has_no_nucleotides() { var dna = new DNA(""); var expected = new Dictionary { { 'A', 0 }, { 'T', 0 }, { 'C', 0 }, { 'G', 0 } }; - Assert.That(dna.NucleotideCounts, Is.EqualTo(expected)); + Assert.Equal(expected, dna.NucleotideCounts); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Has_no_adenosine() { var dna = new DNA(""); - Assert.That(dna.Count('A'), Is.EqualTo(0)); + Assert.Equal(0, dna.Count('A')); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Repetitive_cytidine_gets_counts() { var dna = new DNA("CCCCC"); - Assert.That(dna.Count('C'), Is.EqualTo(5)); + Assert.Equal(5, dna.Count('C')); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Repetitive_sequence_has_only_guanosine() { var dna = new DNA("GGGGGGGG"); var expected = new Dictionary { { 'A', 0 }, { 'T', 0 }, { 'C', 0 }, { 'G', 8 } }; - Assert.That(dna.NucleotideCounts, Is.EqualTo(expected)); + Assert.Equal(expected, dna.NucleotideCounts); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Counts_only_thymidine() { var dna = new DNA("GGGGTAACCCGG"); - Assert.That(dna.Count('T'), Is.EqualTo(1)); + Assert.Equal(1, dna.Count('T')); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Counts_a_nucleotide_only_once() { var dna = new DNA("GGTTGG"); dna.Count('T'); - Assert.That(dna.Count('T'), Is.EqualTo(2)); + Assert.Equal(2, dna.Count('T')); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Validates_nucleotides() { var dna = new DNA("GGTTGG"); Assert.Throws(() => dna.Count('X')); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Counts_all_nucleotides() { var dna = new DNA("AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC"); var expected = new Dictionary { { 'A', 20 }, { 'T', 21 }, { 'C', 12 }, { 'G', 17 } }; - Assert.That(dna.NucleotideCounts, Is.EqualTo(expected)); + Assert.Equal(expected, dna.NucleotideCounts); } } diff --git a/exercises/ocr-numbers/OcrNumbers.cs b/exercises/ocr-numbers/OcrNumbers.cs new file mode 100644 index 0000000000..2f69d61b01 --- /dev/null +++ b/exercises/ocr-numbers/OcrNumbers.cs @@ -0,0 +1,9 @@ +using System; + +public static class OcrNumbers +{ + public static string Convert(string input) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/exercises/ocr-numbers/OcrNumbers.csproj b/exercises/ocr-numbers/OcrNumbers.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/ocr-numbers/OcrNumbers.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/ocr-numbers/OcrNumbersTest.cs b/exercises/ocr-numbers/OcrNumbersTest.cs index 4f0bedd4df..723ccf9d7f 100644 --- a/exercises/ocr-numbers/OcrNumbersTest.cs +++ b/exercises/ocr-numbers/OcrNumbersTest.cs @@ -1,168 +1,154 @@ -using NUnit.Framework; +using Xunit; public class OcrNumbersTest { - [Test] + [Fact] public void Recognizes_zero() { var converted = OcrNumbers.Convert(" _ " + "\n" + "| |" + "\n" + "|_|" + "\n" + " "); - Assert.That(converted, Is.EqualTo("0")); + Assert.Equal("0", converted); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Recognizes_one() { var converted = OcrNumbers.Convert(" " + "\n" + " |" + "\n" + " |" + "\n" + " "); - Assert.That(converted, Is.EqualTo("1")); + Assert.Equal("1", converted); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Recognizes_two() { var converted = OcrNumbers.Convert(" _ " + "\n" + " _|" + "\n" + "|_ " + "\n" + " "); - Assert.That(converted, Is.EqualTo("2")); + Assert.Equal("2", converted); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Recognizes_three() { var converted = OcrNumbers.Convert(" _ " + "\n" + " _|" + "\n" + " _|" + "\n" + " "); - Assert.That(converted, Is.EqualTo("3")); + Assert.Equal("3", converted); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Recognizes_four() { var converted = OcrNumbers.Convert(" " + "\n" + "|_|" + "\n" + " |" + "\n" + " "); - Assert.That(converted, Is.EqualTo("4")); + Assert.Equal("4", converted); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Recognizes_five() { var converted = OcrNumbers.Convert(" _ " + "\n" + "|_ " + "\n" + " _|" + "\n" + " "); - Assert.That(converted, Is.EqualTo("5")); + Assert.Equal("5", converted); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Recognizes_six() { var converted = OcrNumbers.Convert(" _ " + "\n" + "|_ " + "\n" + "|_|" + "\n" + " "); - Assert.That(converted, Is.EqualTo("6")); + Assert.Equal("6", converted); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Recognizes_seven() { var converted = OcrNumbers.Convert(" _ " + "\n" + " |" + "\n" + " |" + "\n" + " "); - Assert.That(converted, Is.EqualTo("7")); + Assert.Equal("7", converted); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Recognizes_eight() { var converted = OcrNumbers.Convert(" _ " + "\n" + "|_|" + "\n" + "|_|" + "\n" + " "); - Assert.That(converted, Is.EqualTo("8")); + Assert.Equal("8", converted); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Recognizes_nine() { var converted = OcrNumbers.Convert(" _ " + "\n" + "|_|" + "\n" + " _|" + "\n" + " "); - Assert.That(converted, Is.EqualTo("9")); + Assert.Equal("9", converted); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Recognizes_garble() { var converted = OcrNumbers.Convert(" " + "\n" + "| |" + "\n" + "| |" + "\n" + " "); - Assert.That(converted, Is.EqualTo("?")); + Assert.Equal("?", converted); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Recognizes_ten() { var converted = OcrNumbers.Convert(" _ " + "\n" + " || |" + "\n" + " ||_|" + "\n" + " "); - Assert.That(converted, Is.EqualTo("10")); + Assert.Equal("10", converted); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Recognizes_110101100() { var converted = OcrNumbers.Convert(" _ _ _ _ " + "\n" + " | || | || | | || || |" + "\n" + " | ||_| ||_| | ||_||_|" + "\n" + " "); - Assert.That(converted, Is.EqualTo("110101100")); + Assert.Equal("110101100", converted); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Recognizes_numbers_and_garble() { var converted = OcrNumbers.Convert(" _ _ _ " + "\n" + " | || | || | || || |" + "\n" + " | | _| ||_| | ||_||_|" + "\n" + " "); - Assert.That(converted, Is.EqualTo("11?10?1?0")); + Assert.Equal("11?10?1?0", converted); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Recognizes_1234567890() { var converted = OcrNumbers.Convert(" _ _ _ _ _ _ _ _ " + "\n" + " | _| _||_||_ |_ ||_||_|| |" + "\n" + " ||_ _| | _||_| ||_| _||_|" + "\n" + " "); - Assert.That(converted, Is.EqualTo("1234567890")); + Assert.Equal("1234567890", converted); } } \ No newline at end of file diff --git a/exercises/paket.references b/exercises/paket.references deleted file mode 100644 index 8a39542b97..0000000000 --- a/exercises/paket.references +++ /dev/null @@ -1,2 +0,0 @@ -NUnit -Sprache \ No newline at end of file diff --git a/exercises/palindrome-products/PalindromeProducts.cs b/exercises/palindrome-products/PalindromeProducts.cs new file mode 100644 index 0000000000..2fbb540830 --- /dev/null +++ b/exercises/palindrome-products/PalindromeProducts.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +public class Palindrome +{ + public int Value + { + get + { + throw new NotImplementedException("You need to implement this function."); + } + } + + public ISet> Factors + { + get + { + throw new NotImplementedException("You need to implement this function."); + } + } + + public static Palindrome Largest(int maxFactor) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static Palindrome Largest(int minFactor, int maxFactor) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static Palindrome Smallest(int maxFactor) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static Palindrome Smallest(int minFactor, int maxFactor) + { + throw new NotImplementedException("You need to implement this function."); + } +} diff --git a/exercises/palindrome-products/PalindromeProducts.csproj b/exercises/palindrome-products/PalindromeProducts.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/palindrome-products/PalindromeProducts.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/palindrome-products/PalindromeTest.cs b/exercises/palindrome-products/PalindromeTest.cs index f7668cf3b6..8e14284fba 100644 --- a/exercises/palindrome-products/PalindromeTest.cs +++ b/exercises/palindrome-products/PalindromeTest.cs @@ -1,76 +1,69 @@ using System; -using NUnit.Framework; +using Xunit; public class PalindromeTest { - [Test] + [Fact] public void Largest_palindrome_from_single_digit_factors() { var actual = Palindrome.Largest(9); - Assert.That(actual.Value, Is.EqualTo(9)); - Assert.That(actual.Factors, Is.EqualTo(new [] { Tuple.Create(1, 9), Tuple.Create(3, 3) })); + Assert.Equal(9, actual.Value); + Assert.Equal(new [] { Tuple.Create(1, 9), Tuple.Create(3, 3) }, actual.Factors); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Smallest_palindrome_from_single_digit_factors() { var actual = Palindrome.Smallest(9); - Assert.That(actual.Value, Is.EqualTo(1)); - Assert.That(actual.Factors, Is.EqualTo(new[] { Tuple.Create(1, 1) })); + Assert.Equal(1, actual.Value); + Assert.Equal(new[] { Tuple.Create(1, 1) }, actual.Factors); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Largest_palindrome_from_double_digit_actors() { var actual = Palindrome.Largest(10, 99); - Assert.That(actual.Value, Is.EqualTo(9009)); - Assert.That(actual.Factors, Is.EqualTo(new[] { Tuple.Create(91, 99) })); + Assert.Equal(9009, actual.Value); + Assert.Equal(new[] { Tuple.Create(91, 99) }, actual.Factors); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Smallest_palindrome_from_double_digit_factors() { var actual = Palindrome.Smallest(10, 99); - Assert.That(actual.Value, Is.EqualTo(121)); - Assert.That(actual.Factors, Is.EqualTo(new[] { Tuple.Create(11, 11) })); + Assert.Equal(121, actual.Value); + Assert.Equal(new[] { Tuple.Create(11, 11) }, actual.Factors); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Largest_palindrome_from_triple_digit_factors() { var actual = Palindrome.Largest(100, 999); - Assert.That(actual.Value, Is.EqualTo(906609)); - Assert.That(actual.Factors, Is.EqualTo(new[] { Tuple.Create(913, 993) })); + Assert.Equal(906609, actual.Value); + Assert.Equal(new[] { Tuple.Create(913, 993) }, actual.Factors); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Smallest_palindrome_from_triple_digit_factors() { var actual = Palindrome.Smallest(100, 999); - Assert.That(actual.Value, Is.EqualTo(10201)); - Assert.That(actual.Factors, Is.EqualTo(new[] { Tuple.Create(101, 101) })); + Assert.Equal(10201, actual.Value); + Assert.Equal(new[] { Tuple.Create(101, 101) }, actual.Factors); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Largest_palindrome_from_four_digit_factors() { var actual = Palindrome.Largest(1000, 9999); - Assert.That(actual.Value, Is.EqualTo(99000099)); - Assert.That(actual.Factors, Is.EqualTo(new[] { Tuple.Create(9901, 9999) })); + Assert.Equal(99000099, actual.Value); + Assert.Equal(new[] { Tuple.Create(9901, 9999) }, actual.Factors); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Smallest_palindrome_from_four_digit_factors() { var actual = Palindrome.Smallest(1000, 9999); - Assert.That(actual.Value, Is.EqualTo(1002001)); - Assert.That(actual.Factors, Is.EqualTo(new[] { Tuple.Create(1001, 1001) })); + Assert.Equal(1002001, actual.Value); + Assert.Equal(new[] { Tuple.Create(1001, 1001) }, actual.Factors); } } \ No newline at end of file diff --git a/exercises/pangram/Pangram.cs b/exercises/pangram/Pangram.cs new file mode 100644 index 0000000000..17c84d4156 --- /dev/null +++ b/exercises/pangram/Pangram.cs @@ -0,0 +1,9 @@ +using System; + +public static class Pangram +{ + public static bool IsPangram(string input) + { + throw new NotImplementedException(); + } +} diff --git a/exercises/pangram/Pangram.csproj b/exercises/pangram/Pangram.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/pangram/Pangram.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/pangram/PangramTest.cs b/exercises/pangram/PangramTest.cs index 9397714651..733157b617 100644 --- a/exercises/pangram/PangramTest.cs +++ b/exercises/pangram/PangramTest.cs @@ -1,84 +1,74 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class PangramTest { - [Test] + [Fact] public void Empty_sentence() { var input = ""; - Assert.That(Pangram.IsPangram(input), Is.EqualTo(false)); + Assert.Equal(false, Pangram.IsPangram(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Pangram_with_only_lower_case() { var input = "the quick brown fox jumps over the lazy dog"; - Assert.That(Pangram.IsPangram(input), Is.EqualTo(true)); + Assert.Equal(true, Pangram.IsPangram(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Missing_character_x() { var input = "a quick movement of the enemy will jeopardize five gunboats"; - Assert.That(Pangram.IsPangram(input), Is.EqualTo(false)); + Assert.Equal(false, Pangram.IsPangram(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Another_missing_character_x() { var input = "the quick brown fish jumps over the lazy dog"; - Assert.That(Pangram.IsPangram(input), Is.EqualTo(false)); + Assert.Equal(false, Pangram.IsPangram(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Pangram_with_underscores() { var input = "the_quick_brown_fox_jumps_over_the_lazy_dog"; - Assert.That(Pangram.IsPangram(input), Is.EqualTo(true)); + Assert.Equal(true, Pangram.IsPangram(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Pangram_with_numbers() { var input = "the 1 quick brown fox jumps over the 2 lazy dogs"; - Assert.That(Pangram.IsPangram(input), Is.EqualTo(true)); + Assert.Equal(true, Pangram.IsPangram(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Missing_letters_replaced_by_numbers() { var input = "7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog"; - Assert.That(Pangram.IsPangram(input), Is.EqualTo(false)); + Assert.Equal(false, Pangram.IsPangram(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Pangram_with_mixed_case_and_punctuation() { var input = "\"Five quacking Zephyrs jolt my wax bed.\""; - Assert.That(Pangram.IsPangram(input), Is.EqualTo(true)); + Assert.Equal(true, Pangram.IsPangram(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Pangram_with_non_ascii_characters() { var input = "Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich."; - Assert.That(Pangram.IsPangram(input), Is.EqualTo(true)); + Assert.Equal(true, Pangram.IsPangram(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Pangram_in_alphabet_other_than_ascii() { var input = "Широкая электрификация южных губерний даст мощный толчок подъёму сельского хозяйства."; - Assert.That(Pangram.IsPangram(input), Is.EqualTo(false)); + Assert.Equal(false, Pangram.IsPangram(input)); } } \ No newline at end of file diff --git a/exercises/parallel-letter-frequency/ParallelLetterFrequency.cs b/exercises/parallel-letter-frequency/ParallelLetterFrequency.cs new file mode 100644 index 0000000000..ee6116c290 --- /dev/null +++ b/exercises/parallel-letter-frequency/ParallelLetterFrequency.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; + +public static class ParallelLetterFrequency +{ + public static Dictionary Calculate(IEnumerable texts) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/exercises/parallel-letter-frequency/ParallelLetterFrequency.csproj b/exercises/parallel-letter-frequency/ParallelLetterFrequency.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/parallel-letter-frequency/ParallelLetterFrequency.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/parallel-letter-frequency/ParallelLetterFrequencyTest.cs b/exercises/parallel-letter-frequency/ParallelLetterFrequencyTest.cs index 42237b1740..cc91d05a4d 100644 --- a/exercises/parallel-letter-frequency/ParallelLetterFrequencyTest.cs +++ b/exercises/parallel-letter-frequency/ParallelLetterFrequencyTest.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using System.Linq; -using NUnit.Framework; +using Xunit; public class ParallelLetterParallelLetterFrequency { @@ -37,17 +37,16 @@ public class ParallelLetterParallelLetterFrequency "O say does that star-spangled banner yet wave,\n" + "O'er the land of the free and the home of the brave?\n"; - [Test] + [Fact] public void No_texts_mean_no_letters() { var input = Enumerable.Empty(); var actual = ParallelLetterFrequency.Calculate(input); var expected = new Dictionary(); - Assert.That(actual, Is.EquivalentTo(expected)); + Assert.Equal(expected, actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One_letter() { var input = new[] { "a" }; @@ -56,11 +55,10 @@ public void One_letter() { { 'a', 1 } }; - Assert.That(actual, Is.EquivalentTo(expected)); + Assert.Equal(expected, actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Case_insensitivity() { var input = new[] { "aA" }; @@ -69,21 +67,19 @@ public void Case_insensitivity() { { 'a', 2 } }; - Assert.That(actual, Is.EquivalentTo(expected)); + Assert.Equal(expected, actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Many_empty_texts_still_mean_no_letters() { var input = Enumerable.Repeat(" ", 10000); var actual = ParallelLetterFrequency.Calculate(input); var expected = new Dictionary(); - Assert.That(actual, Is.EquivalentTo(expected)); + Assert.Equal(expected, actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Many_times_the_same_text_gives_a_predictable_result() { var input = Enumerable.Repeat("abc", 1000); @@ -94,11 +90,10 @@ public void Many_times_the_same_text_gives_a_predictable_result() { 'b', 1000 }, { 'c', 1000 } }; - Assert.That(actual, Is.EquivalentTo(expected)); + Assert.Equal(expected, actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Punctuation_doesnt_count() { var input = new[] { OdeAnDieFreude }; @@ -106,8 +101,7 @@ public void Punctuation_doesnt_count() Assert.False(actual.ContainsKey(',')); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Numbers_dont_count() { var input = new[] { "Testing, 1, 2, 3" }; @@ -115,14 +109,13 @@ public void Numbers_dont_count() Assert.False(actual.ContainsKey('1')); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void All_three_anthems_together() { var input = new[] { OdeAnDieFreude, Wilhelmus, StarSpangledBanner }; var actual = ParallelLetterFrequency.Calculate(input); - Assert.That(actual['a'], Is.EqualTo(49)); - Assert.That(actual['t'], Is.EqualTo(56)); - Assert.That(actual['ü'], Is.EqualTo(2)); + Assert.Equal(49, actual['a']); + Assert.Equal(56, actual['t']); + Assert.Equal(2, actual['ü']); } } \ No newline at end of file diff --git a/exercises/pascals-triangle/PascalsTriangle.cs b/exercises/pascals-triangle/PascalsTriangle.cs new file mode 100644 index 0000000000..2539674122 --- /dev/null +++ b/exercises/pascals-triangle/PascalsTriangle.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; + +public static class PascalsTriangle +{ + public static IEnumerable> Calculate(int rows) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/exercises/pascals-triangle/PascalsTriangle.csproj b/exercises/pascals-triangle/PascalsTriangle.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/pascals-triangle/PascalsTriangle.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/pascals-triangle/PascalsTriangleTest.cs b/exercises/pascals-triangle/PascalsTriangleTest.cs index ebc1950188..216e859b92 100644 --- a/exercises/pascals-triangle/PascalsTriangleTest.cs +++ b/exercises/pascals-triangle/PascalsTriangleTest.cs @@ -1,52 +1,80 @@ -using System.Linq; -using NUnit.Framework; +using System; +using System.Collections.Generic; +using System.Linq; +using Xunit; public class PascalsTriangleTest { - [Test] + [Fact] public void One_row() { var actual = PascalsTriangle.Calculate(1); - Assert.That(actual, Is.EqualTo(new[] { new[] { 1 } })); + var expected = new[] { new[] { 1 } }; + Assert.Equal(expected, actual, NestedEnumerableEqualityComparer.Instance); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Two_rows() { - var actual = PascalsTriangle.Calculate(2); - Assert.That(actual, Is.EqualTo(new[] { new[] { 1 }, new[] { 1, 1 } })); + var actual = PascalsTriangle.Calculate(2).ToArray(); + var expected = new[] { new[] { 1 }, new[] { 1, 1 } }; + Assert.Equal(expected, actual, NestedEnumerableEqualityComparer.Instance); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Three_rows() { var actual = PascalsTriangle.Calculate(3); - Assert.That(actual, Is.EqualTo(new[] { new[] { 1 }, new[] { 1, 1 }, new[] { 1, 2, 1 } })); + var expected = new[] { new[] { 1 }, new[] { 1, 1 }, new[] { 1, 2, 1 } }; + Assert.Equal(expected, actual, NestedEnumerableEqualityComparer.Instance); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Four_rows() { var actual = PascalsTriangle.Calculate(4); - Assert.That(actual, Is.EqualTo(new[] { new[] { 1 }, new[] { 1, 1 }, new[] { 1, 2, 1 }, new[] { 1, 3, 3, 1 } })); + var expected = new[] { new[] { 1 }, new[] { 1, 1 }, new[] { 1, 2, 1 }, new[] { 1, 3, 3, 1 } }; + Assert.Equal(expected, actual, NestedEnumerableEqualityComparer.Instance); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Five_rows() { var actual = PascalsTriangle.Calculate(5); - Assert.That(actual, Is.EqualTo(new[] { new[] { 1 }, new[] { 1, 1 }, new[] { 1, 2, 1 }, new[] { 1, 3, 3, 1 }, new [] { 1, 4, 6, 4, 1 } })); + var expected = new[] { new[] { 1 }, new[] { 1, 1 }, new[] { 1, 2, 1 }, new[] { 1, 3, 3, 1 }, new[] { 1, 4, 6, 4, 1 } }; + Assert.Equal(expected, actual, NestedEnumerableEqualityComparer.Instance); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Twenty_rows() { var actual = PascalsTriangle.Calculate(20).Last(); - Assert.That(actual, Is.EqualTo(new[] { 1, 19, 171, 969, 3876, 11628, 27132, 50388, 75582, 92378, 92378, 75582, 50388, 27132, 11628, 3876, 969, 171, 19, 1 })); + var expected = new[] { 1, 19, 171, 969, 3876, 11628, 27132, 50388, 75582, 92378, 92378, 75582, 50388, 27132, 11628, 3876, 969, 171, 19, 1 }; + Assert.Equal(expected, actual); + } + + private class EnumerableEqualityComparer : IEqualityComparer> + { + public static readonly EnumerableEqualityComparer Instance = new EnumerableEqualityComparer(); + + public bool Equals(IEnumerable x, IEnumerable y) => x.SequenceEqual(y); + + public int GetHashCode(IEnumerable obj) + { + throw new NotImplementedException(); + } + } + + private class NestedEnumerableEqualityComparer : IEqualityComparer>> + { + public static readonly NestedEnumerableEqualityComparer Instance = new NestedEnumerableEqualityComparer(); + + public bool Equals(IEnumerable> x, IEnumerable> y) + => x.SequenceEqual(y, EnumerableEqualityComparer.Instance); + + public int GetHashCode(IEnumerable> obj) + { + throw new NotImplementedException(); + } } } \ No newline at end of file diff --git a/exercises/perfect-numbers/PerfectNumbers.cs b/exercises/perfect-numbers/PerfectNumbers.cs new file mode 100644 index 0000000000..479af7d024 --- /dev/null +++ b/exercises/perfect-numbers/PerfectNumbers.cs @@ -0,0 +1,16 @@ +using System; + +public enum NumberType +{ + Perfect, + Abundant, + Deficient +} + +public static class PerfectNumbers +{ + public static NumberType Classify(int number) + { + throw new NotImplementedException(); + } +} diff --git a/exercises/perfect-numbers/PerfectNumbers.csproj b/exercises/perfect-numbers/PerfectNumbers.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/perfect-numbers/PerfectNumbers.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/perfect-numbers/PerfectNumbersTest.cs b/exercises/perfect-numbers/PerfectNumbersTest.cs index 5aaf6a6056..3e458bec23 100644 --- a/exercises/perfect-numbers/PerfectNumbersTest.cs +++ b/exercises/perfect-numbers/PerfectNumbersTest.cs @@ -1,29 +1,31 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class PerfectNumbersTest { - [TestCase(3)] - [TestCase(7, Ignore = "Remove to run test case")] - [TestCase(13, Ignore = "Remove to run test case")] + [Theory] + [InlineData(3)] + [InlineData(7)] + [InlineData(13)] public void Can_classify_deficient_numbers(int number) { - Assert.That(PerfectNumbers.Classify(number), Is.EqualTo(NumberType.Deficient)); + Assert.Equal(NumberType.Deficient, PerfectNumbers.Classify(number)); } - [TestCase(6, Ignore = "Remove to run test case")] - [TestCase(28, Ignore = "Remove to run test case")] - [TestCase(496, Ignore = "Remove to run test case")] + [Theory(Skip = "Remove to run test")] + [InlineData(6)] + [InlineData(28)] + [InlineData(496)] public void Can_classify_perfect_numbers(int number) { - Assert.That(PerfectNumbers.Classify(number), Is.EqualTo(NumberType.Perfect)); + Assert.Equal(NumberType.Perfect, PerfectNumbers.Classify(number)); } - [TestCase(12, Ignore = "Remove to run test case")] - [TestCase(18, Ignore = "Remove to run test case")] - [TestCase(20, Ignore = "Remove to run test case")] + [Theory(Skip = "Remove to run test")] + [InlineData(12)] + [InlineData(18)] + [InlineData(20)] public void Can_classify_abundant_numbers(int number) { - Assert.That(PerfectNumbers.Classify(number), Is.EqualTo(NumberType.Abundant)); + Assert.Equal(NumberType.Abundant, PerfectNumbers.Classify(number)); } } \ No newline at end of file diff --git a/exercises/phone-number/PhoneNumber.cs b/exercises/phone-number/PhoneNumber.cs new file mode 100644 index 0000000000..dc794cb2a3 --- /dev/null +++ b/exercises/phone-number/PhoneNumber.cs @@ -0,0 +1,24 @@ +using System; + +public class PhoneNumber +{ + public PhoneNumber(string phoneNumber) + { + } + + public string Number + { + get + { + throw new NotImplementedException("You need to implement this function."); + } + } + + public string AreaCode + { + get + { + throw new NotImplementedException("You need to implement this function."); + } + } +} \ No newline at end of file diff --git a/exercises/phone-number/PhoneNumber.csproj b/exercises/phone-number/PhoneNumber.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/phone-number/PhoneNumber.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/phone-number/PhoneNumberTest.cs b/exercises/phone-number/PhoneNumberTest.cs index 0434d8f421..258b5fe805 100644 --- a/exercises/phone-number/PhoneNumberTest.cs +++ b/exercises/phone-number/PhoneNumberTest.cs @@ -1,60 +1,53 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class PhoneNumberTest { - [Test] + [Fact] public void Cleans_parens_spaces_and_dashes() { var phone = new PhoneNumber("(123) 456-7890"); - Assert.That(phone.Number, Is.EqualTo("1234567890")); + Assert.Equal("1234567890", phone.Number); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Cleans_numbers_with_dots() { var phone = new PhoneNumber("123.456.7890"); - Assert.That(phone.Number, Is.EqualTo("1234567890")); + Assert.Equal("1234567890", phone.Number); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Allows_us_country_code() { var phone = new PhoneNumber("11234567890"); - Assert.That(phone.Number, Is.EqualTo("1234567890")); + Assert.Equal("1234567890", phone.Number); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Invalid_when_11_digits() { var phone = new PhoneNumber("21234567890"); - Assert.That(phone.Number, Is.EqualTo("0000000000")); + Assert.Equal("0000000000", phone.Number); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Invalid_when_9_digits() { var phone = new PhoneNumber("123456789"); - Assert.That(phone.Number, Is.EqualTo("0000000000")); + Assert.Equal("0000000000", phone.Number); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Has_an_area_code() { var phone = new PhoneNumber("1234567890"); - Assert.That(phone.AreaCode, Is.EqualTo("123")); + Assert.Equal("123", phone.AreaCode); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Formats_a_number() { var phone = new PhoneNumber("1234567890"); - Assert.That(phone.ToString(), Is.EqualTo("(123) 456-7890")); + Assert.Equal("(123) 456-7890", phone.ToString()); } } \ No newline at end of file diff --git a/exercises/pig-latin/PigLatin.cs b/exercises/pig-latin/PigLatin.cs new file mode 100644 index 0000000000..b966721004 --- /dev/null +++ b/exercises/pig-latin/PigLatin.cs @@ -0,0 +1,9 @@ +using System; + +public static class PigLatin +{ + public static string Translate(string word) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/exercises/pig-latin/PigLatin.csproj b/exercises/pig-latin/PigLatin.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/pig-latin/PigLatin.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/pig-latin/PigLatinTest.cs b/exercises/pig-latin/PigLatinTest.cs index 6333818199..1bc13249e8 100644 --- a/exercises/pig-latin/PigLatinTest.cs +++ b/exercises/pig-latin/PigLatinTest.cs @@ -1,88 +1,79 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class PigLatinTest { - [TestCase("apple", ExpectedResult = "appleay")] - [TestCase("ear", ExpectedResult = "earay")] - [TestCase("igloo", ExpectedResult = "iglooay")] - [TestCase("object", ExpectedResult = "objectay")] - [TestCase("under", ExpectedResult = "underay")] - public string Ay_is_added_to_words_that_start_with_vowels(string word) + [Theory] + [InlineData("apple", "appleay")] + [InlineData("ear", "earay")] + [InlineData("igloo", "iglooay")] + [InlineData("object", "objectay")] + [InlineData("under", "underay")] + public void Ay_is_added_to_words_that_start_with_vowels(string word, string expected) { - return PigLatin.Translate(word); + Assert.Equal(expected, PigLatin.Translate(word)); } - [Ignore("Remove to run test")] - [TestCase("pig", ExpectedResult = "igpay")] - [TestCase("koala", ExpectedResult = "oalakay")] - [TestCase("yellow", ExpectedResult = "ellowyay")] - [TestCase("xenon", ExpectedResult = "enonxay")] - public string First_letter_and_ay_are_moved_to_the_end_of_words_that_start_with_consonants(string word) + [Theory(Skip = "Remove to run test")] + [InlineData("pig", "igpay")] + [InlineData("koala", "oalakay")] + [InlineData("yellow", "ellowyay")] + [InlineData("xenon", "enonxay")] + public void First_letter_and_ay_are_moved_to_the_end_of_words_that_start_with_consonants(string word, string expected) { - return PigLatin.Translate(word); + Assert.Equal(expected, PigLatin.Translate(word)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Ch_is_treated_like_a_single_consonant() { - Assert.That(PigLatin.Translate("chair"), Is.EqualTo("airchay")); + Assert.Equal("airchay", PigLatin.Translate("chair")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Qu_is_treated_like_a_single_consonant() { - Assert.That(PigLatin.Translate("queen"), Is.EqualTo("eenquay")); + Assert.Equal("eenquay", PigLatin.Translate("queen")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Qu_and_a_single_preceding_consonant_are_treated_like_a_single_consonant() { - Assert.That(PigLatin.Translate("square"), Is.EqualTo("aresquay")); + Assert.Equal("aresquay", PigLatin.Translate("square")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Th_is_treated_like_a_single_consonant() { - Assert.That(PigLatin.Translate("therapy"), Is.EqualTo("erapythay")); + Assert.Equal("erapythay", PigLatin.Translate("therapy")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Thr_is_treated_like_a_single_consonant() { - Assert.That(PigLatin.Translate("thrush"), Is.EqualTo("ushthray")); + Assert.Equal("ushthray", PigLatin.Translate("thrush")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Sch_is_treated_like_a_single_consonant() { - Assert.That(PigLatin.Translate("school"), Is.EqualTo("oolschay")); + Assert.Equal("oolschay", PigLatin.Translate("school")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Yt_is_treated_like_a_single_vowel() { - Assert.That(PigLatin.Translate("yttria"), Is.EqualTo("yttriaay")); + Assert.Equal("yttriaay", PigLatin.Translate("yttria")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Xr_is_treated_like_a_single_vowel() { - Assert.That(PigLatin.Translate("xray"), Is.EqualTo("xrayay")); + Assert.Equal("xrayay", PigLatin.Translate("xray")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Phrases_are_translated() { - Assert.That(PigLatin.Translate("quick fast run"), Is.EqualTo("ickquay astfay unray")); + Assert.Equal("ickquay astfay unray", PigLatin.Translate("quick fast run")); } } \ No newline at end of file diff --git a/exercises/poker/Poker.cs b/exercises/poker/Poker.cs new file mode 100644 index 0000000000..202ff6a2da --- /dev/null +++ b/exercises/poker/Poker.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; + +public static class Poker +{ + public static IEnumerable BestHands(IEnumerable hands) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/exercises/poker/Poker.csproj b/exercises/poker/Poker.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/poker/Poker.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/poker/PokerTest.cs b/exercises/poker/PokerTest.cs index d39fb622d4..bb1bd2e474 100644 --- a/exercises/poker/PokerTest.cs +++ b/exercises/poker/PokerTest.cs @@ -1,181 +1,160 @@ -using NUnit.Framework; +using Xunit; public class PokerTest { - [Test] + [Fact] public void One_hand() { const string hand = "4S 5S 7H 8D JC"; - Assert.That(Poker.BestHands(new[] { hand }), Is.EqualTo(new[] { hand })); + Assert.Equal(new[] { hand }, Poker.BestHands(new[] { hand })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Nothing_vs_one_pair() { const string nothing = "4S 5H 6S 8D JH"; const string pairOf4 = "2S 4H 6S 4D JH"; - Assert.That(Poker.BestHands(new[] { nothing, pairOf4 }), Is.EqualTo(new[] { pairOf4 })); + Assert.Equal(new[] { pairOf4 }, Poker.BestHands(new[] { nothing, pairOf4 })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Two_pairs() { const string pairOf2 = "4S 2H 6S 2D JH"; const string pairOf4 = "2S 4H 6S 4D JH"; - Assert.That(Poker.BestHands(new[] { pairOf2, pairOf4 }), Is.EqualTo(new[] { pairOf4 })); + Assert.Equal(new[] { pairOf4 }, Poker.BestHands(new[] { pairOf2, pairOf4 })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One_pair_vs_double_pair() { const string pairOf8 = "2S 8H 6S 8D JH"; const string doublePair = "4S 5H 4S 8D 5H"; - Assert.That(Poker.BestHands(new[] { pairOf8, doublePair }), Is.EqualTo(new[] { doublePair })); + Assert.Equal(new[] { doublePair }, Poker.BestHands(new[] { pairOf8, doublePair })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Two_double_pairs() { const string doublePair2And8 = "2S 8H 2S 8D JH"; const string doublePair4And5 = "4S 5H 4S 8D 5H"; - Assert.That(Poker.BestHands(new[] { doublePair2And8, doublePair4And5 }), Is.EqualTo(new[] { doublePair2And8 })); + Assert.Equal(new[] { doublePair2And8 }, Poker.BestHands(new[] { doublePair2And8, doublePair4And5 })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Double_pair_vs_three() { const string doublePair2And8 = "2S 8H 2S 8D JH"; const string threeOf4 = "4S 5H 4S 8D 4H"; - Assert.That(Poker.BestHands(new[] { doublePair2And8, threeOf4 }), Is.EqualTo(new[] { threeOf4 })); + Assert.Equal(new[] { threeOf4 }, Poker.BestHands(new[] { doublePair2And8, threeOf4 })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Two_threes() { const string threeOf2 = "2S 2H 2S 8D JH"; const string threeOf1 = "4S AH AS 8D AH"; - Assert.That(Poker.BestHands(new[] { threeOf2, threeOf1 }), Is.EqualTo(new[] { threeOf1 })); + Assert.Equal(new[] { threeOf1 }, Poker.BestHands(new[] { threeOf2, threeOf1 })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Three_vs_straight() { const string threeOf4 = "4S 5H 4S 8D 4H"; const string straight = "3S 4H 2S 6D 5H"; - Assert.That(Poker.BestHands(new[] { threeOf4, straight }), Is.EqualTo(new[] { straight })); + Assert.Equal(new[] { straight }, Poker.BestHands(new[] { threeOf4, straight })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Two_straights() { const string straightTo8 = "4S 6H 7S 8D 5H"; const string straightTo9 = "5S 7H 8S 9D 6H"; - Assert.That(Poker.BestHands(new[] { straightTo8, straightTo9 }), Is.EqualTo(new[] { straightTo9 })); + Assert.Equal(new[] { straightTo9 }, Poker.BestHands(new[] { straightTo8, straightTo9 })); const string straightTo1 = "AS QH KS TD JH"; const string straightTo5 = "4S AH 3S 2D 5H"; - Assert.That(Poker.BestHands(new[] { straightTo1, straightTo5 }), Is.EqualTo(new[] { straightTo1 })); + Assert.Equal(new[] { straightTo1 }, Poker.BestHands(new[] { straightTo1, straightTo5 })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Straight_vs_flush() { const string straightTo8 = "4S 6H 7S 8D 5H"; const string flushTo7 = "2S 4S 5S 6S 7S"; - Assert.That(Poker.BestHands(new[] { straightTo8, flushTo7 }), Is.EqualTo(new[] { flushTo7 })); + Assert.Equal(new[] { flushTo7 }, Poker.BestHands(new[] { straightTo8, flushTo7 })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Two_flushes() { const string flushTo8 = "3H 6H 7H 8H 5H"; const string flushTo7 = "2S 4S 5S 6S 7S"; - Assert.That(Poker.BestHands(new[] { flushTo8, flushTo7 }), Is.EqualTo(new[] { flushTo8 })); + Assert.Equal(new[] { flushTo8 }, Poker.BestHands(new[] { flushTo8, flushTo7 })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Flush_vs_full() { const string flushTo8 = "3H 6H 7H 8H 5H"; const string full = "4S 5H 4S 5D 4H"; - Assert.That(Poker.BestHands(new[] { full, flushTo8 }), Is.EqualTo(new[] { full })); + Assert.Equal(new[] { full }, Poker.BestHands(new[] { full, flushTo8 })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Two_fulls() { const string fullOf4By9 = "4H 4S 4D 9S 9D"; const string fullOf5By8 = "5H 5S 5D 8S 8D"; - Assert.That(Poker.BestHands(new[] { fullOf4By9, fullOf5By8 }), Is.EqualTo(new[] { fullOf5By8 })); + Assert.Equal(new[] { fullOf5By8 }, Poker.BestHands(new[] { fullOf4By9, fullOf5By8 })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Full_vs_square() { const string full = "4S 5H 4S 5D 4H"; const string squareOf3 = "3S 3H 2S 3D 3H"; - Assert.That(Poker.BestHands(new[] { full, squareOf3 }), Is.EqualTo(new[] { squareOf3 })); + Assert.Equal(new[] { squareOf3 }, Poker.BestHands(new[] { full, squareOf3 })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Two_squares() { const string squareOf2 = "2S 2H 2S 8D 2H"; const string squareOf5 = "4S 5H 5S 5D 5H"; - Assert.That(Poker.BestHands(new[] { squareOf2, squareOf5 }), Is.EqualTo(new[] { squareOf5 })); + Assert.Equal(new[] { squareOf5 }, Poker.BestHands(new[] { squareOf2, squareOf5 })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Square_vs_straight_flush() { const string squareOf5 = "4S 5H 5S 5D 5H"; const string straightFlushTo9 = "5S 7S 8S 9S 6S"; - Assert.That(Poker.BestHands(new[] { squareOf5, straightFlushTo9 }), Is.EqualTo(new[] { straightFlushTo9 })); + Assert.Equal(new[] { straightFlushTo9 }, Poker.BestHands(new[] { squareOf5, straightFlushTo9 })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Two_straight_flushes() { const string straightFlushTo8 = "4H 6H 7H 8H 5H"; const string straightFlushTo9 = "5S 7S 8S 9S 6S"; - Assert.That(Poker.BestHands(new[] { straightFlushTo8, straightFlushTo9 }), - Is.EqualTo(new[] { straightFlushTo9 })); + Assert.Equal(new[] { straightFlushTo9 }, Poker.BestHands(new[] { straightFlushTo8, straightFlushTo9 })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Three_hand_with_tie() { const string spadeStraightTo9 = "9S 8S 7S 6S 5S"; const string diamondStraightTo9 = "9D 8D 7D 6D 5D"; const string threeOf4 = "4D 4S 4H QS KS"; - Assert.That(Poker.BestHands(new[] { spadeStraightTo9, diamondStraightTo9, threeOf4 }), - Is.EqualTo(new[] { spadeStraightTo9, diamondStraightTo9 })); + Assert.Equal(new[] { spadeStraightTo9, diamondStraightTo9 }, Poker.BestHands(new[] { spadeStraightTo9, diamondStraightTo9, threeOf4 })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Straight_to_5_against_a_pair_of_jacks() { const string straightTo5 = "2S 4D 5C 3S AS"; const string twoJacks = "JD 8D 7D JC 5D"; - Assert.That(Poker.BestHands(new[] { straightTo5, twoJacks }), - Is.EqualTo(new[] { straightTo5 })); + Assert.Equal(new[] { straightTo5 }, Poker.BestHands(new[] { straightTo5, twoJacks })); } } diff --git a/exercises/pov/Pov.cs b/exercises/pov/Pov.cs new file mode 100644 index 0000000000..b4bd11da8f --- /dev/null +++ b/exercises/pov/Pov.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; + +public class Graph +{ + public Graph(T value, IEnumerable> children) + { + } + + public T Value + { + get + { + throw new NotImplementedException("You need to implement this function."); + } + } + + public IEnumerable> Children + { + get + { + throw new NotImplementedException("You need to implement this function."); + } + } +} + +public static class Pov +{ + public static Graph CreateGraph(T value, IEnumerable> children) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static Graph FromPOV(T value, Graph graph) where T : IComparable + { + throw new NotImplementedException("You need to implement this function."); + } + + public static IEnumerable TracePathBetween(T value1, T value2, Graph graph) where T : IComparable + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/pov/Pov.csproj b/exercises/pov/Pov.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/pov/Pov.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/pov/PovTest.cs b/exercises/pov/PovTest.cs index e0f9bf9b28..377cd8b807 100644 --- a/exercises/pov/PovTest.cs +++ b/exercises/pov/PovTest.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using Xunit; using System.Linq; public class PovTest @@ -87,74 +87,68 @@ public class PovTest }) }); - [Test] + [Fact] public void Reparent_singleton() { - Assert.That(Pov.FromPOV(x, singleton), Is.EqualTo(singleton_)); + Assert.Equal(singleton_, Pov.FromPOV(x, singleton)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Reparent_flat() { - Assert.That(Pov.FromPOV(x, flat), Is.EqualTo(flat_)); + Assert.Equal(flat_, Pov.FromPOV(x, flat)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Reparent_nested() { - Assert.That(Pov.FromPOV(x, nested), Is.EqualTo(nested_)); + Assert.Equal(nested_, Pov.FromPOV(x, nested)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Reparent_kids() { - Assert.That(Pov.FromPOV(x, kids), Is.EqualTo(kids_)); + Assert.Equal(kids_, Pov.FromPOV(x, kids)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Reparent_cousins() { - Assert.That(Pov.FromPOV(x, cousins), Is.EqualTo(cousins_)); + Assert.Equal(cousins_, Pov.FromPOV(x, cousins)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Reparent_from_POV_of_non_existent_node() { - Assert.That(Pov.FromPOV(x, leaf("foo")), Is.Null); + Assert.Null(Pov.FromPOV(x, leaf("foo"))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Should_not_be_able_to_find_a_missing_node() { var nodes = new[] { singleton, flat, kids, nested, cousins }.Select(graph => Pov.FromPOV("NOT THERE", graph)); - Assert.That(nodes, Is.All.Null); + Assert.All(nodes, node => + { + Assert.Null(node); + }); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Cannot_trace_between_unconnected_nodes() { - Assert.That(Pov.TracePathBetween(x, "NOT THERE", cousins), Is.Null); + Assert.Null(Pov.TracePathBetween(x, "NOT THERE", cousins)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_trace_a_path_from_x_to_cousin() { - Assert.That(Pov.TracePathBetween(x, "cousin-1", cousins), Is.EquivalentTo(new[] { "x", "parent", "grandparent", "uncle", "cousin-1" })); + Assert.Equal(new[] { "x", "parent", "grandparent", "uncle", "cousin-1" }, Pov.TracePathBetween(x, "cousin-1", cousins)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_trace_from_a_leaf_to_a_leaf() { - Assert.That(Pov.TracePathBetween("kid-a", "cousin-0", cousins), Is.EquivalentTo(new[] { "kid-a", "x", "parent", "grandparent", "uncle", "cousin-0" })); + Assert.Equal(new[] { "kid-a", "x", "parent", "grandparent", "uncle", "cousin-0" }, Pov.TracePathBetween("kid-a", "cousin-0", cousins)); } } \ No newline at end of file diff --git a/exercises/prime-factors/PrimeFactors.cs b/exercises/prime-factors/PrimeFactors.cs new file mode 100644 index 0000000000..fbc88e9434 --- /dev/null +++ b/exercises/prime-factors/PrimeFactors.cs @@ -0,0 +1,9 @@ +using System; + +public static class PrimeFactors +{ + public static int[] For(long number) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/exercises/prime-factors/PrimeFactors.csproj b/exercises/prime-factors/PrimeFactors.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/prime-factors/PrimeFactors.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/prime-factors/PrimeFactorsTest.cs b/exercises/prime-factors/PrimeFactorsTest.cs index 720f859d84..3df695b976 100644 --- a/exercises/prime-factors/PrimeFactorsTest.cs +++ b/exercises/prime-factors/PrimeFactorsTest.cs @@ -1,81 +1,70 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class PrimeFactorsTest { - [Test] + [Fact] public void Test_1() { - Assert.That(PrimeFactors.For(1), Is.EqualTo(new int[0])); + Assert.Equal(new int[0], PrimeFactors.For(1)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_2() { - Assert.That(PrimeFactors.For(2), Is.EqualTo(new[] { 2 })); + Assert.Equal(new[] { 2 }, PrimeFactors.For(2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_3() { - Assert.That(PrimeFactors.For(3), Is.EqualTo(new[] { 3 })); + Assert.Equal(new[] { 3 }, PrimeFactors.For(3)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_4() { - Assert.That(PrimeFactors.For(4), Is.EqualTo(new[] { 2, 2 })); + Assert.Equal(new[] { 2, 2 }, PrimeFactors.For(4)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_6() { - Assert.That(PrimeFactors.For(6), Is.EqualTo(new[] { 2, 3 })); + Assert.Equal(new[] { 2, 3 }, PrimeFactors.For(6)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_8() { - Assert.That(PrimeFactors.For(8), Is.EqualTo(new[] { 2, 2, 2 })); + Assert.Equal(new[] { 2, 2, 2 }, PrimeFactors.For(8)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_9() { - Assert.That(PrimeFactors.For(9), Is.EqualTo(new[] { 3, 3 })); + Assert.Equal(new[] { 3, 3 }, PrimeFactors.For(9)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_27() { - Assert.That(PrimeFactors.For(27), Is.EqualTo(new[] { 3, 3, 3 })); + Assert.Equal(new[] { 3, 3, 3 }, PrimeFactors.For(27)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_625() { - Assert.That(PrimeFactors.For(625), Is.EqualTo(new[] { 5, 5, 5, 5 })); + Assert.Equal(new[] { 5, 5, 5, 5 }, PrimeFactors.For(625)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_901255() { - Assert.That(PrimeFactors.For(901255), Is.EqualTo(new[] { 5, 17, 23, 461 })); + Assert.Equal(new[] { 5, 17, 23, 461 }, PrimeFactors.For(901255)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_93819012551() { - Assert.That(PrimeFactors.For(93819012551), Is.EqualTo(new[] { 11, 9539, 894119 })); + Assert.Equal(new[] { 11, 9539, 894119 }, PrimeFactors.For(93819012551)); } } \ No newline at end of file diff --git a/exercises/protein-translation/ProteinTranslation.cs b/exercises/protein-translation/ProteinTranslation.cs new file mode 100644 index 0000000000..44b2d2d4ed --- /dev/null +++ b/exercises/protein-translation/ProteinTranslation.cs @@ -0,0 +1,9 @@ +using System; + +public static class ProteinTranslation +{ + public static string[] Translate(string codon) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/exercises/protein-translation/ProteinTranslation.csproj b/exercises/protein-translation/ProteinTranslation.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/protein-translation/ProteinTranslation.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/protein-translation/ProteinTranslationTest.cs b/exercises/protein-translation/ProteinTranslationTest.cs index 46976f8167..0da3246d30 100644 --- a/exercises/protein-translation/ProteinTranslationTest.cs +++ b/exercises/protein-translation/ProteinTranslationTest.cs @@ -1,83 +1,85 @@ using System; -using NUnit.Framework; +using Xunit; -[TestFixture] public class ProteinTranslationTest { - [TestCase("AUG")] + [Theory] + [InlineData("AUG")] public void Identifies_methionine_codons(string codon) { - Assert.That(ProteinTranslation.Translate(codon), Is.EquivalentTo(new[] { "Methionine" })); + Assert.Equal(new[] { "Methionine" }, ProteinTranslation.Translate(codon)); } - [TestCase("UUU", Ignore = "Remove to run test case")] - [TestCase("UUC", Ignore = "Remove to run test case")] + [Theory(Skip = "Remove to run test")] + [InlineData("UUU")] + [InlineData("UUC")] public void Identifies_phenylalanine_codons(string codon) { - Assert.That(ProteinTranslation.Translate(codon), Is.EquivalentTo(new[] { "Phenylalanine" })); + Assert.Equal(new[] { "Phenylalanine" }, ProteinTranslation.Translate(codon)); } - [TestCase("UUA", Ignore = "Remove to run test case")] - [TestCase("UUG", Ignore = "Remove to run test case")] + [Theory(Skip = "Remove to run test")] + [InlineData("UUA")] + [InlineData("UUG")] public void Identifies_leucine_codons(string codon) { - Assert.That(ProteinTranslation.Translate(codon), Is.EquivalentTo(new[] { "Leucine" })); + Assert.Equal(new[] { "Leucine" }, ProteinTranslation.Translate(codon)); } - [TestCase("UCU", Ignore = "Remove to run test case")] - [TestCase("UCC", Ignore = "Remove to run test case")] - [TestCase("UCA", Ignore = "Remove to run test case")] - [TestCase("UCG", Ignore = "Remove to run test case")] + [Theory(Skip = "Remove to run test")] + [InlineData("UCU")] + [InlineData("UCC")] + [InlineData("UCA")] + [InlineData("UCG")] public void Identifies_serine_codons(string codon) { - Assert.That(ProteinTranslation.Translate(codon), Is.EquivalentTo(new[] { "Serine" })); + Assert.Equal(new[] { "Serine" }, ProteinTranslation.Translate(codon)); } - [TestCase("UAU", Ignore = "Remove to run test case")] - [TestCase("UAC", Ignore = "Remove to run test case")] + [Theory(Skip = "Remove to run test")] + [InlineData("UAU")] + [InlineData("UAC")] public void Identifies_tyrosine_codons(string codon) { - Assert.That(ProteinTranslation.Translate(codon), Is.EquivalentTo(new[] { "Tyrosine" })); + Assert.Equal(new[] { "Tyrosine" }, ProteinTranslation.Translate(codon)); } - [TestCase("UGU", Ignore = "Remove to run test case")] - [TestCase("UGC", Ignore = "Remove to run test case")] + [Theory(Skip = "Remove to run test")] + [InlineData("UGU")] + [InlineData("UGC")] public void Identifies_cysteine_codons(string codon) { - Assert.That(ProteinTranslation.Translate(codon), Is.EquivalentTo(new[] { "Cysteine" })); + Assert.Equal(new[] { "Cysteine" }, ProteinTranslation.Translate(codon)); } - [TestCase("UGG", Ignore = "Remove to run test case")] + [Theory(Skip = "Remove to run test")] + [InlineData("UGG")] public void Identifies_tryptophan_codons(string codon) { - Assert.That(ProteinTranslation.Translate(codon), Is.EquivalentTo(new[] { "Tryptophan" })); + Assert.Equal(new[] { "Tryptophan" }, ProteinTranslation.Translate(codon)); } - [Test] - [Ignore("Remove to run test")] + [Fact(Skip = "Remove to run test")] public void Translates_rna_strand_into_correct_protein() { - Assert.That(ProteinTranslation.Translate("AUGUUUUGG"), Is.EquivalentTo(new[] { "Methionine", "Phenylalanine", "Tryptophan" })); + Assert.Equal(new[] { "Methionine", "Phenylalanine", "Tryptophan" }, ProteinTranslation.Translate("AUGUUUUGG")); } - [Test] - [Ignore("Remove to run test")] + [Fact(Skip = "Remove to run test")] public void Stops_translation_if_stop_codon_present() { - Assert.That(ProteinTranslation.Translate("AUGUUUUAA"), Is.EquivalentTo(new[] { "Methionine", "Phenylalanine" })); + Assert.Equal(new[] { "Methionine", "Phenylalanine" }, ProteinTranslation.Translate("AUGUUUUAA")); } - [Test] - [Ignore("Remove to run test")] + [Fact(Skip = "Remove to run test")] public void Stops_translation_of_longer_strand() { - Assert.That(ProteinTranslation.Translate("UGGUGUUAUUAAUGGUUU"), Is.EquivalentTo(new[] { "Tryptophan", "Cysteine", "Tyrosine" })); + Assert.Equal(new[] { "Tryptophan", "Cysteine", "Tyrosine" }, ProteinTranslation.Translate("UGGUGUUAUUAAUGGUUU")); } - [Test] - [Ignore("Remove to run test")] + [Fact(Skip = "Remove to run test")] public void Throws_for_invalid_codons() { - Assert.That(() => ProteinTranslation.Translate("CARROT"), Throws.Exception); + Assert.Throws(() => ProteinTranslation.Translate("CARROT")); } } diff --git a/exercises/proverb/Proverb.cs b/exercises/proverb/Proverb.cs new file mode 100644 index 0000000000..dd087355a5 --- /dev/null +++ b/exercises/proverb/Proverb.cs @@ -0,0 +1,14 @@ +using System; + +public static class Proverb +{ + public static string Line(int line) + { + throw new NotImplementedException(); + } + + public static string AllLines() + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/exercises/proverb/Proverb.csproj b/exercises/proverb/Proverb.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/proverb/Proverb.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/proverb/ProverbTest.cs b/exercises/proverb/ProverbTest.cs index 0a06ea901e..327dac4004 100644 --- a/exercises/proverb/ProverbTest.cs +++ b/exercises/proverb/ProverbTest.cs @@ -1,29 +1,26 @@ -using NUnit.Framework; +using Xunit; public class ProverbTest { - [Test] + [Fact] public void Line_one() { - Assert.That(Proverb.Line(1), Is.EqualTo("For want of a nail the shoe was lost.")); + Assert.Equal("For want of a nail the shoe was lost.", Proverb.Line(1)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Line_four() { - Assert.That(Proverb.Line(4), Is.EqualTo("For want of a rider the message was lost.")); + Assert.Equal("For want of a rider the message was lost.", Proverb.Line(4)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Line_seven() { - Assert.That(Proverb.Line(7), Is.EqualTo("And all for the want of a horseshoe nail.")); + Assert.Equal("And all for the want of a horseshoe nail.", Proverb.Line(7)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void All_lines() { const string expected = "For want of a nail the shoe was lost.\n" + @@ -34,6 +31,6 @@ public void All_lines() "For want of a battle the kingdom was lost.\n" + "And all for the want of a horseshoe nail."; - Assert.That(Proverb.AllLines(), Is.EqualTo(expected)); + Assert.Equal(expected, Proverb.AllLines()); } } diff --git a/exercises/pythagorean-triplet/PythagoreanTriplet.cs b/exercises/pythagorean-triplet/PythagoreanTriplet.cs new file mode 100644 index 0000000000..d4ce502207 --- /dev/null +++ b/exercises/pythagorean-triplet/PythagoreanTriplet.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; + +public class Triplet +{ + public Triplet(int a, int b, int c) + { + } + + public int Sum() + { + throw new NotImplementedException("You need to implement this function."); + } + + public int Product() + { + throw new NotImplementedException("You need to implement this function."); + } + + public bool IsPythagorean() + { + throw new NotImplementedException("You need to implement this function."); + } + + public static IEnumerable Where(int maxFactor, int minFactor = 1, int sum = 0) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/pythagorean-triplet/PythagoreanTriplet.csproj b/exercises/pythagorean-triplet/PythagoreanTriplet.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/pythagorean-triplet/PythagoreanTriplet.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/pythagorean-triplet/PythagoreanTripletTest.cs b/exercises/pythagorean-triplet/PythagoreanTripletTest.cs index 8b3b363655..b82b57bd37 100644 --- a/exercises/pythagorean-triplet/PythagoreanTripletTest.cs +++ b/exercises/pythagorean-triplet/PythagoreanTripletTest.cs @@ -1,54 +1,49 @@ using System.Linq; -using NUnit.Framework; +using Xunit; -[TestFixture] public class PythagoreanTripletTest { - [Test] + [Fact] public void Calculates_the_sum() { - Assert.That(new Triplet(3, 4, 5).Sum(), Is.EqualTo(12)); + Assert.Equal(12, new Triplet(3, 4, 5).Sum()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Calculates_the_product() { - Assert.That(new Triplet(3, 4, 5).Product(), Is.EqualTo(60)); + Assert.Equal(60, new Triplet(3, 4, 5).Product()); } - [Ignore("Remove to run test")] - [TestCase(3, 4, 5, ExpectedResult = true)] - [TestCase(5, 6, 7, ExpectedResult = false)] - public bool Can_recognize_a_valid_pythagorean(int a, int b, int c) + [Theory(Skip = "Remove to run test")] + [InlineData(3, 4, 5, true)] + [InlineData(5, 6, 7, false)] + public void Can_recognize_a_valid_pythagorean(int a, int b, int c, bool expected) { - return new Triplet(a, b, c).IsPythagorean(); + Assert.Equal(expected, new Triplet(a, b, c).IsPythagorean()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_make_triplets_up_to_10() { var triplets = Triplet.Where(maxFactor: 10); var products = triplets.Select(x => x.Product()).OrderBy(x => x); - Assert.That(products, Is.EqualTo(new[] { 60, 480 })); + Assert.Equal(new[] { 60, 480 }, products); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_make_triplets_from_11_to_20() { var triplets = Triplet.Where(minFactor: 11, maxFactor: 20); var products = triplets.Select(x => x.Product()); - Assert.That(products, Is.EqualTo(new[] { 3840 })); + Assert.Equal(new[] { 3840 }, products); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_make_triplets_filtered_on_sum() { var triplets = Triplet.Where(sum: 180, maxFactor: 100); var products = triplets.Select(x => x.Product()).OrderBy(x => x); - Assert.That(products, Is.EqualTo(new[] { 118080, 168480, 202500 })); + Assert.Equal(new[] { 118080, 168480, 202500 }, products); } } \ No newline at end of file diff --git a/exercises/queen-attack/Example.cs b/exercises/queen-attack/Example.cs index 0c1d49edfb..9fa78f3fc9 100644 --- a/exercises/queen-attack/Example.cs +++ b/exercises/queen-attack/Example.cs @@ -12,26 +12,17 @@ public Queen(int row, int column) public int Column { get; } } -public class Queens +public static class Queens { - private readonly Queen _white; - private readonly Queen _black; - - public Queens(Queen white, Queen black) + public static bool CanAttack(Queen white, Queen black) { if (white.Row == black.Row && white.Column == black.Column) { throw new ArgumentException("The queens cannot be positioned at the same place."); } - _black = black; - _white = white; - } - - public bool CanAttack() - { - return _black.Row == _white.Row || - _black.Column == _white.Column || - Math.Abs(_black.Row - _white.Row) == Math.Abs(_black.Column - _white.Column); + return black.Row == white.Row || + black.Column == white.Column || + Math.Abs(black.Row - white.Row) == Math.Abs(black.Column - white.Column); } } \ No newline at end of file diff --git a/exercises/queen-attack/QueenAttack.cs b/exercises/queen-attack/QueenAttack.cs new file mode 100644 index 0000000000..f652b36e94 --- /dev/null +++ b/exercises/queen-attack/QueenAttack.cs @@ -0,0 +1,21 @@ +using System; + +public class Queen +{ + public Queen(int row, int column) + { + Row = row; + Column = column; + } + + public int Row { get; } + public int Column { get; } +} + +public static class Queens +{ + public static bool CanAttack(Queen white, Queen black) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/queen-attack/QueenAttack.csproj b/exercises/queen-attack/QueenAttack.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/queen-attack/QueenAttack.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/queen-attack/QueenAttackTest.cs b/exercises/queen-attack/QueenAttackTest.cs index c59655f2a9..fcac0e7015 100644 --- a/exercises/queen-attack/QueenAttackTest.cs +++ b/exercises/queen-attack/QueenAttackTest.cs @@ -1,69 +1,55 @@ using System; -using NUnit.Framework; +using Xunit; public class QueenAttackTest { - [Test] + [Fact] public void Cannot_occupy_same_space() { var white = new Queen(2, 4); var black = new Queen(2, 4); - Assert.Throws(() => new Queens(white, black)); + Assert.Throws(() => Queens.CanAttack(white, black)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Cannot_attack() { - var queens = new Queens(new Queen(2, 3), new Queen(4, 7)); - Assert.False(queens.CanAttack()); + Assert.False(Queens.CanAttack(new Queen(2, 3), new Queen(4, 7))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_attack_on_same_row() { - var queens = new Queens(new Queen(2, 4), new Queen(2, 7)); - Assert.True(queens.CanAttack()); + Assert.True(Queens.CanAttack(new Queen(2, 4), new Queen(2, 7))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_attack_on_same_column() { - var queens = new Queens(new Queen(5, 4), new Queen(2, 4)); - Assert.True(queens.CanAttack()); + Assert.True(Queens.CanAttack(new Queen(5, 4), new Queen(2, 4))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_attack_on_diagonal() { - var queens = new Queens(new Queen(1, 1), new Queen(6, 6)); - Assert.True(queens.CanAttack()); + Assert.True(Queens.CanAttack(new Queen(1, 1), new Queen(6, 6))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_attack_on_other_diagonal() { - var queens = new Queens(new Queen(0, 6), new Queen(1, 7)); - Assert.True(queens.CanAttack()); + Assert.True(Queens.CanAttack(new Queen(0, 6), new Queen(1, 7))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_attack_on_yet_another_diagonal() { - var queens = new Queens(new Queen(4, 1), new Queen(6, 3)); - Assert.True(queens.CanAttack()); + Assert.True(Queens.CanAttack(new Queen(4, 1), new Queen(6, 3))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_attack_on_a_diagonal_slanted_the_other_way() { - var queens = new Queens(new Queen(6, 1), new Queen(1, 6)); - Assert.True(queens.CanAttack()); + Assert.True(Queens.CanAttack(new Queen(6, 1), new Queen(1, 6))); } } \ No newline at end of file diff --git a/exercises/rail-fence-cipher/RailFenceCipher.cs b/exercises/rail-fence-cipher/RailFenceCipher.cs new file mode 100644 index 0000000000..da3b8930f4 --- /dev/null +++ b/exercises/rail-fence-cipher/RailFenceCipher.cs @@ -0,0 +1,18 @@ +using System; + +public class RailFenceCipher +{ + public RailFenceCipher(int rails) + { + } + + public string Encode(string input) + { + throw new NotImplementedException("You need to implement this function."); + } + + public string Decode(string input) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/rail-fence-cipher/RailFenceCipher.csproj b/exercises/rail-fence-cipher/RailFenceCipher.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/rail-fence-cipher/RailFenceCipher.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/rail-fence-cipher/RailFenceCipherTest.cs b/exercises/rail-fence-cipher/RailFenceCipherTest.cs index f9de838c4d..f37d4852b3 100644 --- a/exercises/rail-fence-cipher/RailFenceCipherTest.cs +++ b/exercises/rail-fence-cipher/RailFenceCipherTest.cs @@ -1,63 +1,58 @@ -using NUnit.Framework; +using Xunit; public class RailFenceCipherTest { - [Test] + [Fact] public void Encode_with_two_rails() { var railFenceCipher = new RailFenceCipher(2); var actual = railFenceCipher.Encode("XOXOXOXOXOXOXOXOXO"); var expected = "XXXXXXXXXOOOOOOOOO"; - Assert.That(actual, Is.EqualTo(expected)); + Assert.Equal(expected, actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Encode_with_three_rails() { var railFenceCipher = new RailFenceCipher(3); var actual = railFenceCipher.Encode("WEAREDISCOVEREDFLEEATONCE"); var expected = "WECRLTEERDSOEEFEAOCAIVDEN"; - Assert.That(actual, Is.EqualTo(expected)); + Assert.Equal(expected, actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Encode_with_ending_in_the_middle() { var railFenceCipher = new RailFenceCipher(4); var actual = railFenceCipher.Encode("EXERCISES"); var expected = "ESXIEECSR"; - Assert.That(actual, Is.EqualTo(expected)); + Assert.Equal(expected, actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Decode_with_three_rails() { var railFenceCipher = new RailFenceCipher(3); var actual = railFenceCipher.Decode("TEITELHDVLSNHDTISEIIEA"); var expected = "THEDEVILISINTHEDETAILS"; - Assert.That(actual, Is.EqualTo(expected)); + Assert.Equal(expected, actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Decode_with_five_rails() { var railFenceCipher = new RailFenceCipher(5); var actual = railFenceCipher.Decode("EIEXMSMESAORIWSCE"); var expected = "EXERCISMISAWESOME"; - Assert.That(actual, Is.EqualTo(expected)); + Assert.Equal(expected, actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Decode_with_six_rails() { var railFenceCipher = new RailFenceCipher(6); var actual = railFenceCipher.Decode("133714114238148966225439541018335470986172518171757571896261"); var expected = "112358132134558914423337761098715972584418167651094617711286"; - Assert.That(actual, Is.EqualTo(expected)); + Assert.Equal(expected, actual); } } \ No newline at end of file diff --git a/exercises/raindrops/Raindrops.cs b/exercises/raindrops/Raindrops.cs new file mode 100644 index 0000000000..f8f5c0e82f --- /dev/null +++ b/exercises/raindrops/Raindrops.cs @@ -0,0 +1,9 @@ +using System; + +public static class Raindrops +{ + public static string Convert(int number) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/raindrops/Raindrops.csproj b/exercises/raindrops/Raindrops.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/raindrops/Raindrops.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/raindrops/RaindropsTest.cs b/exercises/raindrops/RaindropsTest.cs index 0a3f14c334..af3491015c 100644 --- a/exercises/raindrops/RaindropsTest.cs +++ b/exercises/raindrops/RaindropsTest.cs @@ -1,50 +1,50 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class RaindropsTest { - [TestCase(1, ExpectedResult = "1")] - [TestCase(52, ExpectedResult = "52")] - [TestCase(12121, ExpectedResult = "12121")] - public string Non_primes_pass_through(int number) + [Theory] + [InlineData(1, "1")] + [InlineData(52, "52")] + [InlineData(12121, "12121")] + public void Non_primes_pass_through(int number, string expected) { - return Raindrops.Convert(number); + Assert.Equal(expected, Raindrops.Convert(number)); } - [Ignore("Remove to run test")] - [TestCase(3)] - [TestCase(6)] - [TestCase(9)] + [Theory(Skip = "Remove to run test")] + [InlineData(3)] + [InlineData(6)] + [InlineData(9)] public void Numbers_containing_3_as_a_prime_factor_give_pling(int number) { - Assert.That(Raindrops.Convert(number), Is.EqualTo("Pling")); + Assert.Equal("Pling", Raindrops.Convert(number)); } - [Ignore("Remove to run test")] - [TestCase(5)] - [TestCase(10)] - [TestCase(25)] + [Theory(Skip = "Remove to run test")] + [InlineData(5)] + [InlineData(10)] + [InlineData(25)] public void Numbers_containing_5_as_a_prime_factor_give_plang(int number) { - Assert.That(Raindrops.Convert(number), Is.EqualTo("Plang")); + Assert.Equal("Plang", Raindrops.Convert(number)); } - [Ignore("Remove to run test")] - [TestCase(7)] - [TestCase(14)] - [TestCase(49)] + [Theory(Skip = "Remove to run test")] + [InlineData(7)] + [InlineData(14)] + [InlineData(49)] public void Numbers_containing_7_as_a_prime_factor_give_plong(int number) { - Assert.That(Raindrops.Convert(number), Is.EqualTo("Plong")); + Assert.Equal("Plong", Raindrops.Convert(number)); } - [Ignore("Remove to run test")] - [TestCase(15, ExpectedResult = "PlingPlang")] - [TestCase(21, ExpectedResult = "PlingPlong")] - [TestCase(35, ExpectedResult = "PlangPlong")] - [TestCase(105, ExpectedResult = "PlingPlangPlong")] - public string Numbers_containing_multiple_prime_factors_give_all_results_concatenated(int number) + [Theory(Skip = "Remove to run test")] + [InlineData(15, "PlingPlang")] + [InlineData(21, "PlingPlong")] + [InlineData(35, "PlangPlong")] + [InlineData(105, "PlingPlangPlong")] + public void Numbers_containing_multiple_prime_factors_give_all_results_concatenated(int number, string expected) { - return Raindrops.Convert(number); + Assert.Equal(expected, Raindrops.Convert(number)); } } \ No newline at end of file diff --git a/exercises/react/React.cs b/exercises/react/React.cs new file mode 100644 index 0000000000..408273cb9c --- /dev/null +++ b/exercises/react/React.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; + +public class Reactor +{ + public InputCell CreateInputCell(int value) + { + throw new NotImplementedException("You need to implement this function."); + } + + public ComputeCell CreateComputeCell(IEnumerable producers, Func compute) + { + throw new NotImplementedException("You need to implement this function."); + } +} + +public abstract class Cell +{ +} + +public class InputCell : Cell +{ +} + +public class ComputeCell : Cell +{ + +} \ No newline at end of file diff --git a/exercises/react/React.csproj b/exercises/react/React.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/react/React.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/react/ReactTest.cs b/exercises/react/ReactTest.cs index 0501543862..b3feaedef3 100644 --- a/exercises/react/ReactTest.cs +++ b/exercises/react/ReactTest.cs @@ -1,34 +1,32 @@ -using NUnit.Framework; +using Xunit; using System.Collections.Generic; public class ReactTest { - [Test] + [Fact] public void Setting_the_value_of_an_input_cell_changes_the_observable_value() { var reactor = new Reactor(); var inputCell1 = reactor.CreateInputCell(1); - Assert.That(inputCell1.Value, Is.EqualTo(1)); + Assert.Equal(1, inputCell1.Value); inputCell1.Value = 2; - Assert.That(inputCell1.Value, Is.EqualTo(2)); + Assert.Equal(2, inputCell1.Value); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void The_value_of_a_compute_is_determined_by_the_value_of_the_dependencies() { var reactor = new Reactor(); var inputCell1 = reactor.CreateInputCell(1); var computeCell1 = reactor.CreateComputeCell(new[] { inputCell1 }, (values) => values[0] + 1); - Assert.That(computeCell1.Value, Is.EqualTo(2)); + Assert.Equal(2, computeCell1.Value); inputCell1.Value = 2; - Assert.That(computeCell1.Value, Is.EqualTo(3)); + Assert.Equal(3, computeCell1.Value); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Compute_cells_can_depend_on_other_compute_cells() { var reactor = new Reactor(); @@ -37,13 +35,12 @@ public void Compute_cells_can_depend_on_other_compute_cells() var computeCell2 = reactor.CreateComputeCell(new[] { inputCell1 }, (values) => values[0] - 1); var computeCell3 = reactor.CreateComputeCell(new[] { computeCell1, computeCell2 }, (values) => values[0] * values[1]); - Assert.That(computeCell3.Value, Is.EqualTo(0)); + Assert.Equal(0, computeCell3.Value); inputCell1.Value = 3; - Assert.That(computeCell3.Value, Is.EqualTo(8)); + Assert.Equal(8, computeCell3.Value); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Compute_cells_can_have_callbacks() { var reactor = new Reactor(); @@ -52,13 +49,12 @@ public void Compute_cells_can_have_callbacks() var observed = new List(); computeCell1.Changed += (sender, value) => observed.Add(value); - Assert.That(observed, Is.Empty); + Assert.Empty(observed); inputCell1.Value = 2; - Assert.That(observed, Is.EquivalentTo(new[] { 3 })); + Assert.Equal(new[] { 3 }, observed); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Callbacks_only_trigger_on_change() { var reactor = new Reactor(); @@ -68,15 +64,14 @@ public void Callbacks_only_trigger_on_change() computecell1.Changed += (sender, value) => observerCalled++; inputCell1.Value = 1; - Assert.That(observerCalled, Is.EqualTo(0)); + Assert.Equal(0, observerCalled); inputCell1.Value = 2; - Assert.That(observerCalled, Is.EqualTo(0)); + Assert.Equal(0, observerCalled); inputCell1.Value = 3; - Assert.That(observerCalled, Is.EqualTo(1)); + Assert.Equal(1, observerCalled); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Callbacks_can_be_removed() { var reactor = new Reactor(); @@ -92,17 +87,16 @@ public void Callbacks_can_be_removed() computeCell1.Changed += changedHandler2; inputCell1.Value = 2; - Assert.That(observed1, Is.EquivalentTo(new[] { 3 })); - Assert.That(observed2, Is.EquivalentTo(new[] { 3 })); + Assert.Equal(new[] { 3 }, observed1); + Assert.Equal(new[] { 3 }, observed2); computeCell1.Changed -= changedHandler1; inputCell1.Value = 3; - Assert.That(observed1, Is.EquivalentTo(new[] { 3 })); - Assert.That(observed2, Is.EquivalentTo(new[] { 3, 4 })); + Assert.Equal(new[] { 3 }, observed1); + Assert.Equal(new[] { 3, 4 }, observed2); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Callbacks_should_only_be_called_once_even_if_multiple_dependencies_have_changed() { var reactor = new Reactor(); @@ -116,6 +110,6 @@ public void Callbacks_should_only_be_called_once_even_if_multiple_dependencies_h computeCell4.Changed += (sender, value) => changed4++; inputCell1.Value = 3; - Assert.That(changed4, Is.EqualTo(1)); + Assert.Equal(1, changed4); } } diff --git a/exercises/rectangles/Example.cs b/exercises/rectangles/Example.cs index a3cd285d61..e1c4523c36 100644 --- a/exercises/rectangles/Example.cs +++ b/exercises/rectangles/Example.cs @@ -1,5 +1,4 @@ using System; -using System.Drawing; using System.Linq; public static class Rectangles @@ -35,43 +34,43 @@ private static CellType ParseCell(char cell) private static int Cols(CellType[][] grid) => grid[0].Length; - private static CellType Cell(Point point, CellType[][] grid) => grid[point.Y][point.X]; + private static CellType Cell(Tuple point, CellType[][] grid) => grid[point.Item2][point.Item1]; - private static Point[] FindCorners(CellType[][] grid) => + private static Tuple[] FindCorners(CellType[][] grid) => Enumerable.Range(0, Rows(grid)).SelectMany(y => - Enumerable.Range(0, Cols(grid)).Select(x => new Point(x, y))) + Enumerable.Range(0, Cols(grid)).Select(x => new Tuple(x, y))) .Where(point => Cell(point, grid) == CellType.Corner) .ToArray(); - private static bool ConnectsVertically(Point point, CellType[][] grid) => + private static bool ConnectsVertically(Tuple point, CellType[][] grid) => (Cell(point, grid) == CellType.VerticalLine) || (Cell(point, grid) == CellType.Corner); - private static bool ConnectedVertically(Point top, Point bottom, CellType[][] grid) => - Enumerable.Range(top.Y + 1, bottom.Y - top.Y - 1).All(y => ConnectsVertically(new Point(top.X, y), grid)); + private static bool ConnectedVertically(Tuple top, Tuple bottom, CellType[][] grid) => + Enumerable.Range(top.Item2 + 1, bottom.Item2 - top.Item2 - 1).All(y => ConnectsVertically(new Tuple(top.Item1, y), grid)); - private static bool ConnectsHorizontally(Point point, CellType[][] grid) => + private static bool ConnectsHorizontally(Tuple point, CellType[][] grid) => (Cell(point, grid) == CellType.HorizontalLine) || (Cell(point, grid) == CellType.Corner); - private static bool ConnectedHorizontally(Point left, Point right, CellType[][] grid) => - Enumerable.Range(left.X + 1, right.X - left.X - 1).All(x => ConnectsHorizontally(new Point(x, left.Y), grid)); + private static bool ConnectedHorizontally(Tuple left, Tuple right, CellType[][] grid) => + Enumerable.Range(left.Item1 + 1, right.Item1 - left.Item1 - 1).All(x => ConnectsHorizontally(new Tuple(x, left.Item2), grid)); - private static bool IsTopLineOfRectangle(Point topLeft, Point topRight, CellType[][] grid) => - (topRight.X > topLeft.X) && (topRight.Y == topLeft.Y) && ConnectedHorizontally(topLeft, topRight, grid); + private static bool IsTopLineOfRectangle(Tuple topLeft, Tuple topRight, CellType[][] grid) => + (topRight.Item1 > topLeft.Item1) && (topRight.Item2 == topLeft.Item2) && ConnectedHorizontally(topLeft, topRight, grid); - private static bool IsRightLineOfRectangle(Point topRight, Point bottomRight, CellType[][] grid) => - (bottomRight.X == topRight.X) && (bottomRight.Y > topRight.Y) && + private static bool IsRightLineOfRectangle(Tuple topRight, Tuple bottomRight, CellType[][] grid) => + (bottomRight.Item1 == topRight.Item1) && (bottomRight.Item2 > topRight.Item2) && ConnectedVertically(topRight, bottomRight, grid); - private static bool IsBottomLineOfRectangle(Point bottomLeft, Point bottomRight, CellType[][] grid) => - (bottomRight.X > bottomLeft.X) && (bottomRight.Y == bottomLeft.Y) && + private static bool IsBottomLineOfRectangle(Tuple bottomLeft, Tuple bottomRight, CellType[][] grid) => + (bottomRight.Item1 > bottomLeft.Item1) && (bottomRight.Item2 == bottomLeft.Item2) && ConnectedHorizontally(bottomLeft, bottomRight, grid); - private static bool IsLeftLineOfRectangle(Point topLeft, Point bottomLeft, CellType[][] grid) => - (bottomLeft.X == topLeft.X) && (bottomLeft.Y > topLeft.Y) && ConnectedVertically(topLeft, bottomLeft, grid); + private static bool IsLeftLineOfRectangle(Tuple topLeft, Tuple bottomLeft, CellType[][] grid) => + (bottomLeft.Item1 == topLeft.Item1) && (bottomLeft.Item2 > topLeft.Item2) && ConnectedVertically(topLeft, bottomLeft, grid); - private static int RectangleForCorner(Point topLeft, Point[] corners, CellType[][] grid) + private static int RectangleForCorner(Tuple topLeft, Tuple[] corners, CellType[][] grid) { return (from topRight in corners.Where(corner => IsTopLineOfRectangle(topLeft, corner, grid)) from bottomLeft in corners.Where(corner => IsLeftLineOfRectangle(topLeft, corner, grid)) diff --git a/exercises/rectangles/Rectangles.cs b/exercises/rectangles/Rectangles.cs new file mode 100644 index 0000000000..87ce5f3fc5 --- /dev/null +++ b/exercises/rectangles/Rectangles.cs @@ -0,0 +1,9 @@ +using System; + +public static class Rectangles +{ + public static int Count(string[] rows) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/rectangles/Rectangles.csproj b/exercises/rectangles/Rectangles.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/rectangles/Rectangles.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/rectangles/RectanglesTest.cs b/exercises/rectangles/RectanglesTest.cs index bace8c3b95..041165ded8 100644 --- a/exercises/rectangles/RectanglesTest.cs +++ b/exercises/rectangles/RectanglesTest.cs @@ -1,32 +1,29 @@ -using NUnit.Framework; +using Xunit; public class RectanglesTest { - [Test] + [Fact] public void No_rows() { var input = new string[0]; - Assert.That(Rectangles.Count(input), Is.EqualTo(0)); + Assert.Equal(0, Rectangles.Count(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void No_columns() { var input = new[] { "" }; - Assert.That(Rectangles.Count(input), Is.EqualTo(0)); + Assert.Equal(0, Rectangles.Count(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void No_rectangles() { var input = new[] { " " }; - Assert.That(Rectangles.Count(input), Is.EqualTo(0)); + Assert.Equal(0, Rectangles.Count(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One_rectangle() { var input = new[] @@ -35,11 +32,10 @@ public void One_rectangle() "| |", "+-+" }; - Assert.That(Rectangles.Count(input), Is.EqualTo(1)); + Assert.Equal(1, Rectangles.Count(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Two_rectangles_without_shared_parts() { var input = new[] @@ -50,11 +46,10 @@ public void Two_rectangles_without_shared_parts() "| | ", "+-+ " }; - Assert.That(Rectangles.Count(input), Is.EqualTo(2)); + Assert.Equal(2, Rectangles.Count(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Five_rectangles_with_shared_parts() { var input = new[] @@ -65,11 +60,10 @@ public void Five_rectangles_with_shared_parts() "| | |", "+-+-+" }; - Assert.That(Rectangles.Count(input), Is.EqualTo(5)); + Assert.Equal(5, Rectangles.Count(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Only_complete_rectangles_are_counted() { var input = new[] @@ -80,11 +74,10 @@ public void Only_complete_rectangles_are_counted() "| | -", "+-+-+" }; - Assert.That(Rectangles.Count(input), Is.EqualTo(1)); + Assert.Equal(1, Rectangles.Count(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Rectangles_can_be_of_different_sizes() { var input = new[] @@ -95,11 +88,10 @@ public void Rectangles_can_be_of_different_sizes() "| | |", "+---+-------+" }; - Assert.That(Rectangles.Count(input), Is.EqualTo(3)); + Assert.Equal(3, Rectangles.Count(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Corner_is_required_for_a_rectangle_to_be_complete() { var input = new[] @@ -110,11 +102,10 @@ public void Corner_is_required_for_a_rectangle_to_be_complete() "| | |", "+---+-------+" }; - Assert.That(Rectangles.Count(input), Is.EqualTo(2)); + Assert.Equal(2, Rectangles.Count(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Large_input_with_many_rectangles() { var input = new[] @@ -128,6 +119,6 @@ public void Large_input_with_many_rectangles() "+------+ | |", " +-+" }; - Assert.That(Rectangles.Count(input), Is.EqualTo(60)); + Assert.Equal(60, Rectangles.Count(input)); } } \ No newline at end of file diff --git a/exercises/rna-transcription/ComplementTest.cs b/exercises/rna-transcription/ComplementTest.cs deleted file mode 100644 index 6820025a80..0000000000 --- a/exercises/rna-transcription/ComplementTest.cs +++ /dev/null @@ -1,39 +0,0 @@ -using NUnit.Framework; - -[TestFixture] -public class ComplementTest -{ - [Test] - public void Rna_complement_of_cytosine_is_guanine() - { - Assert.That(Complement.OfDna("C"), Is.EqualTo("G")); - } - - [Ignore("Remove to run test")] - [Test] - public void Rna_complement_of_guanine_is_cytosine() - { - Assert.That(Complement.OfDna("G"), Is.EqualTo("C")); - } - - [Ignore("Remove to run test")] - [Test] - public void Rna_complement_of_thymine_is_adenine() - { - Assert.That(Complement.OfDna("T"), Is.EqualTo("A")); - } - - [Ignore("Remove to run test")] - [Test] - public void Rna_complement_of_adenine_is_uracil() - { - Assert.That(Complement.OfDna("A"), Is.EqualTo("U")); - } - - [Ignore("Remove to run test")] - [Test] - public void Rna_complement() - { - Assert.That(Complement.OfDna("ACGTGGTCTTAA"), Is.EqualTo("UGCACCAGAAUU")); - } -} \ No newline at end of file diff --git a/exercises/rna-transcription/RnaTranscription.cs b/exercises/rna-transcription/RnaTranscription.cs new file mode 100644 index 0000000000..882268f979 --- /dev/null +++ b/exercises/rna-transcription/RnaTranscription.cs @@ -0,0 +1,9 @@ +using System; + +public static class Complement +{ + public static string OfDna(string nucleotide) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/rna-transcription/RnaTranscription.csproj b/exercises/rna-transcription/RnaTranscription.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/rna-transcription/RnaTranscription.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/rna-transcription/RnaTranscriptionTest.cs b/exercises/rna-transcription/RnaTranscriptionTest.cs new file mode 100644 index 0000000000..dc25888d63 --- /dev/null +++ b/exercises/rna-transcription/RnaTranscriptionTest.cs @@ -0,0 +1,34 @@ +using Xunit; + +public class ComplementTest +{ + [Fact] + public void Rna_complement_of_cytosine_is_guanine() + { + Assert.Equal("G", Complement.OfDna("C")); + } + + [Fact(Skip = "Remove to run test")] + public void Rna_complement_of_guanine_is_cytosine() + { + Assert.Equal("C", Complement.OfDna("G")); + } + + [Fact(Skip = "Remove to run test")] + public void Rna_complement_of_thymine_is_adenine() + { + Assert.Equal("A", Complement.OfDna("T")); + } + + [Fact(Skip = "Remove to run test")] + public void Rna_complement_of_adenine_is_uracil() + { + Assert.Equal("U", Complement.OfDna("A")); + } + + [Fact(Skip = "Remove to run test")] + public void Rna_complement() + { + Assert.Equal("UGCACCAGAAUU", Complement.OfDna("ACGTGGTCTTAA")); + } +} \ No newline at end of file diff --git a/exercises/robot-name/RobotName.cs b/exercises/robot-name/RobotName.cs new file mode 100644 index 0000000000..03c4a37ceb --- /dev/null +++ b/exercises/robot-name/RobotName.cs @@ -0,0 +1,17 @@ +using System; + +public class Robot +{ + public string Name + { + get + { + throw new NotImplementedException("You need to implement this function."); + } + } + + public void Reset() + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/robot-name/RobotName.csproj b/exercises/robot-name/RobotName.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/robot-name/RobotName.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/robot-name/RobotNameTest.cs b/exercises/robot-name/RobotNameTest.cs index 9477a6583d..b6f5e5ff6d 100644 --- a/exercises/robot-name/RobotNameTest.cs +++ b/exercises/robot-name/RobotNameTest.cs @@ -1,43 +1,33 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class RobotNameTest { - private Robot robot; + private readonly Robot robot = new Robot(); - [SetUp] - public void Setup() - { - robot = new Robot(); - } - - [Test] + [Fact] public void Robot_has_a_name() { - StringAssert.IsMatch(@"[A-Z]{2}\d{3}", robot.Name); + Assert.Matches(@"[A-Z]{2}\d{3}", robot.Name); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Name_is_the_same_each_time() { - Assert.That(robot.Name, Is.EqualTo(robot.Name)); + Assert.Equal(robot.Name, robot.Name); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Different_robots_have_different_names() { var robot2 = new Robot(); - Assert.That(robot.Name, Is.Not.EqualTo(robot2.Name)); + Assert.NotEqual(robot2.Name, robot.Name); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_reset_the_name() { var originalName = robot.Name; robot.Reset(); - Assert.That(robot.Name, Is.Not.EqualTo(originalName)); + Assert.NotEqual(originalName, robot.Name); } } \ No newline at end of file diff --git a/exercises/robot-simulator/RobotSimulator.cs b/exercises/robot-simulator/RobotSimulator.cs new file mode 100644 index 0000000000..5fa8c719b7 --- /dev/null +++ b/exercises/robot-simulator/RobotSimulator.cs @@ -0,0 +1,64 @@ +using System; + +public enum Bearing +{ + North, + East, + South, + West +} + +public struct Coordinate +{ + public Coordinate(int x, int y) + { + X = x; + Y = y; + } + + public int X { get; } + public int Y { get; } +} + +public class RobotSimulator +{ + public RobotSimulator(Bearing bearing, Coordinate coordinate) + { + } + + public Bearing Bearing + { + get + { + throw new NotImplementedException("You need to implement this function."); + } + } + + public Coordinate Coordinate + { + get + { + throw new NotImplementedException("You need to implement this function."); + } + } + + public void TurnRight() + { + throw new NotImplementedException("You need to implement this function."); + } + + public void TurnLeft() + { + throw new NotImplementedException("You need to implement this function."); + } + + public void Advance() + { + throw new NotImplementedException("You need to implement this function."); + } + + public void Simulate(string instructions) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/robot-simulator/RobotSimulator.csproj b/exercises/robot-simulator/RobotSimulator.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/robot-simulator/RobotSimulator.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/robot-simulator/RobotSimulatorTest.cs b/exercises/robot-simulator/RobotSimulatorTest.cs index ed4d9b807a..db5be514b7 100644 --- a/exercises/robot-simulator/RobotSimulatorTest.cs +++ b/exercises/robot-simulator/RobotSimulatorTest.cs @@ -1,64 +1,59 @@ -using NUnit.Framework; +using Xunit; public class RobotSimulatorTest { - [Test] + [Fact] public void Turn_right_edge_case() { var robot = new RobotSimulator(Bearing.West, new Coordinate(0, 0)); robot.TurnRight(); - Assert.That(robot.Bearing, Is.EqualTo(Bearing.North)); + Assert.Equal(Bearing.North, robot.Bearing); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Turn_left_edge_case() { var robot = new RobotSimulator(Bearing.North, new Coordinate(0, 0)); robot.TurnLeft(); - Assert.That(robot.Bearing, Is.EqualTo(Bearing.West)); + Assert.Equal(Bearing.West, robot.Bearing); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Robbie() { var robbie = new RobotSimulator(Bearing.East, new Coordinate(-2, 1)); - Assert.That(robbie.Bearing, Is.EqualTo(Bearing.East)); - Assert.That(robbie.Coordinate, Is.EqualTo(new Coordinate(-2, 1))); + Assert.Equal(Bearing.East, robbie.Bearing); + Assert.Equal(new Coordinate(-2, 1), robbie.Coordinate); robbie.Simulate("RLAALAL"); - Assert.That(robbie.Bearing, Is.EqualTo(Bearing.West)); - Assert.That(robbie.Coordinate, Is.EqualTo(new Coordinate(0, 2))); + Assert.Equal(Bearing.West, robbie.Bearing); + Assert.Equal(new Coordinate(0, 2), robbie.Coordinate); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Clutz() { var clutz = new RobotSimulator(Bearing.North, new Coordinate(0, 0)); clutz.Simulate("LAAARALA"); - Assert.That(clutz.Bearing, Is.EqualTo(Bearing.West)); - Assert.That(clutz.Coordinate, Is.EqualTo(new Coordinate(-4, 1))); + Assert.Equal(Bearing.West, clutz.Bearing); + Assert.Equal(new Coordinate(-4, 1), clutz.Coordinate); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Sphero() { var sphero = new RobotSimulator(Bearing.East, new Coordinate(2, -7)); sphero.Simulate("RRAAAAALA"); - Assert.That(sphero.Bearing, Is.EqualTo(Bearing.South)); - Assert.That(sphero.Coordinate, Is.EqualTo(new Coordinate(-3, -8))); + Assert.Equal(Bearing.South, sphero.Bearing); + Assert.Equal(new Coordinate(-3, -8), sphero.Coordinate); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Roomba() { var roomba = new RobotSimulator(Bearing.South, new Coordinate(8, 4)); roomba.Simulate("LAAARRRALLLL"); - Assert.That(roomba.Bearing, Is.EqualTo(Bearing.North)); - Assert.That(roomba.Coordinate, Is.EqualTo(new Coordinate(11, 5))); + Assert.Equal(Bearing.North, roomba.Bearing); + Assert.Equal(new Coordinate(11, 5), roomba.Coordinate); } } \ No newline at end of file diff --git a/exercises/roman-numerals/RomanNumerals.cs b/exercises/roman-numerals/RomanNumerals.cs new file mode 100644 index 0000000000..427484ebf4 --- /dev/null +++ b/exercises/roman-numerals/RomanNumerals.cs @@ -0,0 +1,9 @@ +using System; + +public static class RomanNumeralExtension +{ + public static string ToRoman(this int value) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/roman-numerals/RomanNumerals.csproj b/exercises/roman-numerals/RomanNumerals.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/roman-numerals/RomanNumerals.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/roman-numerals/RomanNumeralsTest.cs b/exercises/roman-numerals/RomanNumeralsTest.cs index 69c24238d9..c9cfafde60 100644 --- a/exercises/roman-numerals/RomanNumeralsTest.cs +++ b/exercises/roman-numerals/RomanNumeralsTest.cs @@ -1,29 +1,29 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class RomanNumeralsTest { - [TestCase(0, ExpectedResult = "")] - [TestCase(1, ExpectedResult = "I", Ignore = "Remove to run test case")] - [TestCase(2, ExpectedResult = "II", Ignore = "Remove to run test case")] - [TestCase(3, ExpectedResult = "III", Ignore = "Remove to run test case")] - [TestCase(4, ExpectedResult = "IV", Ignore = "Remove to run test case")] - [TestCase(5, ExpectedResult = "V", Ignore = "Remove to run test case")] - [TestCase(6, ExpectedResult = "VI", Ignore = "Remove to run test case")] - [TestCase(9, ExpectedResult = "IX", Ignore = "Remove to run test case")] - [TestCase(27, ExpectedResult = "XXVII", Ignore = "Remove to run test case")] - [TestCase(48, ExpectedResult = "XLVIII", Ignore = "Remove to run test case")] - [TestCase(59, ExpectedResult = "LIX", Ignore = "Remove to run test case")] - [TestCase(93, ExpectedResult = "XCIII", Ignore = "Remove to run test case")] - [TestCase(141, ExpectedResult = "CXLI", Ignore = "Remove to run test case")] - [TestCase(163, ExpectedResult = "CLXIII", Ignore = "Remove to run test case")] - [TestCase(402, ExpectedResult = "CDII", Ignore = "Remove to run test case")] - [TestCase(575, ExpectedResult = "DLXXV", Ignore = "Remove to run test case")] - [TestCase(911, ExpectedResult = "CMXI", Ignore = "Remove to run test case")] - [TestCase(1024, ExpectedResult = "MXXIV", Ignore = "Remove to run test case")] - [TestCase(3000, ExpectedResult = "MMM", Ignore = "Remove to run test case")] - public string Convert_roman_to_arabic_numerals(int arabicNumeral) + [Theory] + [InlineData(0, "")] + [InlineData(1, "I")] + [InlineData(2, "II")] + [InlineData(3, "III")] + [InlineData(4, "IV")] + [InlineData(5, "V")] + [InlineData(6, "VI")] + [InlineData(9, "IX")] + [InlineData(27, "XXVII")] + [InlineData(48, "XLVIII")] + [InlineData(59, "LIX")] + [InlineData(93, "XCIII")] + [InlineData(141, "CXLI")] + [InlineData(163, "CLXIII")] + [InlineData(402, "CDII")] + [InlineData(575, "DLXXV")] + [InlineData(911, "CMXI")] + [InlineData(1024, "MXXIV")] + [InlineData(3000, "MMM")] + public void Convert_roman_to_arabic_numerals(int arabicNumeral, string expected) { - return arabicNumeral.ToRoman(); + Assert.Equal(expected, arabicNumeral.ToRoman()); } } \ No newline at end of file diff --git a/exercises/run-length-encoding/RunLengthEncoding.cs b/exercises/run-length-encoding/RunLengthEncoding.cs new file mode 100644 index 0000000000..7844d89208 --- /dev/null +++ b/exercises/run-length-encoding/RunLengthEncoding.cs @@ -0,0 +1,14 @@ +using System; + +public static class RunLengthEncoding +{ + public static string Encode(string input) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static string Decode(string input) + { + throw new NotImplementedException("You need to implement this function."); + } +} diff --git a/exercises/run-length-encoding/RunLengthEncoding.csproj b/exercises/run-length-encoding/RunLengthEncoding.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/run-length-encoding/RunLengthEncoding.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/run-length-encoding/RunLengthEncodingTest.cs b/exercises/run-length-encoding/RunLengthEncodingTest.cs index ab48b145cd..f1808d2274 100644 --- a/exercises/run-length-encoding/RunLengthEncodingTest.cs +++ b/exercises/run-length-encoding/RunLengthEncodingTest.cs @@ -1,66 +1,60 @@ -using NUnit.Framework; +using Xunit; public class RunLengthEncodingTest { - [Test] + [Fact] public void Encode_simple() { const string input = "AABBBCCCC"; const string expected = "2A3B4C"; - Assert.That(RunLengthEncoding.Encode(input), Is.EqualTo(expected)); + Assert.Equal(expected, RunLengthEncoding.Encode(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Decode_simple() { const string input = "2A3B4C"; const string expected = "AABBBCCCC"; - Assert.That(RunLengthEncoding.Decode(input), Is.EqualTo(expected)); + Assert.Equal(expected, RunLengthEncoding.Decode(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Encode_with_single_values() { const string input = "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB"; const string expected = "12WB12W3B24WB"; - Assert.That(RunLengthEncoding.Encode(input), Is.EqualTo(expected)); + Assert.Equal(expected, RunLengthEncoding.Encode(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Decode_with_single_values() { const string input = "12WB12W3B24WB"; const string expected = "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB"; - Assert.That(RunLengthEncoding.Decode(input), Is.EqualTo(expected)); + Assert.Equal(expected, RunLengthEncoding.Decode(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Encode_and_then_decode() { const string input = "zzz ZZ zZ"; const string expected = "zzz ZZ zZ"; - Assert.That(RunLengthEncoding.Decode(RunLengthEncoding.Encode(input)), Is.EqualTo(expected)); + Assert.Equal(expected, RunLengthEncoding.Decode(RunLengthEncoding.Encode(input))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Encode_unicode() { const string input = "⏰⚽⚽⚽⭐⭐⏰"; const string expected = "⏰3⚽2⭐⏰"; - Assert.That(RunLengthEncoding.Encode(input), Is.EqualTo(expected)); + Assert.Equal(expected, RunLengthEncoding.Encode(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Decode_unicode() { const string input = "⏰3⚽2⭐⏰"; const string expected = "⏰⚽⚽⚽⭐⭐⏰"; - Assert.That(RunLengthEncoding.Decode(input), Is.EqualTo(expected)); + Assert.Equal(expected, RunLengthEncoding.Decode(input)); } } \ No newline at end of file diff --git a/exercises/saddle-points/SaddlePointTest.cs b/exercises/saddle-points/SaddlePointTest.cs index 5458ced1cb..74b7eacfc7 100644 --- a/exercises/saddle-points/SaddlePointTest.cs +++ b/exercises/saddle-points/SaddlePointTest.cs @@ -1,9 +1,9 @@ using System; -using NUnit.Framework; +using Xunit; public class SaddlePointTests { - [Test] + [Fact] public void Readme_example() { var values = new[,] @@ -13,11 +13,10 @@ public void Readme_example() { 6, 6, 7 } }; var actual = new SaddlePoints(values).Calculate(); - Assert.That(actual, Is.EqualTo(new [] { Tuple.Create(1, 0)})); + Assert.Equal(new [] { Tuple.Create(1, 0)}, actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void No_saddle_point() { var values = new[,] @@ -26,11 +25,10 @@ public void No_saddle_point() { 1, 2 } }; var actual = new SaddlePoints(values).Calculate(); - Assert.That(actual, Is.Empty); + Assert.Empty(actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Saddle_point() { var values = new[,] @@ -39,11 +37,10 @@ public void Saddle_point() { 3, 4 } }; var actual = new SaddlePoints(values).Calculate(); - Assert.That(actual, Is.EqualTo(new[] { Tuple.Create(0, 1) })); + Assert.Equal(new[] { Tuple.Create(0, 1) }, actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Another_saddle_point() { var values = new[,] @@ -53,11 +50,10 @@ public void Another_saddle_point() { 3, 4, 8, 6, 7 } }; var actual = new SaddlePoints(values).Calculate(); - Assert.That(actual, Is.EqualTo(new[] { Tuple.Create(2, 2) })); + Assert.Equal(new[] { Tuple.Create(2, 2) }, actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Multiple_saddle_points() { var values = new[,] @@ -67,6 +63,6 @@ public void Multiple_saddle_points() { 1, 5, 4 } }; var actual = new SaddlePoints(values).Calculate(); - Assert.That(actual, Is.EqualTo(new[] { Tuple.Create(0, 1), Tuple.Create(1, 1), Tuple.Create(2, 1) })); + Assert.Equal(new[] { Tuple.Create(0, 1), Tuple.Create(1, 1), Tuple.Create(2, 1) }, actual); } } \ No newline at end of file diff --git a/exercises/saddle-points/SaddlePoints.cs b/exercises/saddle-points/SaddlePoints.cs new file mode 100644 index 0000000000..7d19831ddc --- /dev/null +++ b/exercises/saddle-points/SaddlePoints.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +public class SaddlePoints +{ + public SaddlePoints(int[,] values) + { + } + + public IEnumerable> Calculate() + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/saddle-points/SaddlePoints.csproj b/exercises/saddle-points/SaddlePoints.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/saddle-points/SaddlePoints.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/say/Example.cs b/exercises/say/Example.cs index 2898326946..e9660addd6 100644 --- a/exercises/say/Example.cs +++ b/exercises/say/Example.cs @@ -8,7 +8,7 @@ public static string InEnglish(long number) { if (number < 0L || number >= 1000000000000L) { - throw new ArgumentException("Number out of range."); + throw new ArgumentOutOfRangeException("Number out of range."); } if (number == 0L) diff --git a/exercises/say/Say.cs b/exercises/say/Say.cs new file mode 100644 index 0000000000..76aae1cd03 --- /dev/null +++ b/exercises/say/Say.cs @@ -0,0 +1,9 @@ +using System; + +public static class Say +{ + public static string InEnglish(long number) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/say/Say.csproj b/exercises/say/Say.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/say/Say.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/say/SayTest.cs b/exercises/say/SayTest.cs index db0d3d9652..332fe95ba5 100644 --- a/exercises/say/SayTest.cs +++ b/exercises/say/SayTest.cs @@ -1,115 +1,101 @@ -using NUnit.Framework; +using System; +using Xunit; public class SayTest { - [Test] + [Fact] public void Zero() { - Assert.That(Say.InEnglish(0L), Is.EqualTo("zero")); + Assert.Equal("zero", Say.InEnglish(0L)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One() { - Assert.That(Say.InEnglish(1L), Is.EqualTo("one")); + Assert.Equal("one", Say.InEnglish(1L)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Fourteen() { - Assert.That(Say.InEnglish(14L), Is.EqualTo("fourteen")); + Assert.Equal("fourteen", Say.InEnglish(14L)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Twenty() { - Assert.That(Say.InEnglish(20L), Is.EqualTo("twenty")); + Assert.Equal("twenty", Say.InEnglish(20L)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Twenty_two() { - Assert.That(Say.InEnglish(22L), Is.EqualTo("twenty-two")); + Assert.Equal("twenty-two", Say.InEnglish(22L)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One_hundred() { - Assert.That(Say.InEnglish(100L), Is.EqualTo("one hundred")); + Assert.Equal("one hundred", Say.InEnglish(100L)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One_hundred_twenty_three() { - Assert.That(Say.InEnglish(123L), Is.EqualTo("one hundred twenty-three")); + Assert.Equal("one hundred twenty-three", Say.InEnglish(123L)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One_thousand() { - Assert.That(Say.InEnglish(1000L), Is.EqualTo("one thousand")); + Assert.Equal("one thousand", Say.InEnglish(1000L)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One_thousand_two_hundred_thirty_four() { - Assert.That(Say.InEnglish(1234L), Is.EqualTo("one thousand two hundred thirty-four")); + Assert.Equal("one thousand two hundred thirty-four", Say.InEnglish(1234L)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One_million() { - Assert.That(Say.InEnglish(1000000L), Is.EqualTo("one million")); + Assert.Equal("one million", Say.InEnglish(1000000L)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One_million_two() { - Assert.That(Say.InEnglish(1000002L), Is.EqualTo("one million two")); + Assert.Equal("one million two", Say.InEnglish(1000002L)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One_million_two_thousand_three_hundred_forty_five() { - Assert.That(Say.InEnglish(1002345L), Is.EqualTo("one million two thousand three hundred forty-five")); + Assert.Equal("one million two thousand three hundred forty-five", Say.InEnglish(1002345L)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One_billion() { - Assert.That(Say.InEnglish(1000000000L), Is.EqualTo("one billion")); + Assert.Equal("one billion", Say.InEnglish(1000000000L)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void A_big_number() { - Assert.That(Say.InEnglish(987654321123L), Is.EqualTo("nine hundred eighty-seven billion six hundred fifty-four million three hundred twenty-one thousand one hundred twenty-three")); + Assert.Equal("nine hundred eighty-seven billion six hundred fifty-four million three hundred twenty-one thousand one hundred twenty-three", Say.InEnglish(987654321123L)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Lower_bound() { - Assert.That(() => Say.InEnglish(-1L), Throws.Exception); + Assert.Throws(() => Say.InEnglish(-1L)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Upper_bound() { - Assert.That(() => Say.InEnglish(1000000000000L), Throws.Exception); + Assert.Throws(() => Say.InEnglish(1000000000000L)); } } \ No newline at end of file diff --git a/exercises/scale-generator/Example.cs b/exercises/scale-generator/Example.cs index c773db6a17..b355c388c9 100644 --- a/exercises/scale-generator/Example.cs +++ b/exercises/scale-generator/Example.cs @@ -17,7 +17,7 @@ public static class ScaleGenerator public static string[] Pitches(string tonic, string pattern) { var scale = Scale(tonic); - var index = Array.FindIndex(scale, pitch => string.Equals(pitch, tonic, StringComparison.InvariantCultureIgnoreCase)); + var index = Array.FindIndex(scale, pitch => string.Equals(pitch, tonic, StringComparison.OrdinalIgnoreCase)); var shiftedScale = Shift(index, scale); var pitches = new List(); diff --git a/exercises/scale-generator/ScaleGenerator.cs b/exercises/scale-generator/ScaleGenerator.cs new file mode 100644 index 0000000000..b1f112109e --- /dev/null +++ b/exercises/scale-generator/ScaleGenerator.cs @@ -0,0 +1,9 @@ +using System; + +public static class ScaleGenerator +{ + public static string[] Pitches(string tonic, string pattern) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/scale-generator/ScaleGenerator.csproj b/exercises/scale-generator/ScaleGenerator.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/scale-generator/ScaleGenerator.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/scale-generator/ScaleGeneratorTest.cs b/exercises/scale-generator/ScaleGeneratorTest.cs index 30297ad1a0..42ea887f53 100644 --- a/exercises/scale-generator/ScaleGeneratorTest.cs +++ b/exercises/scale-generator/ScaleGeneratorTest.cs @@ -1,129 +1,116 @@ -using NUnit.Framework; +using Xunit; public class ScaleGeneratorTest { - [Test] + [Fact] public void Major_scale() { var major = ScaleGenerator.Pitches("C", "MMmMMMm"); var expected = new[] {"C", "D", "E", "F", "G", "A", "B"}; - Assert.That(major, Is.EqualTo(expected)); + Assert.Equal(expected, major); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Another_major_scale() { var major = ScaleGenerator.Pitches("G", "MMmMMMm"); var expected = new[] {"G", "A", "B", "C", "D", "E", "F#"}; - Assert.That(major, Is.EqualTo(expected)); + Assert.Equal(expected, major); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Minor_scale() { var minor = ScaleGenerator.Pitches("f#", "MmMMmMM"); var expected = new[] {"F#", "G#", "A", "B", "C#", "D", "E"}; - Assert.That(minor, Is.EqualTo(expected)); + Assert.Equal(expected, minor); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Another_minor_scale() { var minor = ScaleGenerator.Pitches("bb", "MmMMmMM"); var expected = new[] {"Bb", "C", "Db", "Eb", "F", "Gb", "Ab"}; - Assert.That(minor, Is.EqualTo(expected)); + Assert.Equal(expected, minor); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Dorian_mode() { var dorian = ScaleGenerator.Pitches("d", "MmMMMmM"); var expected = new[] {"D", "E", "F", "G", "A", "B", "C"}; - Assert.That(dorian, Is.EqualTo(expected)); + Assert.Equal(expected, dorian); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Mixolydian_mode() { var mixolydian = ScaleGenerator.Pitches("Eb", "MMmMMmM"); var expected = new[] {"Eb", "F", "G", "Ab", "Bb", "C", "Db"}; - Assert.That(mixolydian, Is.EqualTo(expected)); + Assert.Equal(expected, mixolydian); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Lydian_mode() { var lydian = ScaleGenerator.Pitches("a", "MMMmMMm"); var expected = new[] {"A", "B", "C#", "D#", "E", "F#", "G#"}; - Assert.That(lydian, Is.EqualTo(expected)); + Assert.Equal(expected, lydian); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Phrygian_mode() { var phrygian = ScaleGenerator.Pitches("e", "mMMMmMM"); var expected = new[] {"E", "F", "G", "A", "B", "C", "D"}; - Assert.That(phrygian, Is.EqualTo(expected)); + Assert.Equal(expected, phrygian); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Locrian_mode() { var locrian = ScaleGenerator.Pitches("g", "mMMmMMM"); var expected = new[] {"G", "Ab", "Bb", "C", "Db", "Eb", "F"}; - Assert.That(locrian, Is.EqualTo(expected)); + Assert.Equal(expected, locrian); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Harmonic_minor() { var harmonicMinor = ScaleGenerator.Pitches("d", "MmMMmAm"); var expected = new[] {"D", "E", "F", "G", "A", "Bb", "Db"}; - Assert.That(harmonicMinor, Is.EqualTo(expected)); + Assert.Equal(expected, harmonicMinor); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Octatonic() { var octatonic = ScaleGenerator.Pitches("C", "MmMmMmMm"); var expected = new[] {"C", "D", "D#", "F", "F#", "G#", "A", "B"}; - Assert.That(octatonic, Is.EqualTo(expected)); + Assert.Equal(expected, octatonic); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Hexatonic() { var hexatonic = ScaleGenerator.Pitches("Db", "MMMMMM"); var expected = new[] {"Db", "Eb", "F", "G", "A", "B"}; - Assert.That(hexatonic, Is.EqualTo(expected)); + Assert.Equal(expected, hexatonic); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Pentatonic() { var pentatonic = ScaleGenerator.Pitches("A", "MMAMA"); var expected = new[] {"A", "B", "C#", "E", "F#"}; - Assert.That(pentatonic, Is.EqualTo(expected)); + Assert.Equal(expected, pentatonic); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Enigmatic() { var enigmatic = ScaleGenerator.Pitches("G", "mAMMMmm"); var expected = new[] {"G", "G#", "B", "C#", "D#", "F", "F#"}; - Assert.That(enigmatic, Is.EqualTo(expected)); + Assert.Equal(expected, enigmatic); } } \ No newline at end of file diff --git a/exercises/scrabble-score/ScrabbleScore.cs b/exercises/scrabble-score/ScrabbleScore.cs new file mode 100644 index 0000000000..d3c4b08e2f --- /dev/null +++ b/exercises/scrabble-score/ScrabbleScore.cs @@ -0,0 +1,9 @@ +using System; + +public static class Scrabble +{ + public static int Score(string input) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/scrabble-score/ScrabbleScore.csproj b/exercises/scrabble-score/ScrabbleScore.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/scrabble-score/ScrabbleScore.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/scrabble-score/ScrabbleScoreTest.cs b/exercises/scrabble-score/ScrabbleScoreTest.cs index 1f353e7cb4..7c4308d526 100644 --- a/exercises/scrabble-score/ScrabbleScoreTest.cs +++ b/exercises/scrabble-score/ScrabbleScoreTest.cs @@ -1,67 +1,58 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class ScrabbleScoreTest { - [Test] + [Fact] public void Empty_word_scores_zero() { - Assert.That(Scrabble.Score(""), Is.EqualTo(0)); + Assert.Equal(0, Scrabble.Score("")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Whitespace_scores_zero() { - Assert.That(Scrabble.Score(" \t\n"), Is.EqualTo(0)); + Assert.Equal(0, Scrabble.Score(" \t\n")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Null_scores_zero() { - Assert.That(Scrabble.Score(null), Is.EqualTo(0)); + Assert.Equal(0, Scrabble.Score(null)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Scores_very_short_word() { - Assert.That(Scrabble.Score("a"), Is.EqualTo(1)); + Assert.Equal(1, Scrabble.Score("a")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Scores_other_very_short_word() { - Assert.That(Scrabble.Score("f"), Is.EqualTo(4)); + Assert.Equal(4, Scrabble.Score("f")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Simple_word_scores_the_number_of_letters() { - Assert.That(Scrabble.Score("street"), Is.EqualTo(6)); + Assert.Equal(6, Scrabble.Score("street")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Complicated_word_scores_more() { - Assert.That(Scrabble.Score("quirky"), Is.EqualTo(22)); + Assert.Equal(22, Scrabble.Score("quirky")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Scores_are_case_insensitive() { - Assert.That(Scrabble.Score("OXYPHENBUTAZONE"), Is.EqualTo(41)); + Assert.Equal(41, Scrabble.Score("OXYPHENBUTAZONE")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Entire_alphabet() { - Assert.That(Scrabble.Score("abcdefghijklmnopqrstuvwxyz"), Is.EqualTo(87)); + Assert.Equal(87, Scrabble.Score("abcdefghijklmnopqrstuvwxyz")); } } \ No newline at end of file diff --git a/exercises/secret-handshake/SecretHandshake.cs b/exercises/secret-handshake/SecretHandshake.cs new file mode 100644 index 0000000000..682b7c07ed --- /dev/null +++ b/exercises/secret-handshake/SecretHandshake.cs @@ -0,0 +1,10 @@ +using System; +using System.Linq; + +public static class SecretHandshake +{ + public static string[] Commands(int commandValue) + { + throw new NotImplementedException("You need to implement this function."); + } +} diff --git a/exercises/secret-handshake/SecretHandshake.csproj b/exercises/secret-handshake/SecretHandshake.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/secret-handshake/SecretHandshake.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/secret-handshake/SecretHandshakeTest.cs b/exercises/secret-handshake/SecretHandshakeTest.cs index e05498664a..ae79211060 100644 --- a/exercises/secret-handshake/SecretHandshakeTest.cs +++ b/exercises/secret-handshake/SecretHandshakeTest.cs @@ -1,53 +1,46 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class SecretHandshakeTests { - [Test] + [Fact] public void Test_1_handshake_to_wink() { - Assert.That(SecretHandshake.Commands(1), Is.EqualTo(new[] { "wink" })); + Assert.Equal(new[] { "wink" }, SecretHandshake.Commands(1)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_10_handshake_to_double_blink() { - Assert.That(SecretHandshake.Commands(2), Is.EqualTo(new[] { "double blink" })); + Assert.Equal(new[] { "double blink" }, SecretHandshake.Commands(2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_100_handshake_to_close_your_eyes() { - Assert.That(SecretHandshake.Commands(4), Is.EqualTo(new[] { "close your eyes" })); + Assert.Equal(new[] { "close your eyes" }, SecretHandshake.Commands(4)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_1000_handshake_to_close_your_eyes() { - Assert.That(SecretHandshake.Commands(8), Is.EqualTo(new[] { "jump" })); + Assert.Equal(new[] { "jump" }, SecretHandshake.Commands(8)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_handshake_11_to_wink_and_double_blink() { - Assert.That(SecretHandshake.Commands(3), Is.EqualTo(new[] { "wink", "double blink" })); + Assert.Equal(new[] { "wink", "double blink" }, SecretHandshake.Commands(3)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_handshake_10011_to_double_blink_and_wink() { - Assert.That(SecretHandshake.Commands(19), Is.EqualTo(new[] { "double blink", "wink" })); + Assert.Equal(new[] { "double blink", "wink" }, SecretHandshake.Commands(19)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Test_handshake_11111_to_all_commands_reversed() { - Assert.That(SecretHandshake.Commands(31), Is.EqualTo(new[] { "jump", "close your eyes", "double blink", "wink" })); + Assert.Equal(new[] { "jump", "close your eyes", "double blink", "wink" }, SecretHandshake.Commands(31)); } } diff --git a/exercises/series/Series.cs b/exercises/series/Series.cs new file mode 100644 index 0000000000..5eb412662b --- /dev/null +++ b/exercises/series/Series.cs @@ -0,0 +1,13 @@ +using System; + +public class Series +{ + public Series(string numbers) + { + } + + public int[][] Slices(int sliceLength) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/series/Series.csproj b/exercises/series/Series.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/series/Series.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/series/SeriesTest.cs b/exercises/series/SeriesTest.cs index ba06103c96..17423b5419 100644 --- a/exercises/series/SeriesTest.cs +++ b/exercises/series/SeriesTest.cs @@ -1,79 +1,80 @@ -using NUnit.Framework; +using System; +using Xunit; -[TestFixture] public class SeriesTest { - private static readonly object[] SliceOneTestData = + public static readonly object[] SliceOneTestData = { new object[] { "01234", new[] { new[] { 0 }, new[] { 1 }, new[] { 2 }, new[] { 3 }, new[] { 4 } } }, new object[] { "92834", new[] { new[] { 9 }, new[] { 2 }, new[] { 8 }, new[] { 3 }, new[] { 4 } } } }; - [TestCaseSource("SliceOneTestData")] + [Theory] + [MemberData(nameof(SliceOneTestData))] public void Series_of_one_splits_to_one_digit(string input, int[][] result) { - Assert.That(new Series(input).Slices(1), Is.EqualTo(result)); + Assert.Equal(result, new Series(input).Slices(1)); } - private static readonly object[] SliceTwoTestData = + public static readonly object[] SliceTwoTestData = { new object[] { "01234", new[] { new[] { 0, 1 }, new[] { 1, 2 }, new[] { 2, 3 }, new[] { 3, 4 } } }, new object[] { "98273463", new[] { new[] { 9, 8 }, new[] { 8, 2 }, new[] { 2, 7 }, new[] { 7, 3 }, new[] { 3, 4 }, new[] { 4, 6 }, new[] { 6, 3 } } }, new object[] { "37103", new[] { new[] { 3, 7 }, new[] { 7, 1 }, new[] { 1, 0 }, new[] { 0, 3 } } } }; - [Ignore("Remove to run test")] - [TestCaseSource("SliceTwoTestData")] + [Theory(Skip = "Remove to run test")] + [MemberData(nameof(SliceTwoTestData))] public void Series_of_two_splits_to_two_digits(string input, int[][] result) { - Assert.That(new Series(input).Slices(2), Is.EqualTo(result)); + Assert.Equal(result, new Series(input).Slices(2)); } - private static readonly object[] SliceThreeTestData = + public static readonly object[] SliceThreeTestData = { new object[] { "01234", new[] { new[] { 0, 1, 2 }, new[] { 1, 2, 3 }, new[] { 2, 3, 4 } } }, new object[] { "31001", new[] { new[] { 3, 1, 0 }, new[] { 1, 0, 0 }, new[] { 0, 0, 1 } } }, new object[] { "982347", new[] { new[] { 9, 8, 2 }, new[] { 8, 2, 3 }, new[] { 2, 3, 4 }, new[] { 3, 4, 7 } } } }; - [Ignore("Remove to run test")] - [TestCaseSource("SliceThreeTestData")] + [Theory(Skip = "Remove to run test")] + [MemberData(nameof(SliceThreeTestData))] public void Series_of_three_splits_to_three_digits(string input, int[][] result) { - Assert.That(new Series(input).Slices(3), Is.EqualTo(result)); + Assert.Equal(result, new Series(input).Slices(3)); } - private static readonly object[] SliceFourTestData = + public static readonly object[] SliceFourTestData = { new object[] { "01234", new[] { new[] { 0, 1, 2, 3 }, new[] { 1, 2, 3, 4 } } }, new object[] { "91274", new[] { new[] { 9, 1, 2, 7 }, new[] { 1, 2, 7, 4 } } } }; - [Ignore("Remove to run test")] - [TestCaseSource("SliceFourTestData")] + [Theory(Skip = "Remove to run test")] + [MemberData(nameof(SliceFourTestData))] public void Series_of_four_splits_to_four_digits(string input, int[][] result) { - Assert.That(new Series(input).Slices(4), Is.EqualTo(result)); + Assert.Equal(result, new Series(input).Slices(4)); } - private static readonly object[] SliceFiveTestData = + public static readonly object[] SliceFiveTestData = { new object[] { "01234", new[] { new[] { 0, 1, 2, 3, 4 } } }, new object[] { "81228", new[] { new[] { 8, 1, 2, 2, 8 } } } }; - [Ignore("Remove to run test")] - [TestCaseSource("SliceFiveTestData")] + [Theory(Skip = "Remove to run test")] + [MemberData(nameof(SliceFiveTestData))] public void Series_of_five_splits_to_five_digits(string input, int[][] result) { - Assert.That(new Series(input).Slices(5), Is.EqualTo(result)); + Assert.Equal(result, new Series(input).Slices(5)); } - [Ignore("Remove to run test")] - [TestCase("01234", 6)] - [TestCase("01032987583", 19)] + [Theory(Skip = "Remove to run test")] + [InlineData("01234", 6)] + [InlineData("01032987583", 19)] public void Slice_longer_than_input_is_not_allowed(string input, int slice) { - Assert.That(() => new Series(input).Slices(slice), Throws.ArgumentException); + Assert.Throws(() => new Series(input).Slices(slice)); } } \ No newline at end of file diff --git a/exercises/sgf-parsing/Example.cs b/exercises/sgf-parsing/Example.cs index 800329ac73..e7b6a0ea84 100644 --- a/exercises/sgf-parsing/Example.cs +++ b/exercises/sgf-parsing/Example.cs @@ -34,7 +34,17 @@ private static Parser GameTree() => GameTree().Many().Then(trees => Parse.Char(')') .Select(___ => NodesToTree(nodes, trees))))); - public static SgfTree ParseTree(string input) => GameTree().Parse(input); + public static SgfTree ParseTree(string input) + { + try + { + return GameTree().Parse(input); + } + catch (Exception e) + { + throw new ArgumentException(nameof(input), e); + } + } private static SgfTree NodesToTree(IEnumerable> properties, IEnumerable trees) { diff --git a/exercises/sgf-parsing/SgfParsing.cs b/exercises/sgf-parsing/SgfParsing.cs index a63ef8f8ee..5c3f7d66f5 100644 --- a/exercises/sgf-parsing/SgfParsing.cs +++ b/exercises/sgf-parsing/SgfParsing.cs @@ -1,13 +1,22 @@ +using System; using System.Collections.Generic; public class SgfTree { - public IDictionary Data { get; } - public SgfTree[] Children { get; } - public SgfTree(IDictionary data, params SgfTree[] children) { Data = data; Children = children; } + + public IDictionary Data { get; } + public SgfTree[] Children { get; } +} + +public class SgfParser +{ + public static SgfTree ParseTree(string input) + { + throw new NotImplementedException(); + } } \ No newline at end of file diff --git a/exercises/sgf-parsing/SgfParsing.csproj b/exercises/sgf-parsing/SgfParsing.csproj new file mode 100644 index 0000000000..e441cf3746 --- /dev/null +++ b/exercises/sgf-parsing/SgfParsing.csproj @@ -0,0 +1,19 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + + diff --git a/exercises/sgf-parsing/SgfParsingTest.cs b/exercises/sgf-parsing/SgfParsingTest.cs index 9b695eb17f..958ff753a6 100644 --- a/exercises/sgf-parsing/SgfParsingTest.cs +++ b/exercises/sgf-parsing/SgfParsingTest.cs @@ -1,6 +1,7 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; -using NUnit.Framework; +using Xunit; public class SgfParsingTest { @@ -20,82 +21,73 @@ public class SgfParsingTest private static IDictionary CreateData(string key, params string[] values) => new Dictionary { [key] = values }; - [Test] + [Fact] public void Empty_value() { const string input = ""; - Assert.That(() => SgfParser.ParseTree(input), Throws.Exception); + Assert.Throws(() => SgfParser.ParseTree(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Tree_without_nodes() { const string input = "()"; - Assert.That(() => SgfParser.ParseTree(input), Throws.Exception); + Assert.Throws(() => SgfParser.ParseTree(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Node_without_tree() { const string input = ";"; - Assert.That(() => SgfParser.ParseTree(input), Throws.Exception); + Assert.Throws(() => SgfParser.ParseTree(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Node_without_properties() { const string input = "(;)"; var expected = TreeWithNoChildren(new Dictionary()); - Assert.That(SgfParser.ParseTree(input), Is.EqualTo(expected).Using(SgfTreeEqualityComparer.Instance)); + Assert.Equal(expected, SgfParser.ParseTree(input), SgfTreeEqualityComparer.Instance); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Single_node_tree() { const string input = "(;A[B])"; var expected = TreeWithNoChildren(CreateData("A", "B")); - Assert.That(SgfParser.ParseTree(input), Is.EqualTo(expected).Using(SgfTreeEqualityComparer.Instance)); + Assert.Equal(expected, SgfParser.ParseTree(input), SgfTreeEqualityComparer.Instance); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Properties_without_delimiter() { const string input = "(;a)"; - Assert.That(() => SgfParser.ParseTree(input), Throws.Exception); + Assert.Throws(() => SgfParser.ParseTree(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void All_lowercase_property() { const string input = "(;a[b])"; - Assert.That(() => SgfParser.ParseTree(input), Throws.Exception); + Assert.Throws(() => SgfParser.ParseTree(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Upper_and_lowercase_property() { const string input = "(;Aa[b])"; - Assert.That(() => SgfParser.ParseTree(input), Throws.Exception); + Assert.Throws(() => SgfParser.ParseTree(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Two_nodes() { const string input = "(;A[B];B[C])"; var expected = TreeWithSingleChild(CreateData("A", "B"), TreeWithNoChildren(CreateData("B", "C"))); - Assert.That(SgfParser.ParseTree(input), Is.EqualTo(expected).Using(SgfTreeEqualityComparer.Instance)); + Assert.Equal(expected, SgfParser.ParseTree(input), SgfTreeEqualityComparer.Instance); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Two_child_trees() { const string input = "(;A[B](;B[C])(;C[D]))"; @@ -105,25 +97,23 @@ public void Two_child_trees() TreeWithNoChildren(CreateData("B", "C")), TreeWithNoChildren(CreateData("C", "D")) }); - Assert.That(SgfParser.ParseTree(input), Is.EqualTo(expected).Using(SgfTreeEqualityComparer.Instance)); + Assert.Equal(expected, SgfParser.ParseTree(input), SgfTreeEqualityComparer.Instance); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Multiple_properties() { const string input = "(;A[b][c][d])"; var expected = TreeWithNoChildren(CreateData("A", "b", "c", "d")); - Assert.That(SgfParser.ParseTree(input), Is.EqualTo(expected).Using(SgfTreeEqualityComparer.Instance)); + Assert.Equal(expected, SgfParser.ParseTree(input), SgfTreeEqualityComparer.Instance); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Escaped_property() { const string input = @"(;A[\]b\nc\nd\t\te \n\]])"; var expected = TreeWithNoChildren(CreateData("A", @"]b c d e ]")); - Assert.That(SgfParser.ParseTree(input), Is.EqualTo(expected).Using(SgfTreeEqualityComparer.Instance)); + Assert.Equal(expected, SgfParser.ParseTree(input), SgfTreeEqualityComparer.Instance); } private class SgfTreeEqualityComparer : IEqualityComparer diff --git a/exercises/sieve/Sieve.cs b/exercises/sieve/Sieve.cs new file mode 100644 index 0000000000..df8f596801 --- /dev/null +++ b/exercises/sieve/Sieve.cs @@ -0,0 +1,9 @@ +using System; + +public static class Sieve +{ + public static int[] Primes(int limit) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/sieve/Sieve.csproj b/exercises/sieve/Sieve.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/sieve/Sieve.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/sieve/SieveTest.cs b/exercises/sieve/SieveTest.cs index 8b24539c6f..363232b08a 100644 --- a/exercises/sieve/SieveTest.cs +++ b/exercises/sieve/SieveTest.cs @@ -1,27 +1,23 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class SieveTest { - [Test] + [Fact] public void Finds_first_prime() { - Assert.That(Sieve.Primes(2), Is.EqualTo(new[] { 2 })); + Assert.Equal(new[] { 2 }, Sieve.Primes(2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Finds_primes_up_to_10() { - Assert.That(Sieve.Primes(10), Is.EqualTo(new[] { 2, 3, 5, 7 })); + Assert.Equal(new[] { 2, 3, 5, 7 }, Sieve.Primes(10)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Finds_primes_up_to_1000() { - Assert.That(Sieve.Primes(1000), - Is.EqualTo(new[] + Assert.Equal(new[] { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, @@ -32,6 +28,6 @@ public void Finds_primes_up_to_1000() 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997 - })); + }, Sieve.Primes(1000)); } } \ No newline at end of file diff --git a/exercises/simple-cipher/SimpleCipher.cs b/exercises/simple-cipher/SimpleCipher.cs new file mode 100644 index 0000000000..42f0460a92 --- /dev/null +++ b/exercises/simple-cipher/SimpleCipher.cs @@ -0,0 +1,32 @@ +using System; + +public class Cipher +{ + public Cipher() + { + throw new NotImplementedException("You need to implement this function."); + } + + public Cipher(string key) + { + throw new NotImplementedException("You need to implement this function."); + } + + public string Key + { + get + { + throw new NotImplementedException("You need to implement this function."); + } + } + + public string Encode(string plaintext) + { + throw new NotImplementedException("You need to implement this function."); + } + + public string Decode(string ciphertext) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/simple-cipher/SimpleCipher.csproj b/exercises/simple-cipher/SimpleCipher.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/simple-cipher/SimpleCipher.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/simple-cipher/SimpleCipherTest.cs b/exercises/simple-cipher/SimpleCipherTest.cs index 6afc801194..cc13230826 100644 --- a/exercises/simple-cipher/SimpleCipherTest.cs +++ b/exercises/simple-cipher/SimpleCipherTest.cs @@ -1,169 +1,138 @@ -using NUnit.Framework; +using System; +using Xunit; -[TestFixture] public class RandomKeyCipherTest { - private Cipher cipher; + private readonly Cipher cipher = new Cipher(); - [SetUp] - public void Setup() - { - cipher = new Cipher(); - } - - [Test] + [Fact] public void Cipher_key_is_made_of_letters() { - Assert.That(cipher.Key, Does.Match("[a-z]+")); + Assert.Matches("[a-z]+", cipher.Key); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Default_cipher_key_is_100_characters() { - Assert.That(cipher.Key, Has.Length.EqualTo(100)); + Assert.Equal(100, cipher.Key.Length); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Cipher_keys_are_randomly_generated() { - Assert.That(cipher.Key, Is.Not.EqualTo(new Cipher().Key)); + Assert.NotEqual(new Cipher().Key, cipher.Key); } // Here we take advantage of the fact that plaintext of "aaa..." doesn't output // the key. This is a critical problem with shift ciphers, some characters // will always output the key verbatim. - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Cipher_can_encode() { - Assert.That(cipher.Encode("aaaaaaaaaa"), Is.EqualTo(cipher.Key.Substring(0, 10))); + Assert.Equal(cipher.Key.Substring(0, 10), cipher.Encode("aaaaaaaaaa")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Cipher_can_decode() { - Assert.That(cipher.Decode(cipher.Key.Substring(0, 10)), Is.EqualTo("aaaaaaaaaa")); + Assert.Equal("aaaaaaaaaa", cipher.Decode(cipher.Key.Substring(0, 10))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Cipher_is_reversible() { const string PLAINTEXT = "abcdefghij"; - Assert.That(cipher.Decode(cipher.Encode(PLAINTEXT)), Is.EqualTo(PLAINTEXT)); + Assert.Equal(PLAINTEXT, cipher.Decode(cipher.Encode(PLAINTEXT))); } } -[TestFixture] + public class IncorrectKeyCipherTest { - [Ignore("Remove to run test")] - [Test] + [Fact] public void Cipher_throws_with_an_all_caps_key() { - Assert.That(() => new Cipher("ABCDEF"), Throws.ArgumentException); + Assert.Throws(() => new Cipher("ABCDEF")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Cipher_throws_with_any_caps_key() { - Assert.That(() => new Cipher("abcdEFg"), Throws.ArgumentException); + Assert.Throws(() => new Cipher("abcdEFg")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Cipher_throws_with_numeric_key() { - Assert.That(() => new Cipher("12345"), Throws.ArgumentException); + Assert.Throws(() => new Cipher("12345")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Cipher_throws_with_any_numeric_key() { - Assert.That(() => new Cipher("abcd345ef"), Throws.ArgumentException); + Assert.Throws(() => new Cipher("abcd345ef")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Cipher_throws_with_empty_key() { - Assert.That(() => new Cipher(""), Throws.ArgumentException); + Assert.Throws(() => new Cipher("")); } } -[TestFixture] + public class SubstitutionCipherTest { private const string KEY = "abcdefghij"; - private Cipher cipher; - - [Ignore("Remove to run test")] - [SetUp] - public void Setup() - { - cipher = new Cipher(KEY); - } + private readonly Cipher cipher = new Cipher(KEY); - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Cipher_keeps_the_submitted_key() { - Assert.That(cipher.Key, Is.EqualTo(KEY)); + Assert.Equal(KEY, cipher.Key); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Cipher_can_encode_with_given_key() { - Assert.That(cipher.Encode("aaaaaaaaaa"), Is.EqualTo("abcdefghij")); + Assert.Equal("abcdefghij", cipher.Encode("aaaaaaaaaa")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Cipher_can_decode_with_given_key() { - Assert.That(cipher.Decode("abcdefghij"), Is.EqualTo("aaaaaaaaaa")); + Assert.Equal("aaaaaaaaaa", cipher.Decode("abcdefghij")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Cipher_is_reversible_given_key() { const string PLAINTEXT = "abcdefghij"; - Assert.That(cipher.Decode(cipher.Encode(PLAINTEXT)), Is.EqualTo(PLAINTEXT)); + Assert.Equal(PLAINTEXT, cipher.Decode(cipher.Encode(PLAINTEXT))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Cipher_can_double_shift_encode() { const string PLAINTEXT = "iamapandabear"; - Assert.That(new Cipher(PLAINTEXT).Encode(PLAINTEXT), Is.EqualTo("qayaeaagaciai")); + Assert.Equal("qayaeaagaciai", new Cipher(PLAINTEXT).Encode(PLAINTEXT)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Cipher_can_wrap_encode() { - Assert.That(cipher.Encode("zzzzzzzzzz"), Is.EqualTo("zabcdefghi")); + Assert.Equal("zabcdefghi", cipher.Encode("zzzzzzzzzz")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Cipher_can_encode_a_message_that_is_shorter_than_the_key() { - Assert.That(cipher.Encode("aaaaa"), Is.EqualTo("abcde")); + Assert.Equal("abcde", cipher.Encode("aaaaa")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Cipher_can_decode_a_message_that_is_shorter_than_the_key() { - Assert.That(cipher.Decode("abcde"), Is.EqualTo("aaaaa")); + Assert.Equal("aaaaa", cipher.Decode("abcde")); } } \ No newline at end of file diff --git a/exercises/simple-linked-list/SimpleLinkedList.cs b/exercises/simple-linked-list/SimpleLinkedList.cs new file mode 100644 index 0000000000..5ba2da02c6 --- /dev/null +++ b/exercises/simple-linked-list/SimpleLinkedList.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +public class SimpleLinkedList : IEnumerable +{ + public SimpleLinkedList(T value) + { + throw new NotImplementedException("You need to implement this function."); + } + + public SimpleLinkedList(IEnumerable values) + { + throw new NotImplementedException("You need to implement this function."); + } + + public T Value + { + get + { + throw new NotImplementedException("You need to implement this function."); + } + } + + public SimpleLinkedList Next + { + get + { + throw new NotImplementedException("You need to implement this function."); + } + } + + public SimpleLinkedList Add(T value) + { + throw new NotImplementedException("You need to implement this function."); + } + + public IEnumerator GetEnumerator() + { + throw new NotImplementedException("You need to implement this function."); + } + + IEnumerator IEnumerable.GetEnumerator() + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/simple-linked-list/SimpleLinkedList.csproj b/exercises/simple-linked-list/SimpleLinkedList.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/simple-linked-list/SimpleLinkedList.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/simple-linked-list/SimpleLinkedListTest.cs b/exercises/simple-linked-list/SimpleLinkedListTest.cs index 802fd1d93c..293f11daa4 100644 --- a/exercises/simple-linked-list/SimpleLinkedListTest.cs +++ b/exercises/simple-linked-list/SimpleLinkedListTest.cs @@ -1,87 +1,83 @@ using System.Linq; -using NUnit.Framework; +using Xunit; public class SimpleLinkedListTest { - [Test] + [Fact] public void Single_item_list_value() { var list = new SimpleLinkedList(1); - Assert.That(list.Value, Is.EqualTo(1)); + Assert.Equal(1, list.Value); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Single_item_list_has_no_next_item() { var list = new SimpleLinkedList(1); - Assert.That(list.Next, Is.Null); + Assert.Null(list.Next); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Two_item_list_first_value() { var list = new SimpleLinkedList(2).Add(1); - Assert.That(list.Value, Is.EqualTo(2)); + Assert.Equal(2, list.Value); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Two_item_list_second_value() { var list = new SimpleLinkedList(2).Add(1); - Assert.That(list.Next.Value, Is.EqualTo(1)); + Assert.Equal(1, list.Next.Value); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Two_item_list_second_item_has_no_next() { var list = new SimpleLinkedList(2).Add(1); - Assert.That(list.Next.Next, Is.Null); + Assert.Null(list.Next.Next); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Implements_enumerable() { var values = new SimpleLinkedList(2).Add(1); - Assert.That(values, Is.EqualTo(new[] { 2, 1 })); + Assert.Equal(new[] { 2, 1 }, values); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void From_enumerable() { var list = new SimpleLinkedList(new[] { 11, 7, 5, 3, 2 }); - Assert.That(list.Value, Is.EqualTo(11)); - Assert.That(list.Next.Value, Is.EqualTo(7)); - Assert.That(list.Next.Next.Value, Is.EqualTo(5)); - Assert.That(list.Next.Next.Next.Value, Is.EqualTo(3)); - Assert.That(list.Next.Next.Next.Next.Value, Is.EqualTo(2)); + Assert.Equal(11, list.Value); + Assert.Equal(7, list.Next.Value); + Assert.Equal(5, list.Next.Next.Value); + Assert.Equal(3, list.Next.Next.Next.Value); + Assert.Equal(2, list.Next.Next.Next.Next.Value); } - [TestCase(1, Ignore = "Remove to run test case")] - [TestCase(2, Ignore = "Remove to run test case")] - [TestCase(10, Ignore = "Remove to run test case")] - [TestCase(100, Ignore = "Remove to run test case")] + [Theory(Skip = "Remove to run test")] + [InlineData(1)] + [InlineData(2)] + [InlineData(10)] + [InlineData(100)] public void Reverse(int length) { var values = Enumerable.Range(1, length).ToArray(); var list = new SimpleLinkedList(values); var reversed = list.Reverse(); - Assert.That(reversed, Is.EqualTo(values.Reverse())); + Assert.Equal(values.Reverse(), reversed); } - [TestCase(1, Ignore = "Remove to run test case")] - [TestCase(2, Ignore = "Remove to run test case")] - [TestCase(10, Ignore = "Remove to run test case")] - [TestCase(100, Ignore = "Remove to run test case")] + [Theory(Skip = "Remove to run test")] + [InlineData(1)] + [InlineData(2)] + [InlineData(10)] + [InlineData(100)] public void Roundtrip(int length) { var values = Enumerable.Range(1, length); var listValues = new SimpleLinkedList(values); - Assert.That(listValues, Is.EqualTo(values)); + Assert.Equal(values, listValues); } } \ No newline at end of file diff --git a/exercises/space-age/Example.cs b/exercises/space-age/Example.cs index dc81fb6022..cd4a95334e 100644 --- a/exercises/space-age/Example.cs +++ b/exercises/space-age/Example.cs @@ -8,67 +8,67 @@ private enum Planet Earth, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune } - public long Seconds { get; private set; } + private readonly long seconds; - private readonly Dictionary earthYearToPlanetPeriod = new Dictionary + private readonly Dictionary earthYearToPlanetPeriod = new Dictionary { { Planet.Earth, 1 }, - { Planet.Mercury, 0.2408467m }, - { Planet.Venus, 0.61519726m }, - { Planet.Mars, 1.8808158m }, - { Planet.Jupiter, 11.862615m }, - { Planet.Saturn, 29.447498m }, - { Planet.Uranus, 84.016846m }, - { Planet.Neptune, 164.79132m }, + { Planet.Mercury, 0.2408467 }, + { Planet.Venus, 0.61519726 }, + { Planet.Mars, 1.8808158 }, + { Planet.Jupiter, 11.862615 }, + { Planet.Saturn, 29.447498 }, + { Planet.Uranus, 84.016846 }, + { Planet.Neptune, 164.79132 }, }; public SpaceAge(long seconds) { - Seconds = seconds; + this.seconds = seconds; } - private decimal CalculateAge(decimal periodInEarthYears) + private double CalculateAge(double periodInEarthYears) { - const decimal EARTH_ORBIT_IN_SECONDS = 31557600; - return Math.Round(Seconds / (EARTH_ORBIT_IN_SECONDS * periodInEarthYears), 2); + const double EARTH_ORBIT_IN_SECONDS = 31557600; + return Math.Round(seconds / (EARTH_ORBIT_IN_SECONDS * periodInEarthYears), 2); } - public decimal OnEarth() + public double OnEarth() { return CalculateAge(earthYearToPlanetPeriod[Planet.Earth]); } - public decimal OnMercury() + public double OnMercury() { return CalculateAge(earthYearToPlanetPeriod[Planet.Mercury]); } - public decimal OnVenus() + public double OnVenus() { return CalculateAge(earthYearToPlanetPeriod[Planet.Venus]); } - public decimal OnMars() + public double OnMars() { return CalculateAge(earthYearToPlanetPeriod[Planet.Mars]); } - public decimal OnJupiter() + public double OnJupiter() { return CalculateAge(earthYearToPlanetPeriod[Planet.Jupiter]); } - public decimal OnSaturn() + public double OnSaturn() { return CalculateAge(earthYearToPlanetPeriod[Planet.Saturn]); } - public decimal OnUranus() + public double OnUranus() { return CalculateAge(earthYearToPlanetPeriod[Planet.Uranus]); } - public decimal OnNeptune() + public double OnNeptune() { return CalculateAge(earthYearToPlanetPeriod[Planet.Neptune]); } diff --git a/exercises/space-age/SpaceAge.cs b/exercises/space-age/SpaceAge.cs new file mode 100644 index 0000000000..d7f9ff29e8 --- /dev/null +++ b/exercises/space-age/SpaceAge.cs @@ -0,0 +1,48 @@ +using System; + +public class SpaceAge +{ + public SpaceAge(long seconds) + { + } + + public double OnEarth() + { + throw new NotImplementedException("You need to implement this function."); + } + + public double OnMercury() + { + throw new NotImplementedException("You need to implement this function."); + } + + public double OnVenus() + { + throw new NotImplementedException("You need to implement this function."); + } + + public double OnMars() + { + throw new NotImplementedException("You need to implement this function."); + } + + public double OnJupiter() + { + throw new NotImplementedException("You need to implement this function."); + } + + public double OnSaturn() + { + throw new NotImplementedException("You need to implement this function."); + } + + public double OnUranus() + { + throw new NotImplementedException("You need to implement this function."); + } + + public double OnNeptune() + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/space-age/SpaceAge.csproj b/exercises/space-age/SpaceAge.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/space-age/SpaceAge.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/space-age/SpaceAgeTest.cs b/exercises/space-age/SpaceAgeTest.cs index 38b6f093b6..498901dc33 100644 --- a/exercises/space-age/SpaceAgeTest.cs +++ b/exercises/space-age/SpaceAgeTest.cs @@ -1,84 +1,67 @@ +using Xunit; -using NUnit.Framework; - -[TestFixture] public class SpaceAgeTest { - [Test] - public void Age_in_seconds() - { - var age = new SpaceAge(1000000); - Assert.That(age.Seconds, Is.EqualTo(1000000)); - } - - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Age_on_earth() { var age = new SpaceAge(1000000000); - Assert.That(age.OnEarth(), Is.EqualTo(31.69).Within(1E-02)); + Assert.Equal(31.69, age.OnEarth()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Age_on_mercury() { var age = new SpaceAge(2134835688); - Assert.That(age.OnEarth(), Is.EqualTo(67.65).Within(1E-02)); - Assert.That(age.OnMercury(), Is.EqualTo(280.88).Within(1E-02)); + Assert.Equal(67.65, age.OnEarth()); + Assert.Equal(280.88, age.OnMercury()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Age_on_venus() { var age = new SpaceAge(189839836); - Assert.That(age.OnEarth(), Is.EqualTo(6.02).Within(1E-02)); - Assert.That(age.OnVenus(), Is.EqualTo(9.78).Within(1E-02)); + Assert.Equal(6.02, age.OnEarth()); + Assert.Equal(9.78, age.OnVenus()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Age_on_mars() { var age = new SpaceAge(2329871239); - Assert.That(age.OnEarth(), Is.EqualTo(73.83).Within(1E-02)); - Assert.That(age.OnMars(), Is.EqualTo(39.25).Within(1E-02)); + Assert.Equal(73.83, age.OnEarth()); + Assert.Equal(39.25, age.OnMars()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Age_on_jupiter() { var age = new SpaceAge(901876382); - Assert.That(age.OnEarth(), Is.EqualTo(28.58).Within(1E-02)); - Assert.That(age.OnJupiter(), Is.EqualTo(2.41).Within(1E-02)); + Assert.Equal(28.58, age.OnEarth()); + Assert.Equal(2.41, age.OnJupiter()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Age_on_saturn() { var age = new SpaceAge(3000000000); - Assert.That(age.OnEarth(), Is.EqualTo(95.06).Within(1E-02)); - Assert.That(age.OnSaturn(), Is.EqualTo(3.23).Within(1E-02)); + Assert.Equal(95.06, age.OnEarth()); + Assert.Equal(3.23, age.OnSaturn()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Age_on_uranus() { var age = new SpaceAge(3210123456); - Assert.That(age.OnEarth(), Is.EqualTo(101.72).Within(1E-02)); - Assert.That(age.OnUranus(), Is.EqualTo(1.21).Within(1E-02)); + Assert.Equal(101.72, age.OnEarth()); + Assert.Equal(1.21, age.OnUranus()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Age_on_neptune() { var age = new SpaceAge(8210123456); - Assert.That(age.OnEarth(), Is.EqualTo(260.16).Within(1E-02)); - Assert.That(age.OnNeptune(), Is.EqualTo(1.58).Within(1E-02)); + Assert.Equal(260.16, age.OnEarth()); + Assert.Equal(1.58, age.OnNeptune()); } } \ No newline at end of file diff --git a/exercises/strain/Strain.cs b/exercises/strain/Strain.cs new file mode 100644 index 0000000000..d380128092 --- /dev/null +++ b/exercises/strain/Strain.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; + +public static class Strain +{ + public static IEnumerable Keep(this IEnumerable collection, Func predicate) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static IEnumerable Discard(this IEnumerable collection, Func predicate) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/strain/Strain.csproj b/exercises/strain/Strain.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/strain/Strain.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/strain/StrainTest.cs b/exercises/strain/StrainTest.cs index 621b00bd93..6a91e8b2c9 100644 --- a/exercises/strain/StrainTest.cs +++ b/exercises/strain/StrainTest.cs @@ -1,47 +1,41 @@ using System.Collections.Generic; using System.Linq; -using NUnit.Framework; +using Xunit; -[TestFixture] public class StrainTest { - [Test] + [Fact] public void Empty_keep() { - Assert.That(new LinkedList().Keep(x => x < 10), Is.EqualTo(new LinkedList())); + Assert.Equal(new LinkedList(), new LinkedList().Keep(x => x < 10)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Keep_everything() { - Assert.That(new HashSet { 1, 2, 3 }.Keep(x => x < 10), Is.EqualTo(new HashSet { 1, 2, 3 })); + Assert.Equal(new HashSet { 1, 2, 3 }, new HashSet { 1, 2, 3 }.Keep(x => x < 10)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Keep_first_and_last() { - Assert.That(new[] { 1, 2, 3 }.Keep(x => x % 2 != 0), Is.EqualTo(new[] { 1, 3 })); + Assert.Equal(new[] { 1, 3 }, new[] { 1, 2, 3 }.Keep(x => x % 2 != 0)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Keep_neither_first_nor_last() { - Assert.That(new List { 1, 2, 3, 4, 5 }.Keep(x => x % 2 == 0), Is.EqualTo(new List { 2, 4 })); + Assert.Equal(new List { 2, 4 }, new List { 1, 2, 3, 4, 5 }.Keep(x => x % 2 == 0)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Keep_strings() { var words = "apple zebra banana zombies cherimoya zelot".Split(' '); - Assert.That(words.Keep(x => x.StartsWith("z")), Is.EqualTo("zebra zombies zelot".Split(' '))); + Assert.Equal("zebra zombies zelot".Split(' '), words.Keep(x => x.StartsWith("z"))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Keep_arrays() { var actual = new[] @@ -55,47 +49,41 @@ public void Keep_arrays() new[] { 1, 2, 5 } }; var expected = new[] { new[] { 5, 5, 5 }, new[] { 5, 1, 2 }, new[] { 1, 5, 2 }, new[] { 1, 2, 5 } }; - Assert.That(actual.Keep(x => x.Contains(5)), Is.EqualTo(expected)); + Assert.Equal(expected, actual.Keep(x => x.Contains(5))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Empty_discard() { - Assert.That(new LinkedList().Discard(x => x < 10), Is.EqualTo(new LinkedList())); + Assert.Equal(new LinkedList(), new LinkedList().Discard(x => x < 10)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Discard_nothing() { - Assert.That(new HashSet { 1, 2, 3 }.Discard(x => x > 10), Is.EqualTo(new HashSet { 1, 2, 3 })); + Assert.Equal(new HashSet { 1, 2, 3 }, new HashSet { 1, 2, 3 }.Discard(x => x > 10)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Discard_first_and_last() { - Assert.That(new[] { 1, 2, 3 }.Discard(x => x % 2 != 0), Is.EqualTo(new[] { 2 })); + Assert.Equal(new[] { 2 }, new[] { 1, 2, 3 }.Discard(x => x % 2 != 0)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Discard_neither_first_nor_last() { - Assert.That(new List { 1, 2, 3, 4, 5 }.Discard(x => x % 2 == 0), Is.EqualTo(new List { 1, 3, 5 })); + Assert.Equal(new List { 1, 3, 5 }, new List { 1, 2, 3, 4, 5 }.Discard(x => x % 2 == 0)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Discard_strings() { var words = "apple zebra banana zombies cherimoya zelot".Split(' '); - Assert.That(words.Discard(x => x.StartsWith("z")), Is.EqualTo("apple banana cherimoya".Split(' '))); + Assert.Equal("apple banana cherimoya".Split(' '), words.Discard(x => x.StartsWith("z"))); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Discard_arrays() { var actual = new[] @@ -109,6 +97,6 @@ public void Discard_arrays() new[] { 1, 2, 5 } }; var expected = new[] { new[] { 1, 2, 3 }, new[] { 2, 1, 2 }, new[] { 2, 2, 1 } }; - Assert.That(actual.Discard(x => x.Contains(5)), Is.EqualTo(expected)); + Assert.Equal(expected, actual.Discard(x => x.Contains(5))); } } \ No newline at end of file diff --git a/exercises/sublist/Sublist.cs b/exercises/sublist/Sublist.cs new file mode 100644 index 0000000000..dbf5e283d3 --- /dev/null +++ b/exercises/sublist/Sublist.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +public enum SublistType +{ + Equal, + Unequal, + Superlist, + Sublist +} + +public static class Sublist +{ + public static SublistType Classify(List list1, List list2) + where T : IComparable + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/sublist/Sublist.csproj b/exercises/sublist/Sublist.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/sublist/Sublist.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/sublist/SublistTest.cs b/exercises/sublist/SublistTest.cs index b13e40f3bc..f777937a8c 100644 --- a/exercises/sublist/SublistTest.cs +++ b/exercises/sublist/SublistTest.cs @@ -1,167 +1,150 @@ using System.Collections.Generic; using System.Linq; -using NUnit.Framework; +using Xunit; public class SublistTest { - [Test] + [Fact] public void Empty_equals_empty() { var list1 = new List(); var list2 = new List(); - Assert.That(Sublist.Classify(list1, list2), Is.EqualTo(SublistType.Equal)); + Assert.Equal(SublistType.Equal, Sublist.Classify(list1, list2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Empty_is_a_sublist_of_anything() { var list1 = new List(); var list2 = new List { 1, 2, 3, 4 }; - Assert.That(Sublist.Classify(list1, list2), Is.EqualTo(SublistType.Sublist)); + Assert.Equal(SublistType.Sublist, Sublist.Classify(list1, list2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Anything_is_a_superlist_of_empty() { var list1 = new List { 1, 2, 3, 4 }; var list2 = new List(); - Assert.That(Sublist.Classify(list1, list2), Is.EqualTo(SublistType.Superlist)); + Assert.Equal(SublistType.Superlist, Sublist.Classify(list1, list2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void One_is_not_two() { var list1 = new List { 1 }; var list2 = new List { 2 }; - Assert.That(Sublist.Classify(list1, list2), Is.EqualTo(SublistType.Unequal)); + Assert.Equal(SublistType.Unequal, Sublist.Classify(list1, list2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Compare_larger_equal_lists() { var list1 = new List(Enumerable.Repeat('x', 1000)); var list2 = new List(Enumerable.Repeat('x', 1000)); - Assert.That(Sublist.Classify(list1, list2), Is.EqualTo(SublistType.Equal)); + Assert.Equal(SublistType.Equal, Sublist.Classify(list1, list2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Sublist_at_start() { var list1 = new List { 1, 2, 3 }; var list2 = new List { 1, 2, 3, 4, 5 }; - Assert.That(Sublist.Classify(list1, list2), Is.EqualTo(SublistType.Sublist)); + Assert.Equal(SublistType.Sublist, Sublist.Classify(list1, list2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Sublist_in_middle() { var list1 = new List { 4, 3, 2 }; var list2 = new List { 5, 4, 3, 2, 1 }; - Assert.That(Sublist.Classify(list1, list2), Is.EqualTo(SublistType.Sublist)); + Assert.Equal(SublistType.Sublist, Sublist.Classify(list1, list2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Sublist_at_end() { var list1 = new List { 3, 4, 5 }; var list2 = new List { 1, 2, 3, 4, 5 }; - Assert.That(Sublist.Classify(list1, list2), Is.EqualTo(SublistType.Sublist)); + Assert.Equal(SublistType.Sublist, Sublist.Classify(list1, list2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Partially_matching_sublist_at_start() { var list1 = new List { 1, 1, 2 }; var list2 = new List { 1, 1, 1, 2 }; - Assert.That(Sublist.Classify(list1, list2), Is.EqualTo(SublistType.Sublist)); + Assert.Equal(SublistType.Sublist, Sublist.Classify(list1, list2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Sublist_early_in_huge_list() { var list1 = new List { 3, 4, 5 }; var list2 = new List(Enumerable.Range(1, 1000000)); - Assert.That(Sublist.Classify(list1, list2), Is.EqualTo(SublistType.Sublist)); + Assert.Equal(SublistType.Sublist, Sublist.Classify(list1, list2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Huge_sublist_not_in_huge_list() { var list1 = new List(Enumerable.Range(10, 1000001)); var list2 = new List(Enumerable.Range(1, 1000000)); - Assert.That(Sublist.Classify(list1, list2), Is.EqualTo(SublistType.Unequal)); + Assert.Equal(SublistType.Unequal, Sublist.Classify(list1, list2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Superlist_at_start() { var list1 = new List { 1, 2, 3, 4, 5 }; var list2 = new List { 1, 2, 3 }; - Assert.That(Sublist.Classify(list1, list2), Is.EqualTo(SublistType.Superlist)); + Assert.Equal(SublistType.Superlist, Sublist.Classify(list1, list2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Superlist_in_middle() { var list1 = new List { 5, 4, 3, 2, 1 }; var list2 = new List { 4, 3, 2 }; - Assert.That(Sublist.Classify(list1, list2), Is.EqualTo(SublistType.Superlist)); + Assert.Equal(SublistType.Superlist, Sublist.Classify(list1, list2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Superlist_at_end() { var list1 = new List { 1, 2, 3, 4, 5 }; var list2 = new List { 3, 4, 5 }; - Assert.That(Sublist.Classify(list1, list2), Is.EqualTo(SublistType.Superlist)); + Assert.Equal(SublistType.Superlist, Sublist.Classify(list1, list2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Partially_matching_superlist_at_start() { var list1 = new List { 1, 1, 1, 2 }; var list2 = new List { 1, 1, 2 }; - Assert.That(Sublist.Classify(list1, list2), Is.EqualTo(SublistType.Superlist)); + Assert.Equal(SublistType.Superlist, Sublist.Classify(list1, list2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Superlist_early_in_huge_list() { var list1 = new List(Enumerable.Range(1, 1000000)); var list2 = new List { 3, 4, 5 }; - Assert.That(Sublist.Classify(list1, list2), Is.EqualTo(SublistType.Superlist)); + Assert.Equal(SublistType.Superlist, Sublist.Classify(list1, list2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Recurring_values_sublist() { var list1 = new List { 1, 2, 1, 2, 3 }; var list2 = new List { 1, 2, 3, 1, 2, 1, 2, 3, 2, 1 }; - Assert.That(Sublist.Classify(list1, list2), Is.EqualTo(SublistType.Sublist)); + Assert.Equal(SublistType.Sublist, Sublist.Classify(list1, list2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Recurring_values_unequal() { var list1 = new List { 1, 2, 1, 2, 3 }; var list2 = new List { 1, 2, 3, 1, 2, 3, 2, 3, 2, 1 }; - Assert.That(Sublist.Classify(list1, list2), Is.EqualTo(SublistType.Unequal)); + Assert.Equal(SublistType.Unequal, Sublist.Classify(list1, list2)); } } \ No newline at end of file diff --git a/exercises/sum-of-multiples/SumOfMultiples.cs b/exercises/sum-of-multiples/SumOfMultiples.cs new file mode 100644 index 0000000000..789fc36335 --- /dev/null +++ b/exercises/sum-of-multiples/SumOfMultiples.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; + +public static class SumOfMultiples +{ + public static int To(IEnumerable multiples, int max) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/sum-of-multiples/SumOfMultiples.csproj b/exercises/sum-of-multiples/SumOfMultiples.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/sum-of-multiples/SumOfMultiples.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/sum-of-multiples/SumOfMultiplesTest.cs b/exercises/sum-of-multiples/SumOfMultiplesTest.cs index db2b6f2553..cb6c31fe64 100644 --- a/exercises/sum-of-multiples/SumOfMultiplesTest.cs +++ b/exercises/sum-of-multiples/SumOfMultiplesTest.cs @@ -1,53 +1,46 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class SumOfMultiplesTest { - [Test] + [Fact] public void Sum_to_1() { - Assert.That(SumOfMultiples.To(new[] { 3, 5 }, 1), Is.EqualTo(0)); + Assert.Equal(0, SumOfMultiples.To(new[] { 3, 5 }, 1)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Sum_to_3() { - Assert.That(SumOfMultiples.To(new[] { 3, 5 }, 4), Is.EqualTo(3)); + Assert.Equal(3, SumOfMultiples.To(new[] { 3, 5 }, 4)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Sum_to_10() { - Assert.That(SumOfMultiples.To(new[] { 3, 5 }, 10), Is.EqualTo(23)); + Assert.Equal(23, SumOfMultiples.To(new[] { 3, 5 }, 10)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Sum_to_100() { - Assert.That(SumOfMultiples.To(new[] { 3, 5 }, 100), Is.EqualTo(2318)); + Assert.Equal(2318, SumOfMultiples.To(new[] { 3, 5 }, 100)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Sum_to_1000() { - Assert.That(SumOfMultiples.To(new[] { 3, 5 }, 1000), Is.EqualTo(233168)); + Assert.Equal(233168, SumOfMultiples.To(new[] { 3, 5 }, 1000)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Sum_to_20() { - Assert.That(SumOfMultiples.To(new [] { 7, 13, 17 }, 20), Is.EqualTo(51)); + Assert.Equal(51, SumOfMultiples.To(new [] { 7, 13, 17 }, 20)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Sum_to_10000() { - Assert.That(SumOfMultiples.To(new [] { 43, 47 }, 10000), Is.EqualTo(2203160)); + Assert.Equal(2203160, SumOfMultiples.To(new [] { 43, 47 }, 10000)); } } diff --git a/exercises/tournament/Tournament.cs b/exercises/tournament/Tournament.cs new file mode 100644 index 0000000000..d80fecb431 --- /dev/null +++ b/exercises/tournament/Tournament.cs @@ -0,0 +1,10 @@ +using System; +using System.IO; + +public static class Tournament +{ + public static void Tally(Stream inStream, Stream outStream) + { + throw new NotImplementedException("You need to implement this function."); + } +} diff --git a/exercises/tournament/Tournament.csproj b/exercises/tournament/Tournament.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/tournament/Tournament.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/tournament/TournamentTest.cs b/exercises/tournament/TournamentTest.cs index 6daa4a92f6..6f7f5443a7 100644 --- a/exercises/tournament/TournamentTest.cs +++ b/exercises/tournament/TournamentTest.cs @@ -1,9 +1,8 @@ using System; using System.IO; using System.Text; -using NUnit.Framework; +using Xunit; -[TestFixture] public class TournamentTest { readonly string input1 = @@ -63,28 +62,26 @@ private string RunTally(string input) using (var outStream = new MemoryStream()) { Tournament.Tally(inStream, outStream); - return encoding.GetString(outStream.GetBuffer()); + return encoding.GetString(outStream.ToArray()); } } } - [Test] + [Fact] public void Test_good() { - Assert.That(RunTally(input1).Trim(), Is.EqualTo(expected1)); + Assert.Equal(expected1, RunTally(input1).Trim()); } - - [Test] - [Ignore("Remove to run test")] + + [Fact(Skip = "Remove to run test")] public void Test_ignore_bad_lines() { - Assert.That(RunTally(input2).Trim(), Is.EqualTo(expected2)); + Assert.Equal(expected2, RunTally(input2).Trim()); } - - [Test] - [Ignore("Remove to run test")] + + [Fact(Skip = "Remove to run test")] public void Test_incomplete_competition() { - Assert.That(RunTally(input3).Trim(), Is.EqualTo(expected3)); + Assert.Equal(expected3, RunTally(input3).Trim()); } } diff --git a/exercises/transpose/Transpose.cs b/exercises/transpose/Transpose.cs new file mode 100644 index 0000000000..36f89e4e6f --- /dev/null +++ b/exercises/transpose/Transpose.cs @@ -0,0 +1,9 @@ +using System; + +public static class Transpose +{ + public static string String(string input) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/transpose/Transpose.csproj b/exercises/transpose/Transpose.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/transpose/Transpose.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/transpose/TransposeTest.cs b/exercises/transpose/TransposeTest.cs index c039b85581..23ff1813d9 100644 --- a/exercises/transpose/TransposeTest.cs +++ b/exercises/transpose/TransposeTest.cs @@ -1,18 +1,17 @@ -using NUnit.Framework; +using Xunit; public class TransposeTest { - [Test] + [Fact] public void Empty_string() { const string input = ""; const string expected = ""; - Assert.That(Transpose.String(input), Is.EqualTo(expected)); + Assert.Equal(expected, Transpose.String(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Two_characters() { const string input = @@ -22,11 +21,10 @@ public void Two_characters() "A\n" + "1"; - Assert.That(Transpose.String(input), Is.EqualTo(expected)); + Assert.Equal(expected, Transpose.String(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Simple() { const string input = @@ -38,11 +36,10 @@ public void Simple() "B2\n" + "C3"; - Assert.That(Transpose.String(input), Is.EqualTo(expected)); + Assert.Equal(expected, Transpose.String(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Single_line() { const string input = @@ -62,11 +59,10 @@ public void Single_line() "e\n" + "."; - Assert.That(Transpose.String(input), Is.EqualTo(expected)); + Assert.Equal(expected, Transpose.String(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void First_line_longer_than_second_line() { const string input = @@ -91,11 +87,10 @@ public void First_line_longer_than_second_line() "e.\n" + "."; - Assert.That(Transpose.String(input), Is.EqualTo(expected)); + Assert.Equal(expected, Transpose.String(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Second_line_longer_than_first_line() { const string input = @@ -120,11 +115,10 @@ public void Second_line_longer_than_first_line() ".e\n" + " ."; - Assert.That(Transpose.String(input), Is.EqualTo(expected)); + Assert.Equal(expected, Transpose.String(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Square() { const string input = @@ -141,11 +135,10 @@ public void Square() "RESIN\n" + "TREND"; - Assert.That(Transpose.String(input), Is.EqualTo(expected)); + Assert.Equal(expected, Transpose.String(input)); } - [Test] - [Ignore("Remove to run test")] + [Fact(Skip = "Remove to run test")] public void Rectangle() { const string input = @@ -164,11 +157,10 @@ public void Rectangle() "RENT\n" + "EDGE"; - Assert.That(Transpose.String(input), Is.EqualTo(expected)); + Assert.Equal(expected, Transpose.String(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Triangle() { const string input = @@ -187,11 +179,10 @@ public void Triangle() " ER\n" + " R"; - Assert.That(Transpose.String(input), Is.EqualTo(expected)); + Assert.Equal(expected, Transpose.String(input)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Many_lines() { const string input = @@ -266,6 +257,6 @@ public void Many_lines() " , "; - Assert.That(Transpose.String(input), Is.EqualTo(expected)); + Assert.Equal(expected, Transpose.String(input)); } } \ No newline at end of file diff --git a/exercises/tree-building/TreeBuilding.csproj b/exercises/tree-building/TreeBuilding.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/tree-building/TreeBuilding.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/tree-building/TreeBuildingTest.cs b/exercises/tree-building/TreeBuildingTest.cs index 254c9ba7f1..d3d7016732 100644 --- a/exercises/tree-building/TreeBuildingTest.cs +++ b/exercises/tree-building/TreeBuildingTest.cs @@ -1,8 +1,9 @@ -using NUnit.Framework; +using System; +using Xunit; public class TreeBuildingTest { - [Test] + [Fact] public void One_node() { var records = new[] @@ -15,7 +16,7 @@ public void One_node() AssertTreeIsLeaf(tree, id: 0); } - [Test] + [Fact(Skip = "Remove to run test")] public void Three_nodes_in_order() { var records = new[] @@ -32,7 +33,7 @@ public void Three_nodes_in_order() AssertTreeIsLeaf(tree.Children[1], id: 2); } - [Test] + [Fact(Skip = "Remove to run test")] public void Three_nodes_in_reverse_order() { var records = new[] @@ -49,7 +50,7 @@ public void Three_nodes_in_reverse_order() AssertTreeIsLeaf(tree.Children[1], id: 2); } - [Test] + [Fact(Skip = "Remove to run test")] public void More_than_two_children() { var records = new[] @@ -68,7 +69,7 @@ public void More_than_two_children() AssertTreeIsLeaf(tree.Children[2], id: 3); } - [Test] + [Fact(Skip = "Remove to run test")] public void Binary_tree() { var records = new[] @@ -94,7 +95,7 @@ public void Binary_tree() AssertTreeIsLeaf(tree.Children[1].Children[1], id: 6); } - [Test] + [Fact(Skip = "Remove to run test")] public void Unbalanced_tree() { var records = new[] @@ -120,15 +121,15 @@ public void Unbalanced_tree() AssertTreeIsLeaf(tree.Children[1].Children[2], id: 6); } - [Test] + [Fact(Skip = "Remove to run test")] public void Empty_input() { var records = new TreeBuildingRecord[0]; - Assert.That(() => TreeBuilder.BuildTree(records), Throws.Exception); + Assert.Throws(() => TreeBuilder.BuildTree(records)); } - [Test] + [Fact(Skip = "Remove to run test")] public void Root_node_has_parent() { var records = new[] @@ -137,10 +138,10 @@ public void Root_node_has_parent() new TreeBuildingRecord { RecordId = 1, ParentId = 0 } }; - Assert.That(() => TreeBuilder.BuildTree(records), Throws.Exception); + Assert.Throws(() => TreeBuilder.BuildTree(records)); } - [Test] + [Fact(Skip = "Remove to run test")] public void No_root_node() { var records = new[] @@ -148,11 +149,11 @@ public void No_root_node() new TreeBuildingRecord { RecordId = 1, ParentId = 0 } }; - Assert.That(() => TreeBuilder.BuildTree(records), Throws.Exception); + Assert.Throws(() => TreeBuilder.BuildTree(records)); } - [Test] + [Fact(Skip = "Remove to run test")] public void Non_continuous() { var records = new[] @@ -163,10 +164,10 @@ public void Non_continuous() new TreeBuildingRecord { RecordId = 0, ParentId = 0 } }; - Assert.That(() => TreeBuilder.BuildTree(records), Throws.Exception); + Assert.Throws(() => TreeBuilder.BuildTree(records)); } - [Test] + [Fact(Skip = "Remove to run test")] public void Cycle_directly() { var records = new[] @@ -180,10 +181,10 @@ public void Cycle_directly() new TreeBuildingRecord { RecordId = 6, ParentId = 3 } }; - Assert.That(() => TreeBuilder.BuildTree(records), Throws.Exception); + Assert.Throws(() => TreeBuilder.BuildTree(records)); } - [Test] + [Fact(Skip = "Remove to run test")] public void Cycle_indirectly() { var records = new[] @@ -197,10 +198,10 @@ public void Cycle_indirectly() new TreeBuildingRecord { RecordId = 6, ParentId = 3 } }; - Assert.That(() => TreeBuilder.BuildTree(records), Throws.Exception); + Assert.Throws(() => TreeBuilder.BuildTree(records)); } - [Test] + [Fact(Skip = "Remove to run test")] public void Higher_id_parent_of_lower_id() { var records = new[] @@ -210,19 +211,19 @@ public void Higher_id_parent_of_lower_id() new TreeBuildingRecord { RecordId = 1, ParentId = 2 } }; - Assert.That(() => TreeBuilder.BuildTree(records), Throws.Exception); + Assert.Throws(() => TreeBuilder.BuildTree(records)); } private static void AssertTreeIsBranch(Tree tree, int id, int childCount) { - Assert.That(tree.Id, Is.EqualTo(id)); - Assert.That(tree.IsLeaf, Is.False); - Assert.That(tree.Children.Count, Is.EqualTo(childCount)); + Assert.Equal(id, tree.Id); + Assert.False(tree.IsLeaf); + Assert.Equal(childCount, tree.Children.Count); } private static void AssertTreeIsLeaf(Tree tree, int id) { - Assert.That(tree.Id, Is.EqualTo(id)); - Assert.That(tree.IsLeaf, Is.True); + Assert.Equal(id, tree.Id); + Assert.True(tree.IsLeaf); } } \ No newline at end of file diff --git a/exercises/triangle/Example.cs b/exercises/triangle/Example.cs index f8416c2cdb..78215581c4 100644 --- a/exercises/triangle/Example.cs +++ b/exercises/triangle/Example.cs @@ -8,7 +8,7 @@ public enum TriangleKind Scalene } -public class Triangle +public static class Triangle { public static TriangleKind Kind(decimal side1, decimal side2, decimal side3) { diff --git a/exercises/triangle/Triangle.cs b/exercises/triangle/Triangle.cs new file mode 100644 index 0000000000..69a7577a1a --- /dev/null +++ b/exercises/triangle/Triangle.cs @@ -0,0 +1,18 @@ +using System; + +public enum TriangleKind +{ + Equilateral, + Isosceles, + Scalene +} + +public static class Triangle +{ + public static TriangleKind Kind(decimal side1, decimal side2, decimal side3) + { + throw new NotImplementedException("You need to implement this function."); + } +} + +public class TriangleException : Exception { } \ No newline at end of file diff --git a/exercises/triangle/Triangle.csproj b/exercises/triangle/Triangle.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/triangle/Triangle.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/triangle/TriangleTest.cs b/exercises/triangle/TriangleTest.cs index 61a6d8be83..b8457c6379 100644 --- a/exercises/triangle/TriangleTest.cs +++ b/exercises/triangle/TriangleTest.cs @@ -1,107 +1,92 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class TriangleTest { - [Test] + [Fact] public void Equilateral_triangles_have_equal_sides() { - Assert.That(Triangle.Kind(2, 2, 2), Is.EqualTo(TriangleKind.Equilateral)); + Assert.Equal(TriangleKind.Equilateral, Triangle.Kind(2, 2, 2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Larger_equilateral_triangles_also_have_equal_sides() { - Assert.That(Triangle.Kind(10, 10, 10), Is.EqualTo(TriangleKind.Equilateral)); + Assert.Equal(TriangleKind.Equilateral, Triangle.Kind(10, 10, 10)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Isosceles_triangles_have_last_two_sides_equal() { - Assert.That(Triangle.Kind(3, 4, 4), Is.EqualTo(TriangleKind.Isosceles)); + Assert.Equal(TriangleKind.Isosceles, Triangle.Kind(3, 4, 4)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Isosceles_triangles_have_first_and_last_sides_equal() { - Assert.That(Triangle.Kind(4, 3, 4), Is.EqualTo(TriangleKind.Isosceles)); + Assert.Equal(TriangleKind.Isosceles, Triangle.Kind(4, 3, 4)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Isosceles_triangles_have_two_first_sides_equal() { - Assert.That(Triangle.Kind(4, 4, 3), Is.EqualTo(TriangleKind.Isosceles)); + Assert.Equal(TriangleKind.Isosceles, Triangle.Kind(4, 4, 3)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Isosceles_triangles_have_in_fact_exactly_two_sides_equal() { - Assert.That(Triangle.Kind(10, 10, 2), Is.EqualTo(TriangleKind.Isosceles)); + Assert.Equal(TriangleKind.Isosceles, Triangle.Kind(10, 10, 2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Scalene_triangles_have_no_equal_sides() { - Assert.That(Triangle.Kind(3, 4, 5), Is.EqualTo(TriangleKind.Scalene)); + Assert.Equal(TriangleKind.Scalene, Triangle.Kind(3, 4, 5)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Scalene_triangles_have_no_equal_sides_at_a_larger_scale_too() { - Assert.That(Triangle.Kind(10, 11, 12), Is.EqualTo(TriangleKind.Scalene)); + Assert.Equal(TriangleKind.Scalene, Triangle.Kind(10, 11, 12)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Scalene_triangles_have_no_equal_sides_in_descending_order_either() { - Assert.That(Triangle.Kind(5, 4, 2), Is.EqualTo(TriangleKind.Scalene)); + Assert.Equal(TriangleKind.Scalene, Triangle.Kind(5, 4, 2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Very_small_triangles_are_legal() { - Assert.That(Triangle.Kind(0.4m, 0.6m, 0.3m), Is.EqualTo(TriangleKind.Scalene)); + Assert.Equal(TriangleKind.Scalene, Triangle.Kind(0.4m, 0.6m, 0.3m)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Triangles_with_no_size_are_illegal() { Assert.Throws(() => Triangle.Kind(0, 0, 0)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Triangles_with_negative_sides_are_illegal() { Assert.Throws(() => Triangle.Kind(3, 4, -5)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Triangles_violating_triangle_inequality_are_illegal() { Assert.Throws(() => Triangle.Kind(1, 1, 3)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Triangles_violating_triangle_inequality_are_illegal_2() { Assert.Throws(() => Triangle.Kind(2, 4, 2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Triangles_violating_triangle_inequality_are_illegal_3() { Assert.Throws(() => Triangle.Kind(7, 3, 2)); diff --git a/exercises/twelve-days/Example.cs b/exercises/twelve-days/Example.cs index 639ebe43f7..d7f0669114 100644 --- a/exercises/twelve-days/Example.cs +++ b/exercises/twelve-days/Example.cs @@ -4,14 +4,14 @@ using System.Text; using System.Threading.Tasks; -public class TwelveDaysSong +public static class TwelveDaysSong { - public string Sing() + public static string Sing() { return Verses(1, 12); } - public string Verse(int verseNumber) + public static string Verse(int verseNumber) { switch(verseNumber) { @@ -44,7 +44,7 @@ public string Verse(int verseNumber) } } - public string Verses(int start, int end) + public static string Verses(int start, int end) { var stringBuilder = new StringBuilder(); diff --git a/exercises/twelve-days/TwelveDays.cs b/exercises/twelve-days/TwelveDays.cs new file mode 100644 index 0000000000..95204fd9dc --- /dev/null +++ b/exercises/twelve-days/TwelveDays.cs @@ -0,0 +1,19 @@ +using System; + +public static class TwelveDaysSong +{ + public static string Sing() + { + throw new NotImplementedException("You need to implement this function."); + } + + public static string Verse(int verseNumber) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static string Verses(int start, int end) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/twelve-days/TwelveDays.csproj b/exercises/twelve-days/TwelveDays.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/twelve-days/TwelveDays.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/twelve-days/TwelveDaysTest.cs b/exercises/twelve-days/TwelveDaysTest.cs index e8830e92c3..10a7bd7ea8 100644 --- a/exercises/twelve-days/TwelveDaysTest.cs +++ b/exercises/twelve-days/TwelveDaysTest.cs @@ -1,138 +1,116 @@ -using NUnit.Framework; +using Xunit; -[TestFixture] public class TwelveDaysTest { - private TwelveDaysSong twelveDaysSong; - - [SetUp] - public void Setup() - { - twelveDaysSong = new TwelveDaysSong(); - } - - [Test] + [Fact] public void Return_verse_1() { var expected = "On the first day of Christmas my true love gave to me, a Partridge in a Pear Tree.\n"; - Assert.That(twelveDaysSong.Verse(1), Is.EqualTo(expected)); + Assert.Equal(expected, TwelveDaysSong.Verse(1)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Return_verse_2() { var expected = "On the second day of Christmas my true love gave to me, two Turtle Doves, and a Partridge in a Pear Tree.\n"; - Assert.That(twelveDaysSong.Verse(2), Is.EqualTo(expected)); + Assert.Equal(expected, TwelveDaysSong.Verse(2)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Return_verse_3() { var expected = "On the third day of Christmas my true love gave to me, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n"; - Assert.That(twelveDaysSong.Verse(3), Is.EqualTo(expected)); + Assert.Equal(expected, TwelveDaysSong.Verse(3)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Return_verse_4() { var expected = "On the fourth day of Christmas my true love gave to me, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n"; - Assert.That(twelveDaysSong.Verse(4), Is.EqualTo(expected)); + Assert.Equal(expected, TwelveDaysSong.Verse(4)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Return_verse_5() { var expected = "On the fifth day of Christmas my true love gave to me, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n"; - Assert.That(twelveDaysSong.Verse(5), Is.EqualTo(expected)); + Assert.Equal(expected, TwelveDaysSong.Verse(5)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Return_verse_6() { var expected = "On the sixth day of Christmas my true love gave to me, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n"; - Assert.That(twelveDaysSong.Verse(6), Is.EqualTo(expected)); + Assert.Equal(expected, TwelveDaysSong.Verse(6)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Return_verse_7() { var expected = "On the seventh day of Christmas my true love gave to me, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n"; - Assert.That(twelveDaysSong.Verse(7), Is.EqualTo(expected)); + Assert.Equal(expected, TwelveDaysSong.Verse(7)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Return_verse_8() { var expected = "On the eighth day of Christmas my true love gave to me, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n"; - Assert.That(twelveDaysSong.Verse(8), Is.EqualTo(expected)); + Assert.Equal(expected, TwelveDaysSong.Verse(8)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Return_verse_9() { var expected = "On the ninth day of Christmas my true love gave to me, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n"; - Assert.That(twelveDaysSong.Verse(9), Is.EqualTo(expected)); + Assert.Equal(expected, TwelveDaysSong.Verse(9)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Return_verse_10() { var expected = "On the tenth day of Christmas my true love gave to me, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n"; - Assert.That(twelveDaysSong.Verse(10), Is.EqualTo(expected)); + Assert.Equal(expected, TwelveDaysSong.Verse(10)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Return_verse_11() { var expected = "On the eleventh day of Christmas my true love gave to me, eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n"; - Assert.That(twelveDaysSong.Verse(11), Is.EqualTo(expected)); + Assert.Equal(expected, TwelveDaysSong.Verse(11)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Return_verse_12() { var expected = "On the twelfth day of Christmas my true love gave to me, twelve Drummers Drumming, eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n"; - Assert.That(twelveDaysSong.Verse(12), Is.EqualTo(expected)); + Assert.Equal(expected, TwelveDaysSong.Verse(12)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Return_multiple_verses() { var expected = "On the first day of Christmas my true love gave to me, a Partridge in a Pear Tree.\n\n" + "On the second day of Christmas my true love gave to me, two Turtle Doves, and a Partridge in a Pear Tree.\n\n" + "On the third day of Christmas my true love gave to me, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n\n"; - Assert.That(twelveDaysSong.Verses(1, 3), Is.EqualTo(expected)); + Assert.Equal(expected, TwelveDaysSong.Verses(1, 3)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Return_entire_song() { - Assert.That(twelveDaysSong.Verses(1, 12), Is.EqualTo(twelveDaysSong.Sing())); + Assert.Equal(TwelveDaysSong.Sing(), TwelveDaysSong.Verses(1, 12)); } } \ No newline at end of file diff --git a/exercises/two-bucket/TwoBucket.cs b/exercises/two-bucket/TwoBucket.cs new file mode 100644 index 0000000000..144bb33a72 --- /dev/null +++ b/exercises/two-bucket/TwoBucket.cs @@ -0,0 +1,27 @@ +using System; + +public enum Bucket +{ + One, + Two +} + +public class TwoBucketResult +{ + public int Moves { get; set; } + public Bucket GoalBucket { get; set; } + public int OtherBucketContents { get; set; } +} + +public class TwoBuckets +{ + public TwoBuckets(int bucketOneSize, int bucketTwoSize, Bucket startBucket) + { + throw new NotImplementedException("You need to implement this function."); + } + + public TwoBucketResult Solve(int goal) + { + throw new NotImplementedException("You need to implement this function."); + } +} diff --git a/exercises/two-bucket/TwoBucket.csproj b/exercises/two-bucket/TwoBucket.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/two-bucket/TwoBucket.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/two-bucket/TwoBucketTest.cs b/exercises/two-bucket/TwoBucketTest.cs index dfe989e71c..438e4decd6 100644 --- a/exercises/two-bucket/TwoBucketTest.cs +++ b/exercises/two-bucket/TwoBucketTest.cs @@ -1,8 +1,8 @@ -using NUnit.Framework; +using Xunit; public class TwoBucketTest { - [Test] + [Fact] public void First_example() { var bucketOneSize = 3; @@ -13,13 +13,12 @@ public void First_example() var actual = twoBuckets.Solve(goal); - Assert.That(actual.Moves, Is.EqualTo(4)); - Assert.That(actual.GoalBucket, Is.EqualTo(Bucket.One)); - Assert.That(actual.OtherBucketContents, Is.EqualTo(5)); + Assert.Equal(4, actual.Moves); + Assert.Equal(Bucket.One, actual.GoalBucket); + Assert.Equal(5, actual.OtherBucketContents); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Second_example() { var bucketOneSize = 3; @@ -30,13 +29,12 @@ public void Second_example() var actual = twoBuckets.Solve(goal); - Assert.That(actual.Moves, Is.EqualTo(8)); - Assert.That(actual.GoalBucket, Is.EqualTo(Bucket.Two)); - Assert.That(actual.OtherBucketContents, Is.EqualTo(3)); + Assert.Equal(8, actual.Moves); + Assert.Equal(Bucket.Two, actual.GoalBucket); + Assert.Equal(3, actual.OtherBucketContents); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Third_example() { var bucketOneSize = 7; @@ -47,13 +45,12 @@ public void Third_example() var actual = twoBuckets.Solve(goal); - Assert.That(actual.Moves, Is.EqualTo(14)); - Assert.That(actual.GoalBucket, Is.EqualTo(Bucket.One)); - Assert.That(actual.OtherBucketContents, Is.EqualTo(11)); + Assert.Equal(14, actual.Moves); + Assert.Equal(Bucket.One, actual.GoalBucket); + Assert.Equal(11, actual.OtherBucketContents); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Fourth_example() { var bucketOneSize = 7; @@ -64,8 +61,8 @@ public void Fourth_example() var actual = twoBuckets.Solve(goal); - Assert.That(actual.Moves, Is.EqualTo(18)); - Assert.That(actual.GoalBucket, Is.EqualTo(Bucket.Two)); - Assert.That(actual.OtherBucketContents, Is.EqualTo(7)); + Assert.Equal(18, actual.Moves); + Assert.Equal(Bucket.Two, actual.GoalBucket); + Assert.Equal(7, actual.OtherBucketContents); } } \ No newline at end of file diff --git a/exercises/variable-length-quantity/VariableLengthQuantity.cs b/exercises/variable-length-quantity/VariableLengthQuantity.cs new file mode 100644 index 0000000000..d2404a8f08 --- /dev/null +++ b/exercises/variable-length-quantity/VariableLengthQuantity.cs @@ -0,0 +1,14 @@ +using System; + +public static class VariableLengthQuantity +{ + public static uint[] ToBytes(uint[] numbers) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static uint[] FromBytes(uint[] bytes) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/variable-length-quantity/VariableLengthQuantity.csproj b/exercises/variable-length-quantity/VariableLengthQuantity.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/variable-length-quantity/VariableLengthQuantity.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/variable-length-quantity/VariableLengthQuantityTest.cs b/exercises/variable-length-quantity/VariableLengthQuantityTest.cs index e3e94d3e2a..61ccdf92bc 100644 --- a/exercises/variable-length-quantity/VariableLengthQuantityTest.cs +++ b/exercises/variable-length-quantity/VariableLengthQuantityTest.cs @@ -1,99 +1,88 @@ -using NUnit.Framework; +using System; +using Xunit; public class VariableLengthQuantityTest { - [Test] + [Fact] public void To_single_byte() { - Assert.That(VariableLengthQuantity.ToBytes(new[] { 0x00u }), Is.EqualTo(new[] { 0x00u })); - Assert.That(VariableLengthQuantity.ToBytes(new[] { 0x40u }), Is.EqualTo(new[] { 0x40u })); - Assert.That(VariableLengthQuantity.ToBytes(new[] { 0x7fu }), Is.EqualTo(new[] { 0x7fu })); + Assert.Equal(new[] { 0x00u }, VariableLengthQuantity.ToBytes(new[] { 0x00u })); + Assert.Equal(new[] { 0x40u }, VariableLengthQuantity.ToBytes(new[] { 0x40u })); + Assert.Equal(new[] { 0x7fu }, VariableLengthQuantity.ToBytes(new[] { 0x7fu })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void To_double_byte() { - Assert.That(VariableLengthQuantity.ToBytes(new[] { 0x80u }), Is.EqualTo(new[] { 0x81u, 0x00u })); - Assert.That(VariableLengthQuantity.ToBytes(new[] { 0x2000u }), Is.EqualTo(new[] { 0xc0u, 0x00u })); - Assert.That(VariableLengthQuantity.ToBytes(new[] { 0x3fffu }), Is.EqualTo(new[] { 0xffu, 0x7fu })); + Assert.Equal(new[] { 0x81u, 0x00u }, VariableLengthQuantity.ToBytes(new[] { 0x80u })); + Assert.Equal(new[] { 0xc0u, 0x00u }, VariableLengthQuantity.ToBytes(new[] { 0x2000u })); + Assert.Equal(new[] { 0xffu, 0x7fu }, VariableLengthQuantity.ToBytes(new[] { 0x3fffu })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void To_triple_byte() { - Assert.That(VariableLengthQuantity.ToBytes(new[] { 0x4000u }), Is.EqualTo(new[] { 0x81u, 0x80u, 0x00u })); - Assert.That(VariableLengthQuantity.ToBytes(new[] { 0x100000u }), Is.EqualTo(new[] { 0xc0u, 0x80u, 0x00u })); - Assert.That(VariableLengthQuantity.ToBytes(new[] { 0x1fffffu }), Is.EqualTo(new[] { 0xffu, 0xffu, 0x7fu })); + Assert.Equal(new[] { 0x81u, 0x80u, 0x00u }, VariableLengthQuantity.ToBytes(new[] { 0x4000u })); + Assert.Equal(new[] { 0xc0u, 0x80u, 0x00u }, VariableLengthQuantity.ToBytes(new[] { 0x100000u })); + Assert.Equal(new[] { 0xffu, 0xffu, 0x7fu }, VariableLengthQuantity.ToBytes(new[] { 0x1fffffu })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void To_quadruple_byte() { - Assert.That(VariableLengthQuantity.ToBytes(new[] { 0x200000u }), Is.EqualTo(new[] { 0x81u, 0x80u, 0x80u, 0x00u })); - Assert.That(VariableLengthQuantity.ToBytes(new[] { 0x08000000u }), Is.EqualTo(new[] { 0xc0u, 0x80u, 0x80u, 0x00u })); - Assert.That(VariableLengthQuantity.ToBytes(new[] { 0x0fffffffu }), Is.EqualTo(new[] { 0xffu, 0xffu, 0xffu, 0x7fu })); + Assert.Equal(new[] { 0x81u, 0x80u, 0x80u, 0x00u }, VariableLengthQuantity.ToBytes(new[] { 0x200000u })); + Assert.Equal(new[] { 0xc0u, 0x80u, 0x80u, 0x00u }, VariableLengthQuantity.ToBytes(new[] { 0x08000000u })); + Assert.Equal(new[] { 0xffu, 0xffu, 0xffu, 0x7fu }, VariableLengthQuantity.ToBytes(new[] { 0x0fffffffu })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void To_quintuple_byte() { - Assert.That(VariableLengthQuantity.ToBytes(new[] { 0x10000000u }), Is.EqualTo(new[] { 0x81u, 0x80u, 0x80u, 0x80u, 0x00u })); - Assert.That(VariableLengthQuantity.ToBytes(new[] { 0xff000000u }), Is.EqualTo(new[] { 0x8fu, 0xf8u, 0x80u, 0x80u, 0x00u })); - Assert.That(VariableLengthQuantity.ToBytes(new[] { 0xffffffffu }), Is.EqualTo(new[] { 0x8fu, 0xffu, 0xffu, 0xffu, 0x7fu })); + Assert.Equal(new[] { 0x81u, 0x80u, 0x80u, 0x80u, 0x00u }, VariableLengthQuantity.ToBytes(new[] { 0x10000000u })); + Assert.Equal(new[] { 0x8fu, 0xf8u, 0x80u, 0x80u, 0x00u }, VariableLengthQuantity.ToBytes(new[] { 0xff000000u })); + Assert.Equal(new[] { 0x8fu, 0xffu, 0xffu, 0xffu, 0x7fu }, VariableLengthQuantity.ToBytes(new[] { 0xffffffffu })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void From_bytes() { - Assert.That(VariableLengthQuantity.FromBytes(new[] { 0x7fu }), Is.EqualTo(new[] { 0x7fu })); - Assert.That(VariableLengthQuantity.FromBytes(new[] { 0xc0u, 0x00u }), Is.EqualTo(new[] { 0x2000u })); - Assert.That(VariableLengthQuantity.FromBytes(new[] { 0xffu, 0xffu, 0x7fu }), Is.EqualTo(new[] { 0x1fffffu })); - Assert.That(VariableLengthQuantity.FromBytes(new[] { 0x81u, 0x80u, 0x80u, 0x00u }), Is.EqualTo(new[] { 0x200000u })); - Assert.That(VariableLengthQuantity.FromBytes(new[] { 0x8fu, 0xffu, 0xffu, 0xffu, 0x7fu }), Is.EqualTo(new[] { 0xffffffffu })); + Assert.Equal(new[] { 0x7fu }, VariableLengthQuantity.FromBytes(new[] { 0x7fu })); + Assert.Equal(new[] { 0x2000u }, VariableLengthQuantity.FromBytes(new[] { 0xc0u, 0x00u })); + Assert.Equal(new[] { 0x1fffffu }, VariableLengthQuantity.FromBytes(new[] { 0xffu, 0xffu, 0x7fu })); + Assert.Equal(new[] { 0x200000u }, VariableLengthQuantity.FromBytes(new[] { 0x81u, 0x80u, 0x80u, 0x00u })); + Assert.Equal(new[] { 0xffffffffu }, VariableLengthQuantity.FromBytes(new[] { 0x8fu, 0xffu, 0xffu, 0xffu, 0x7fu })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void To_bytes_multiple_values() { - Assert.That(VariableLengthQuantity.ToBytes(new[] { 0x40u, 0x7fu }), Is.EqualTo(new[] { 0x40u, 0x7fu })); - Assert.That(VariableLengthQuantity.ToBytes(new[] { 0x4000u, 0x123456u }), Is.EqualTo(new[] { 0x81u, 0x80u, 0x00u, 0xc8u, 0xe8u, 0x56u })); - Assert.That(VariableLengthQuantity.ToBytes(new[] { 0x2000u, 0x123456u, 0x0fffffffu, 0x00u, 0x3fffu, 0x4000u }), - Is.EqualTo(new[] { 0xc0u, 0x00u, 0xc8u, 0xe8u, 0x56u, 0xffu, 0xffu, 0xffu, 0x7fu, 0x00u, 0xffu, 0x7fu, 0x81u, 0x80u, 0x00u })); + Assert.Equal(new[] { 0x40u, 0x7fu }, VariableLengthQuantity.ToBytes(new[] { 0x40u, 0x7fu })); + Assert.Equal(new[] { 0x81u, 0x80u, 0x00u, 0xc8u, 0xe8u, 0x56u }, VariableLengthQuantity.ToBytes(new[] { 0x4000u, 0x123456u })); + Assert.Equal(new[] { 0xc0u, 0x00u, 0xc8u, 0xe8u, 0x56u, 0xffu, 0xffu, 0xffu, 0x7fu, 0x00u, 0xffu, 0x7fu, 0x81u, 0x80u, 0x00u }, VariableLengthQuantity.ToBytes(new[] { 0x2000u, 0x123456u, 0x0fffffffu, 0x00u, 0x3fffu, 0x4000u })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void From_bytes_multiple_values() { - Assert.That(VariableLengthQuantity.FromBytes(new[] { 0xc0u, 0x00u, 0xc8u, 0xe8u, 0x56u, 0xffu, 0xffu, 0xffu, 0x7fu, 0x00u, 0xffu, 0x7fu, 0x81u, 0x80u, 0x00u }), - Is.EqualTo(new[] { 0x2000u, 0x123456u, 0x0fffffffu, 0x00u, 0x3fffu, 0x4000u })); + Assert.Equal(new[] { 0x2000u, 0x123456u, 0x0fffffffu, 0x00u, 0x3fffu, 0x4000u }, VariableLengthQuantity.FromBytes(new[] { 0xc0u, 0x00u, 0xc8u, 0xe8u, 0x56u, 0xffu, 0xffu, 0xffu, 0x7fu, 0x00u, 0xffu, 0x7fu, 0x81u, 0x80u, 0x00u })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Incomplete_byte_sequence() { - Assert.That(() => VariableLengthQuantity.FromBytes(new[] { 0xffu }), Throws.Exception); + Assert.Throws(() => VariableLengthQuantity.FromBytes(new[] { 0xffu })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Overflow() { - Assert.That(() => VariableLengthQuantity.FromBytes(new[] { 0xffu, 0xffu, 0xffu, 0xffu, 0x7fu }), Throws.Exception); + Assert.Throws(() => VariableLengthQuantity.FromBytes(new[] { 0xffu, 0xffu, 0xffu, 0xffu, 0x7fu })); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Chained_execution_is_identity() { var test = new[] { 0xf2u, 0xf6u, 0x96u, 0x9cu, 0x3bu, 0x39u, 0x2eu, 0x30u, 0xb3u, 0x24u }; - Assert.That(VariableLengthQuantity.FromBytes(VariableLengthQuantity.ToBytes(test)), Is.EquivalentTo(test)); + Assert.Equal(test, VariableLengthQuantity.FromBytes(VariableLengthQuantity.ToBytes(test))); } } \ No newline at end of file diff --git a/exercises/word-count/Example.cs b/exercises/word-count/Example.cs index 91f1295b01..30a37bf919 100644 --- a/exercises/word-count/Example.cs +++ b/exercises/word-count/Example.cs @@ -2,7 +2,7 @@ using System.Text.RegularExpressions; using System.Collections.Generic; -public class Phrase +public static class Phrase { public static IDictionary WordCount(string phrase) { diff --git a/exercises/word-count/WordCount.cs b/exercises/word-count/WordCount.cs new file mode 100644 index 0000000000..42214c7db0 --- /dev/null +++ b/exercises/word-count/WordCount.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; + +public static class Phrase +{ + public static IDictionary WordCount(string phrase) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/word-count/WordCount.csproj b/exercises/word-count/WordCount.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/word-count/WordCount.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/word-count/WordCountTest.cs b/exercises/word-count/WordCountTest.cs index 06cb02490c..5295ccd724 100644 --- a/exercises/word-count/WordCountTest.cs +++ b/exercises/word-count/WordCountTest.cs @@ -1,21 +1,19 @@ using System.Collections.Generic; -using NUnit.Framework; +using Xunit; -[TestFixture] public class WordCountTest { - [Test] + [Fact] public void Count_one_word() { var counts = new Dictionary { { "word", 1 } }; - Assert.That(Phrase.WordCount("word"), Is.EqualTo(counts)); + Assert.Equal(counts, Phrase.WordCount("word")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Count_one_of_each() { var counts = new Dictionary { @@ -24,11 +22,10 @@ public void Count_one_of_each() { "each", 1 } }; - Assert.That(Phrase.WordCount("one of each"), Is.EqualTo(counts)); + Assert.Equal(counts, Phrase.WordCount("one of each")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Count_multiple_occurrences() { var counts = new Dictionary { @@ -39,11 +36,10 @@ public void Count_multiple_occurrences() { "blue", 1 }, }; - Assert.That(Phrase.WordCount("one fish two fish red fish blue fish"), Is.EqualTo(counts)); + Assert.Equal(counts, Phrase.WordCount("one fish two fish red fish blue fish")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Count_everything_just_once() { var counts = new Dictionary { @@ -55,11 +51,10 @@ public void Count_everything_just_once() { "men", 1 }, }; - Assert.That(Phrase.WordCount("all the kings horses and all the kings men"), Is.EqualTo(counts)); + Assert.Equal(counts, Phrase.WordCount("all the kings horses and all the kings men")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Ignore_punctuation() { var counts = new Dictionary { @@ -70,11 +65,10 @@ public void Ignore_punctuation() { "javascript", 1 }, }; - Assert.That(Phrase.WordCount("car : carpet as java : javascript!!&@$%^&"), Is.EqualTo(counts)); + Assert.Equal(counts, Phrase.WordCount("car : carpet as java : javascript!!&@$%^&")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Handles_cramped_list() { var counts = new Dictionary { @@ -83,11 +77,10 @@ public void Handles_cramped_list() { "three", 1 }, }; - Assert.That(Phrase.WordCount("one,two,three"), Is.EqualTo(counts)); + Assert.Equal(counts, Phrase.WordCount("one,two,three")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Include_numbers() { var counts = new Dictionary { @@ -96,22 +89,20 @@ public void Include_numbers() { "2", 1 }, }; - Assert.That(Phrase.WordCount("testing, 1, 2 testing"), Is.EqualTo(counts)); + Assert.Equal(counts, Phrase.WordCount("testing, 1, 2 testing")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Normalize_case() { var counts = new Dictionary { { "go", 3 }, }; - Assert.That(Phrase.WordCount("go Go GO"), Is.EqualTo(counts)); + Assert.Equal(counts, Phrase.WordCount("go Go GO")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void With_apostrophes() { var counts = new Dictionary { @@ -122,22 +113,20 @@ public void With_apostrophes() { "cry", 1 }, }; - Assert.That(Phrase.WordCount("First: don't laugh. Then: don't cry."), Is.EqualTo(counts)); + Assert.Equal(counts, Phrase.WordCount("First: don't laugh. Then: don't cry.")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void With_free_standing_apostrophes() { var counts = new Dictionary { { "go", 3 }, }; - Assert.That(Phrase.WordCount("go ' Go '' GO"), Is.EqualTo(counts)); + Assert.Equal(counts, Phrase.WordCount("go ' Go '' GO")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void With_apostrophes_as_quotes() { var counts = new Dictionary { @@ -150,7 +139,7 @@ public void With_apostrophes_as_quotes() { "o'clock", 1 }, }; - Assert.That(Phrase.WordCount("She said, 'let's meet at twelve o'clock'"), Is.EqualTo(counts)); + Assert.Equal(counts, Phrase.WordCount("She said, 'let's meet at twelve o'clock'")); } } \ No newline at end of file diff --git a/exercises/word-search/Example.cs b/exercises/word-search/Example.cs index b3a5b4113d..a084b702b3 100644 --- a/exercises/word-search/Example.cs +++ b/exercises/word-search/Example.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Drawing; using System.Linq; public class WordSearch @@ -9,16 +8,16 @@ public class WordSearch private readonly int width; private readonly int height; - private static readonly Point[] Directions = + private static readonly Tuple[] Directions = { - new Point( 1, 0), - new Point( 0, 1), - new Point(-1, 0), - new Point( 0, -1), - new Point( 1, 1), - new Point( 1, -1), - new Point(-1, 1), - new Point(-1, -1) + new Tuple( 1, 0), + new Tuple( 0, 1), + new Tuple(-1, 0), + new Tuple( 0, -1), + new Tuple( 1, 1), + new Tuple( 1, -1), + new Tuple(-1, 1), + new Tuple(-1, -1) }; public WordSearch(string puzzle) @@ -28,7 +27,7 @@ public WordSearch(string puzzle) height = rows.Length; } - public Tuple Find(string word) + public Tuple, Tuple> Find(string word) { return Positions() @@ -36,7 +35,7 @@ public Tuple Find(string word) .FirstOrDefault(); } - private IEnumerable> Find(string word, Point position, Point direction) + private IEnumerable, Tuple>> Find(string word, Tuple position, Tuple direction) { var current = position; @@ -47,26 +46,25 @@ private IEnumerable> Find(string word, Point position, Point yield break; } - current.X += direction.X; - current.Y += direction.Y; + current = new Tuple(current.Item1 + direction.Item1, current.Item2 + direction.Item2); } - yield return Tuple.Create(position, new Point(current.X - direction.X, current.Y - direction.Y)); + yield return Tuple.Create(position, new Tuple(current.Item1 - direction.Item1, current.Item2 - direction.Item2)); } - private char? FindChar(Point coordinate) + private char? FindChar(Tuple coordinate) { - if (coordinate.X > 0 && coordinate.X <= width && coordinate.Y > 0 && coordinate.Y <= height) + if (coordinate.Item1 > 0 && coordinate.Item1 <= width && coordinate.Item2 > 0 && coordinate.Item2 <= height) { - return rows[coordinate.Y - 1][coordinate.X - 1]; + return rows[coordinate.Item2 - 1][coordinate.Item1 - 1]; } return null; } - private IEnumerable Positions() + private IEnumerable> Positions() { return Enumerable.Range(1, width).SelectMany(x => - Enumerable.Range(1, height).Select(y =>new Point(x, y))); + Enumerable.Range(1, height).Select(y => new Tuple(x, y))); } } \ No newline at end of file diff --git a/exercises/word-search/WordSearch.cs b/exercises/word-search/WordSearch.cs new file mode 100644 index 0000000000..8abe18f9e8 --- /dev/null +++ b/exercises/word-search/WordSearch.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +public class WordSearch +{ + public WordSearch(string puzzle) + { + throw new NotImplementedException("You need to implement this function."); + } + + public Tuple, Tuple> Find(string word) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/word-search/WordSearch.csproj b/exercises/word-search/WordSearch.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/word-search/WordSearch.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/word-search/WordSearchTest.cs b/exercises/word-search/WordSearchTest.cs index 6a82c8bc16..18a57e1f41 100644 --- a/exercises/word-search/WordSearchTest.cs +++ b/exercises/word-search/WordSearchTest.cs @@ -1,6 +1,5 @@ using System; -using System.Drawing; -using NUnit.Framework; +using Xunit; public class WordSearchTest { @@ -16,88 +15,87 @@ public class WordSearchTest "jalaycalmp\n" + "clojurermt"; - [Test] + [Fact] public void Should_find_horizontal_words_written_left_to_right() { var wordSearch = new WordSearch(Puzzle); var actual = wordSearch.Find("clojure"); - Assert.That(actual, Is.EqualTo(Tuple.Create(new Point(1, 10), new Point(7, 10)))); + Assert.Equal(new Tuple(1, 10), actual.Item1); + Assert.Equal(new Tuple(7, 10), actual.Item2); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Should_find_horizontal_words_written_right_to_left() { var wordSearch = new WordSearch(Puzzle); var actual = wordSearch.Find("elixir"); - Assert.That(actual, Is.EqualTo(Tuple.Create(new Point(6, 5), new Point(1, 5)))); + Assert.Equal(new Tuple(6, 5), actual.Item1); + Assert.Equal(new Tuple(1, 5), actual.Item2); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Should_find_vertical_words_written_top_to_bottom() { var wordSearch = new WordSearch(Puzzle); var actual = wordSearch.Find("ecmascript"); - Assert.That(actual, Is.EqualTo(Tuple.Create(new Point(10, 1), new Point(10, 10)))); + Assert.Equal(new Tuple(10, 1), actual.Item1); + Assert.Equal(new Tuple(10, 10), actual.Item2); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Should_find_vertical_words_written_bottom_to_top() { var wordSearch = new WordSearch(Puzzle); var actual = wordSearch.Find("rust"); - Assert.That(actual, Is.EqualTo(Tuple.Create(new Point(9, 5), new Point(9, 2)))); + Assert.Equal(new Tuple(9, 5), actual.Item1); + Assert.Equal(new Tuple(9, 2), actual.Item2); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Should_find_diagonal_words_written_top_left_to_bottom_right() { var wordSearch = new WordSearch(Puzzle); var actual = wordSearch.Find("java"); - Assert.That(actual, Is.EqualTo(Tuple.Create(new Point(1, 1), new Point(4, 4)))); + Assert.Equal(new Tuple(1, 1), actual.Item1); + Assert.Equal(new Tuple(4, 4), actual.Item2); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Should_find_diagonal_upper_written_bottom_right_to_top_left() { var wordSearch = new WordSearch(Puzzle); var actual = wordSearch.Find("lua"); - Assert.That(actual, Is.EqualTo(Tuple.Create(new Point(8, 9), new Point(6, 7)))); + Assert.Equal(new Tuple(8, 9), actual.Item1); + Assert.Equal(new Tuple(6, 7), actual.Item2); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Should_find_diagonal_upper_written_bottom_left_to_top_right() { var wordSearch = new WordSearch(Puzzle); var actual = wordSearch.Find("lisp"); - Assert.That(actual, Is.EqualTo(Tuple.Create(new Point(3, 6), new Point(6, 3)))); + Assert.Equal(new Tuple(3, 6), actual.Item1); + Assert.Equal(new Tuple(6, 3), actual.Item2); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Should_find_diagonal_upper_written_top_right_to_bottom_left() { var wordSearch = new WordSearch(Puzzle); var actual = wordSearch.Find("ruby"); - Assert.That(actual, Is.EqualTo(Tuple.Create(new Point(8, 6), new Point(5, 9)))); + Assert.Equal(new Tuple(8, 6), actual.Item1); + Assert.Equal(new Tuple(5, 9), actual.Item2); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Should_not_find_words_that_are_not_in_the_puzzle() { var wordSearch = new WordSearch(Puzzle); var actual = wordSearch.Find("haskell"); - Assert.That(actual, Is.Null); + Assert.Null(actual); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Should_be_able_to_search_differently_sized_puzzles() { const string differentSizePuzzle = @@ -107,6 +105,7 @@ public void Should_be_able_to_search_differently_sized_puzzles() var wordSearch = new WordSearch(differentSizePuzzle); var actual = wordSearch.Find("exercism"); - Assert.That(actual, Is.EqualTo(Tuple.Create(new Point(11, 2), new Point(4, 2)))); + Assert.Equal(new Tuple(11, 2), actual.Item1); + Assert.Equal(new Tuple(4, 2), actual.Item2); } } \ No newline at end of file diff --git a/exercises/wordy/Example.cs b/exercises/wordy/Example.cs index 36865936c4..c6b4a0d4d5 100644 --- a/exercises/wordy/Example.cs +++ b/exercises/wordy/Example.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text.RegularExpressions; -public class WordProblem +public static class WordProblem { private static readonly Regex VariableAndOperatorGroupsRegex = new Regex(string.Format(@"{0} {1} {0}\s*{1}*\s*{0}*", @"(-?\d+)", "(plus|minus|multiplied by|divided by)")); diff --git a/exercises/wordy/Wordy.cs b/exercises/wordy/Wordy.cs new file mode 100644 index 0000000000..cdb4c52037 --- /dev/null +++ b/exercises/wordy/Wordy.cs @@ -0,0 +1,9 @@ +using System; + +public static class WordProblem +{ + public static int Solve(string problem) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/wordy/Wordy.csproj b/exercises/wordy/Wordy.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/wordy/Wordy.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/wordy/WordyTest.cs b/exercises/wordy/WordyTest.cs index 559cfc7258..7ea2281cac 100644 --- a/exercises/wordy/WordyTest.cs +++ b/exercises/wordy/WordyTest.cs @@ -1,116 +1,101 @@ -using NUnit.Framework; +using System; +using Xunit; -[TestFixture] public class WordProblemTest { - [Test] + [Fact] public void Can_parse_and_solve_addition_problems() { - Assert.That(WordProblem.Solve("What is 1 plus 1?"), Is.EqualTo(2)); + Assert.Equal(2, WordProblem.Solve("What is 1 plus 1?")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_add_double_digit_numbers() { - Assert.That(WordProblem.Solve("What is 53 plus 2?"), Is.EqualTo(55)); + Assert.Equal(55, WordProblem.Solve("What is 53 plus 2?")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_add_negative_numbers() { - Assert.That(WordProblem.Solve("What is -1 plus -10?"), Is.EqualTo(-11)); + Assert.Equal(-11, WordProblem.Solve("What is -1 plus -10?")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_add_large_numbers() { - Assert.That(WordProblem.Solve("What is 123 plus 45678?"), Is.EqualTo(45801)); + Assert.Equal(45801, WordProblem.Solve("What is 123 plus 45678?")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_parse_and_solve_subtraction_problems() { - Assert.That(WordProblem.Solve("What is 4 minus -12"), Is.EqualTo(16)); + Assert.Equal(16, WordProblem.Solve("What is 4 minus -12")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_parse_and_solve_multiplication_problems() { - Assert.That(WordProblem.Solve("What is -3 multiplied by 25?"), Is.EqualTo(-75)); + Assert.Equal(-75, WordProblem.Solve("What is -3 multiplied by 25?")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_parse_and_solve_division_problems() { - Assert.That(WordProblem.Solve("What is 33 divided by -3?"), Is.EqualTo(-11)); + Assert.Equal(-11, WordProblem.Solve("What is 33 divided by -3?")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_add_twice() { - Assert.That(WordProblem.Solve("What is 1 plus 1 plus 1?"), Is.EqualTo(3)); + Assert.Equal(3, WordProblem.Solve("What is 1 plus 1 plus 1?")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_add_then_subtract() { - Assert.That(WordProblem.Solve("What is 1 plus 5 minus -2?"), Is.EqualTo(8)); + Assert.Equal(8, WordProblem.Solve("What is 1 plus 5 minus -2?")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_subtract_twice() { - Assert.That(WordProblem.Solve("What is 20 minus 4 minus 13?"), Is.EqualTo(3)); + Assert.Equal(3, WordProblem.Solve("What is 20 minus 4 minus 13?")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_subtract_then_add() { - Assert.That(WordProblem.Solve("What is 17 minus 6 plus 3?"), Is.EqualTo(14)); + Assert.Equal(14, WordProblem.Solve("What is 17 minus 6 plus 3?")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_multiply_twice() { - Assert.That(WordProblem.Solve("What is 2 multiplied by -2 multiplied by 3?"), Is.EqualTo(-12)); + Assert.Equal(-12, WordProblem.Solve("What is 2 multiplied by -2 multiplied by 3?")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_add_then_multiply() { - Assert.That(WordProblem.Solve("What is -3 plus 7 multiplied by -2?"), Is.EqualTo(-8)); + Assert.Equal(-8, WordProblem.Solve("What is -3 plus 7 multiplied by -2?")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Can_divide_twice() { - Assert.That(WordProblem.Solve("What is -12 divided by 2 divided by -3?"), Is.EqualTo(2)); + Assert.Equal(2, WordProblem.Solve("What is -12 divided by 2 divided by -3?")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Cubed_is_too_advanced() { - Assert.That(() => WordProblem.Solve("What is 53 cubed?"), Throws.ArgumentException); + Assert.Throws(() => WordProblem.Solve("What is 53 cubed?")); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Irrelevant_problems_are_not_valid() { - Assert.That(() => WordProblem.Solve("Who is the president of the United States?"), Throws.ArgumentException); + Assert.Throws(() => WordProblem.Solve("Who is the president of the United States?")); } } diff --git a/exercises/zebra-puzzle/ZebraPuzzle.cs b/exercises/zebra-puzzle/ZebraPuzzle.cs new file mode 100644 index 0000000000..aa0aefd21c --- /dev/null +++ b/exercises/zebra-puzzle/ZebraPuzzle.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +public enum Color { Red , Green , Ivory , Yellow , Blue } +public enum Nationality { Englishman , Spaniard , Ukranian , Japanese , Norwegian } +public enum Pet { Dog , Snails , Fox , Horse , Zebra } +public enum Drink { Coffee , Tea , Milk , OrangeJuice , Water } +public enum Smoke { OldGold , Kools , Chesterfields , LuckyStrike , Parliaments } + +public static class ZebraPuzzle +{ + public static Nationality WhoDrinks(Drink drink) + { + throw new NotImplementedException("You need to implement this function."); + } + + public static Nationality WhoOwns(Pet pet) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/zebra-puzzle/ZebraPuzzle.csproj b/exercises/zebra-puzzle/ZebraPuzzle.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/zebra-puzzle/ZebraPuzzle.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/zebra-puzzle/ZebraPuzzleTest.cs b/exercises/zebra-puzzle/ZebraPuzzleTest.cs index 10f45d9a86..6cde1b2c2f 100644 --- a/exercises/zebra-puzzle/ZebraPuzzleTest.cs +++ b/exercises/zebra-puzzle/ZebraPuzzleTest.cs @@ -1,17 +1,16 @@ -using NUnit.Framework; +using Xunit; public class ZebraPuzzleTest { - [Test] + [Fact] public void Who_drinks_water() { - Assert.That(ZebraPuzzle.WhoDrinks(Drink.Water), Is.EqualTo(Nationality.Norwegian)); + Assert.Equal(Nationality.Norwegian, ZebraPuzzle.WhoDrinks(Drink.Water)); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Who_owns_the_zebra() { - Assert.That(ZebraPuzzle.WhoOwns(Pet.Zebra), Is.EqualTo(Nationality.Japanese)); + Assert.Equal(Nationality.Japanese, ZebraPuzzle.WhoOwns(Pet.Zebra)); } } \ No newline at end of file diff --git a/exercises/zipper/Zipper.cs b/exercises/zipper/Zipper.cs new file mode 100644 index 0000000000..d7e1ee5626 --- /dev/null +++ b/exercises/zipper/Zipper.cs @@ -0,0 +1,64 @@ +using System; + +public class BinTree +{ + public BinTree(T value, BinTree left, BinTree right) + { + throw new NotImplementedException("You need to implement this function."); + } + + public T Value { get; } + public BinTree Left { get; } + public BinTree Right { get; } +} + +public class Zipper +{ + public T Value + { + get + { + throw new NotImplementedException("You need to implement this function."); + } + } + + public Zipper SetValue(T newValue) + { + throw new NotImplementedException("You need to implement this function."); + } + + public Zipper SetLeft(BinTree binTree) + { + throw new NotImplementedException("You need to implement this function."); + } + + public Zipper SetRight(BinTree binTree) + { + throw new NotImplementedException("You need to implement this function."); + } + + public Zipper Left() + { + throw new NotImplementedException("You need to implement this function."); + } + + public Zipper Right() + { + throw new NotImplementedException("You need to implement this function."); + } + + public Zipper Up() + { + throw new NotImplementedException("You need to implement this function."); + } + + public BinTree ToTree() + { + throw new NotImplementedException("You need to implement this function."); + } + + public static Zipper FromTree(BinTree tree) + { + throw new NotImplementedException("You need to implement this function."); + } +} \ No newline at end of file diff --git a/exercises/zipper/Zipper.csproj b/exercises/zipper/Zipper.csproj new file mode 100644 index 0000000000..51531edfd8 --- /dev/null +++ b/exercises/zipper/Zipper.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + diff --git a/exercises/zipper/ZipperTest.cs b/exercises/zipper/ZipperTest.cs index feeed02c84..2bb6dbcda5 100644 --- a/exercises/zipper/ZipperTest.cs +++ b/exercises/zipper/ZipperTest.cs @@ -1,83 +1,85 @@ -using NUnit.Framework; +using Xunit; public class ZipperTest { private static BinTree bt(int v, BinTree l, BinTree r) => new BinTree(v, l, r); private static BinTree leaf(int v) => bt(v, null, null); - private static readonly BinTree empty = null; - private static readonly BinTree t1 = new BinTree(1, bt(2, empty, leaf(3)), leaf(4)); - private static readonly BinTree t2 = new BinTree(1, bt(5, empty, leaf(3)), leaf(4)); - private static readonly BinTree t3 = new BinTree(1, bt(2, leaf(5), leaf(3)), leaf(4)); - private static readonly BinTree t4 = new BinTree(1, leaf(2), leaf(4)); + private readonly BinTree empty; + private readonly BinTree t1; + private readonly BinTree t2; + private readonly BinTree t3; + private readonly BinTree t4; - [Test] + public ZipperTest() + { + empty = null; + t1 = new BinTree(1, bt(2, empty, leaf(3)), leaf(4)); + t2 = new BinTree(1, bt(5, empty, leaf(3)), leaf(4)); + t3 = new BinTree(1, bt(2, leaf(5), leaf(3)), leaf(4)); + t4 = new BinTree(1, leaf(2), leaf(4)); + } + + [Fact] public void Data_is_retained() { var zipper = Zipper.FromTree(t1); var tree = zipper.ToTree(); - Assert.That(tree, Is.EqualTo(t1)); + Assert.Equal(t1, tree); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Left_right_and_value() { var zipper = Zipper.FromTree(t1); - Assert.That(zipper.Left().Right().Value, Is.EqualTo(3)); + Assert.Equal(3, zipper.Left().Right().Value); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Dead_end() { var zipper = Zipper.FromTree(t1); - Assert.That(zipper.Left().Left(), Is.Null); + Assert.Null(zipper.Left().Left()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Tree_from_deep_focus() { var zipper = Zipper.FromTree(t1); - Assert.That(zipper.Left().Right().ToTree(), Is.EqualTo(t1)); + Assert.Equal(t1, zipper.Left().Right().ToTree()); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Set_value() { var zipper = Zipper.FromTree(t1); var updatedZipper = zipper.Left().SetValue(5); var tree = updatedZipper.ToTree(); - Assert.That(tree, Is.EqualTo(t2)); + Assert.Equal(t2, tree); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Set_left_with_value() { var zipper = Zipper.FromTree(t1); var updatedZipper = zipper.Left().SetLeft(new BinTree(5, null, null)); var tree = updatedZipper.ToTree(); - Assert.That(tree, Is.EqualTo(t3)); + Assert.Equal(t3, tree); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Set_right_to_null() { var zipper = Zipper.FromTree(t1); var updatedZipper = zipper.Left().SetRight(null); var tree = updatedZipper.ToTree(); - Assert.That(tree, Is.EqualTo(t4)); + Assert.Equal(t4, tree); } - [Ignore("Remove to run test")] - [Test] + [Fact(Skip = "Remove to run test")] public void Different_paths_to_same_zipper() { var zipper = Zipper.FromTree(t1); - Assert.That(zipper.Left().Up().Right().ToTree(), Is.EqualTo(zipper.Right().ToTree())); + Assert.Equal(zipper.Right().ToTree(), zipper.Left().Up().Right().ToTree()); } } diff --git a/paket.dependencies b/paket.dependencies index f0d9b2cfbd..4a6f5f8052 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -1,6 +1,2 @@ source https://www.nuget.org/api/v2/ -nuget FAKE -nuget NUnit -nuget NUnit.ConsoleRunner -nuget Sprache -github nunit/nunit-transforms nunit3-junit/nunit3-junit.xslt \ No newline at end of file +nuget FAKE \ No newline at end of file diff --git a/paket.lock b/paket.lock index a5c07c45eb..63936acc9f 100644 --- a/paket.lock +++ b/paket.lock @@ -1,80 +1,3 @@ NUGET remote: https://www.nuget.org/api/v2 - FAKE (4.37.2) - Microsoft.NETCore.Platforms (1.0.1) - framework: netstandard10, >= netstandard12 - Microsoft.NETCore.Targets (1.0.1) - framework: netstandard10, >= netstandard12 - NUnit (3.4.1) - NUnit.ConsoleRunner (3.4.1) - Sprache (2.1) - System.Globalization (>= 4.0.11) - framework: >= netstandard10 - System.Linq (>= 4.1) - framework: >= netstandard10 - System.Runtime (>= 4.1) - framework: >= netstandard10 - System.Text.RegularExpressions (>= 4.1) - framework: >= netstandard10 - System.Collections (4.0.11) - framework: netstandard10, >= netstandard16 - Microsoft.NETCore.Platforms (>= 1.0.1) - framework: dnxcore50, netstandard10, >= netstandard13 - Microsoft.NETCore.Targets (>= 1.0.1) - framework: dnxcore50, netstandard10, >= netstandard13 - System.Runtime (>= 4.1) - framework: dnxcore50, netstandard10, >= netstandard13 - System.Diagnostics.Debug (4.0.11) - framework: >= netstandard16 - Microsoft.NETCore.Platforms (>= 1.0.1) - framework: dnxcore50, netstandard10, >= netstandard13 - Microsoft.NETCore.Targets (>= 1.0.1) - framework: dnxcore50, netstandard10, >= netstandard13 - System.Runtime (>= 4.1) - framework: dnxcore50, netstandard10, >= netstandard13 - System.Globalization (4.0.11) - framework: >= netstandard10 - Microsoft.NETCore.Platforms (>= 1.0.1) - framework: dnxcore50, netstandard10, >= netstandard13 - Microsoft.NETCore.Targets (>= 1.0.1) - framework: dnxcore50, netstandard10, >= netstandard13 - System.Runtime (>= 4.1) - framework: dnxcore50, netstandard10, >= netstandard13 - System.IO (4.1) - framework: >= netstandard16 - Microsoft.NETCore.Platforms (>= 1.0.1) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 - Microsoft.NETCore.Targets (>= 1.0.1) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 - System.Runtime (>= 4.1) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 - System.Text.Encoding (>= 4.0.11) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 - System.Threading.Tasks (>= 4.0.11) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 - System.Linq (4.1) - framework: >= netstandard10 - System.Collections (>= 4.0.11) - framework: dnxcore50, netstandard10, >= netstandard16 - System.Diagnostics.Debug (>= 4.0.11) - framework: dnxcore50, >= netstandard16 - System.Resources.ResourceManager (>= 4.0.1) - framework: dnxcore50, >= netstandard16 - System.Runtime (>= 4.1) - framework: dnxcore50, netstandard10, >= netstandard16 - System.Runtime.Extensions (>= 4.1) - framework: dnxcore50, >= netstandard16 - System.Reflection (4.1) - framework: >= netstandard16 - Microsoft.NETCore.Platforms (>= 1.0.1) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 - Microsoft.NETCore.Targets (>= 1.0.1) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 - System.IO (>= 4.1) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 - System.Reflection.Primitives (>= 4.0.1) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 - System.Runtime (>= 4.1) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 - System.Reflection.Primitives (4.0.1) - framework: >= netstandard16 - Microsoft.NETCore.Platforms (>= 1.0.1) - framework: dnxcore50, >= netstandard10 - Microsoft.NETCore.Targets (>= 1.0.1) - framework: dnxcore50, >= netstandard10 - System.Runtime (>= 4.1) - framework: dnxcore50, >= netstandard10 - System.Resources.ResourceManager (4.0.1) - framework: >= netstandard16 - Microsoft.NETCore.Platforms (>= 1.0.1) - framework: dnxcore50, >= netstandard10 - Microsoft.NETCore.Targets (>= 1.0.1) - framework: dnxcore50, >= netstandard10 - System.Globalization (>= 4.0.11) - framework: dnxcore50, >= netstandard10 - System.Reflection (>= 4.1) - framework: dnxcore50, >= netstandard10 - System.Runtime (>= 4.1) - framework: dnxcore50, >= netstandard10 - System.Runtime (4.1) - framework: >= netstandard10 - Microsoft.NETCore.Platforms (>= 1.0.1) - framework: dnxcore50, netstandard10, netstandard12, netstandard13, >= netstandard15 - Microsoft.NETCore.Targets (>= 1.0.1) - framework: dnxcore50, netstandard10, netstandard12, netstandard13, >= netstandard15 - System.Runtime.Extensions (4.1) - framework: >= netstandard16 - Microsoft.NETCore.Platforms (>= 1.0.1) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 - Microsoft.NETCore.Targets (>= 1.0.1) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 - System.Runtime (>= 4.1) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 - System.Text.Encoding (4.0.11) - framework: >= netstandard16 - Microsoft.NETCore.Platforms (>= 1.0.1) - framework: dnxcore50, netstandard10, >= netstandard13 - Microsoft.NETCore.Targets (>= 1.0.1) - framework: dnxcore50, netstandard10, >= netstandard13 - System.Runtime (>= 4.1) - framework: dnxcore50, netstandard10, >= netstandard13 - System.Text.RegularExpressions (4.1) - framework: >= netstandard10 - System.Collections (>= 4.0.11) - framework: dnxcore50, >= netstandard16 - System.Globalization (>= 4.0.11) - framework: dnxcore50, >= netstandard16 - System.Resources.ResourceManager (>= 4.0.1) - framework: dnxcore50, >= netstandard16 - System.Runtime (>= 4.1) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard16 - System.Runtime.Extensions (>= 4.1) - framework: dnxcore50, >= netstandard16 - System.Threading (>= 4.0.11) - framework: dnxcore50, >= netstandard16 - System.Threading (4.0.11) - framework: >= netstandard16 - System.Runtime (>= 4.1) - framework: dnxcore50, netstandard10, >= netstandard13 - System.Threading.Tasks (>= 4.0.11) - framework: dnxcore50, netstandard10, >= netstandard13 - System.Threading.Tasks (4.0.11) - framework: >= netstandard16 - Microsoft.NETCore.Platforms (>= 1.0.1) - framework: dnxcore50, netstandard10, >= netstandard13 - Microsoft.NETCore.Targets (>= 1.0.1) - framework: dnxcore50, netstandard10, >= netstandard13 - System.Runtime (>= 4.1) - framework: dnxcore50, netstandard10, >= netstandard13 -GITHUB - remote: nunit/nunit-transforms - nunit3-junit/nunit3-junit.xslt (2a7c74198375b4b280ff3e79033c3d44e3083850) \ No newline at end of file + FAKE (4.50)