├── Katas.Pager
├── pager.png
├── Class1.cs
├── readme.md
├── Properties
│ └── AssemblyInfo.cs
└── Katas.Pager.csproj
├── README.md
├── Katas.PrimeNumbers
├── readme.md
├── packages.config
├── PrimeCalculator.cs
├── PrimeNumberSpecs.cs
├── Properties
│ └── AssemblyInfo.cs
└── Katas.PrimeNumbers.csproj
├── Katas.FizzBuzz
├── packages.config
├── readme.md
├── FizzBuzzer.cs
├── Properties
│ └── AssemblyInfo.cs
├── FizzBuzzerTests.cs
└── Katas.FizzBuzz.csproj
├── Katas.BankTransfer
├── packages.config
├── readme.md
├── Code
│ ├── Transaction.cs
│ └── Account.cs
├── Properties
│ └── AssemblyInfo.cs
├── Specs
│ └── AccountSpecs.cs
└── Katas.BankTransfer.csproj
├── Katas.Fibonacci
├── packages.config
├── FibonacciGenerator.cs
├── readme.md
├── FibonacciGeneratorSpecs.cs
├── Properties
│ └── AssemblyInfo.cs
└── Katas.Fibonacci.csproj
├── Katas.FizzBuzzWhiz
├── packages.config
├── readme.md
├── Specs
│ ├── FizzBuzzWhizerSpecs.cs
│ └── PrimeNumberSpecs.cs
├── Properties
│ └── AssemblyInfo.cs
├── Code
│ └── FizzBuzzWhizer.cs
└── Katas.FizzBuzzWhiz.csproj
├── Katas.ConwayGameOfLife
├── Code
│ ├── CellState.cs
│ └── LifeRules.cs
├── packages.config
├── readme.md
├── Properties
│ └── AssemblyInfo.cs
├── Specs
│ └── LifeRulesSpecs.cs
└── Katas.ConwayGameOfLife.csproj
├── Katas.Anagrams
├── packages.config
├── readme.md
├── Anagram.cs
├── AnagramsSpecs.cs
├── Properties
│ └── AssemblyInfo.cs
└── Katas.Anagrams.csproj
├── Katas.LeapYear
├── packages.config
├── readme.md
├── IntegerExtensions.cs
├── LeapYearSpecs.cs
├── Properties
│ └── AssemblyInfo.cs
└── Katas.LeapYear.csproj
├── Katas.WordCounter
├── packages.config
├── readme.md
├── TestHelpers.cs
├── Counter.cs
├── Properties
│ └── AssemblyInfo.cs
├── WordCounterSpecs.cs
└── Katas.WordCounter.csproj
├── Katas.FibonacciSequence
├── packages.config
├── Code
│ ├── FibonacciGenerator.cs
│ └── FibonacciGeneratorLoop.cs
├── readme.md
├── Properties
│ └── AssemblyInfo.cs
├── Specs
│ └── FibonacciSequenceSpecs.cs
└── Katas.FibonacciSequence.csproj
├── Katas.StringCalculator
├── packages.config
├── Calculator.cs
├── Properties
│ └── AssemblyInfo.cs
├── StringCalculatorSpecs.cs
├── readme.md
├── StringCalculatorKata.txt
└── Katas.StringCalculator.csproj
├── Katas.Dojo.Specs
├── packages.config
├── Properties
│ └── AssemblyInfo.cs
└── Katas.Dojo.Specs.csproj
├── Katas.sln.DotSettings
├── Katas.Dojo.Core
├── Properties
│ └── AssemblyInfo.cs
└── Katas.Dojo.Core.csproj
├── .gitignore
└── Katas.sln
/Katas.Pager/pager.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mwhelan/Katas/HEAD/Katas.Pager/pager.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Katas
2 | =====
3 |
4 | A collection of TDD exercises that are useful as katas
5 |
--------------------------------------------------------------------------------
/Katas.PrimeNumbers/readme.md:
--------------------------------------------------------------------------------
1 | # Prime Calculator Kata #
2 |
3 | A method that, given an integer, returns true if it is a prime and false if it is not.
4 |
5 |
--------------------------------------------------------------------------------
/Katas.FizzBuzz/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Katas.BankTransfer/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Katas.Fibonacci/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Katas.FizzBuzzWhiz/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Katas.ConwayGameOfLife/Code/CellState.cs:
--------------------------------------------------------------------------------
1 | namespace Katas.ConwayGameOfLife.Code
2 | {
3 | public enum CellState
4 | {
5 | Alive,
6 | Dead
7 | }
8 | }
--------------------------------------------------------------------------------
/Katas.Anagrams/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Katas.LeapYear/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Katas.PrimeNumbers/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Katas.WordCounter/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Katas.ConwayGameOfLife/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Katas.FibonacciSequence/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Katas.StringCalculator/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Katas.Pager/Class1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Katas.Pager
8 | {
9 | ///
10 | /// http://kaczanowscy.pl/tomek/2013-04/code-kata-pager
11 | ///
12 | public class Class1
13 | {
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Katas.LeapYear/readme.md:
--------------------------------------------------------------------------------
1 | # Leap Year Kata #
2 |
3 | Write a function that returns ***true*** or ***false*** depending on
4 | whether its input integer is a leap year or not.
5 |
6 | A leap year is divisible by 4, but is not otherwise divisible by 100, unless it is also divisible by 400.
7 |
8 | Examples:
9 |
10 | 1996 => true
11 | 2001 => false
12 | 2000 => true
13 | 1900 => false
--------------------------------------------------------------------------------
/Katas.PrimeNumbers/PrimeCalculator.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 |
3 | namespace Katas.PrimeNumbers
4 | {
5 | public class PrimeCalculator
6 | {
7 | public bool IsPrime(int candidate)
8 | {
9 | return candidate != 1 &&
10 | !Enumerable.Range(2, candidate)
11 | .Any(i => candidate != i && candidate % i == 0);
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/Katas.WordCounter/readme.md:
--------------------------------------------------------------------------------
1 | # Word Counter Kata #
2 |
3 | A method that, given a delimited string, returns a collection of all of the
4 | unique words in it and the count of how many times they occurred.
5 | Start off with a space between words, but later other delimiters wil
6 | be added.
7 |
8 | Example input:
9 |
10 | "boom,bang,boom"
11 |
12 | Which would produce the following result:
13 |
14 | boom, 2
15 | bang, 1
--------------------------------------------------------------------------------
/Katas.Fibonacci/FibonacciGenerator.cs:
--------------------------------------------------------------------------------
1 | namespace Katas.Fibonacci
2 | {
3 | public class FibonacciGenerator
4 | {
5 | public int GetFibonacciValueFor(int number)
6 | {
7 | if (number == 0 || number == 1)
8 | {
9 | return number;
10 | }
11 | return (GetFibonacciValueFor(number - 1)) + (GetFibonacciValueFor(number - 2));
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/Katas.Fibonacci/readme.md:
--------------------------------------------------------------------------------
1 | # Fibonacci Generator Kata #
2 |
3 | Write some code to generate the Fibonacci sequence up to a specific length which is no shorter than 8 numbers and no longer than 50
4 |
5 | F0 => 0
6 | F1 => 1
7 | F2 => 1
8 | F3 => 2
9 | F4 => 3
10 | F5 => 5
11 | F6 => 8
12 | F7 => 13
13 | F8 => 21
14 |
15 | The Rule is Xn = Xn-1 + Xn-2
16 |
17 | i.e. Fibonacci(number - 1) + Fibonacci(number - 2)
--------------------------------------------------------------------------------
/Katas.FibonacciSequence/Code/FibonacciGenerator.cs:
--------------------------------------------------------------------------------
1 | namespace Katas.FibonacciSequence.Code
2 | {
3 | public class FibonacciGenerator
4 | {
5 | public int GetNumberFor(int number)
6 | {
7 | if (number == 0 || number == 1)
8 | {
9 | return number;
10 | }
11 | return (GetNumberFor(number - 1)) + (GetNumberFor(number - 2));
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/Katas.FibonacciSequence/readme.md:
--------------------------------------------------------------------------------
1 | # The Fibonacci Sequence Kata #
2 |
3 | Source: Jason Gorman ([Codemanship](http://codemanship.co.uk/tdd.html))
4 |
5 | Write a C# script that writes out the number for a given position in the Fibonacci Sequence
6 |
7 | ## Example ##
8 |
9 | Given the sequence
10 |
11 | 0
12 | 1
13 | 1
14 | 2
15 | 3
16 | 5
17 | 8
18 | 13
19 | 21
20 | 34
21 |
22 | Supplying position 5 would print 3
--------------------------------------------------------------------------------
/Katas.BankTransfer/readme.md:
--------------------------------------------------------------------------------
1 | # Bank Transfer Kata #
2 |
3 | Source: Jason Gorman ([Codemanship](http://codemanship.co.uk/tdd.html))
4 |
5 | - Write some code to transfer a specified amount of money from one bank account (the payer) to another (the payee)
6 | - Write some code to keep a record of the transfer for both bank accounts in a transaction history
7 | - Write some code to query a bank account's transaction history for any bank transfers to or from a specific account
--------------------------------------------------------------------------------
/Katas.Anagrams/readme.md:
--------------------------------------------------------------------------------
1 | # Anagrams Kata #
2 |
3 | [http://www.codeproject.com/Articles/498404/TDD-the-Anagrams-Kata](http://www.codeproject.com/Articles/498404/TDD-the-Anagrams-Kata)
4 |
5 | Write a program to generate all potential anagrams of an input string.
6 |
7 | For example, the potential anagrams of "biro" are
8 |
9 | biro bior brio broi boir bori
10 | ibro ibor irbo irob iobr iorb
11 | rbio rboi ribo riob roib robi
12 | obir obri oibr oirb orbi orib
--------------------------------------------------------------------------------
/Katas.Dojo.Specs/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Katas.WordCounter/TestHelpers.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 | using FluentAssertions;
3 |
4 | namespace Katas.WordCounter
5 | {
6 | public static class TestHelpers
7 | {
8 | public static void ShouldEqual(this string input, dynamic[] expected, char delimiter = ' ')
9 | {
10 | new Counter()
11 | .CountWordsIn(input, delimiter)
12 | .Should()
13 | .Equal(expected.ToDictionary(item => (string)item[0], item => (int)item[1]));
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/Katas.BankTransfer/Code/Transaction.cs:
--------------------------------------------------------------------------------
1 | namespace Katas.BankTransfer.Code
2 | {
3 | public class Transaction
4 | {
5 | public Transaction(string type, Account otherAccount, double amount)
6 | {
7 | Type = type;
8 | OtherAccount = otherAccount;
9 | Amount = amount;
10 | }
11 |
12 | public string Type { get; private set; }
13 |
14 | public Account OtherAccount { get; private set; }
15 |
16 | public double Amount { get; private set; }
17 | }
18 | }
--------------------------------------------------------------------------------
/Katas.FizzBuzz/readme.md:
--------------------------------------------------------------------------------
1 | # FizzBuzz Kata #
2 |
3 | Write some code that will generate a string of integers, starting at 1 and going up to 100, all separated by commas. Substitute any integer which is divisible by 3 with "Fizz", and any integer which is divisible by 5 with "Buzz", and any integer divisible by 3 and 5 with "FizzBuzz".
4 |
5 | 1
6 | 2
7 | Fizz
8 | 4
9 | Buzz
10 | Fizz
11 | 7
12 | 8
13 | Fizz
14 | Buzz
15 | 11
16 | Fizz
17 | 13
18 | 14
19 | FizzBuzz
20 | 16
21 | 17
22 | Fizz
23 | 19
24 | Buzz
25 |
26 | ... etc up to 100
27 |
28 |
--------------------------------------------------------------------------------
/Katas.sln.DotSettings:
--------------------------------------------------------------------------------
1 |
2 | <data><IncludeFilters /><ExcludeFilters /></data>
3 | <data />
--------------------------------------------------------------------------------
/Katas.ConwayGameOfLife/readme.md:
--------------------------------------------------------------------------------
1 | # Conway's Game of Life Kata #
2 |
3 | From [TDD & Conway's Game of Life](http://jeremybytes.blogspot.co.uk/2014/10/tdd-conways-game-of-life.html).
4 |
5 | Implement these rules for Conway's Game of Life:
6 | - Any live cell with fewer than two live neighbours dies, as if caused by under-population.
7 | - Any live cell with two or three live neighbours lives on to the next generation.
8 | - Any live cell with more than three live neighbours dies, as if by overcrowding.
9 | - Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.
--------------------------------------------------------------------------------
/Katas.LeapYear/IntegerExtensions.cs:
--------------------------------------------------------------------------------
1 | namespace Katas.LeapYear
2 | {
3 | public static class IntegerExtensions
4 | {
5 | public static bool IsLeapYear(this int year)
6 | {
7 | return IsTypicalLeapYear(year) && !IsSpecialCommonYear(year);
8 | }
9 |
10 | private static bool IsTypicalLeapYear(int year)
11 | {
12 | return year%4 == 0;
13 | }
14 |
15 | private static bool IsSpecialCommonYear(int year)
16 | {
17 | return (year % 100 == 0) && (year % 400 != 0);
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/Katas.FibonacciSequence/Code/FibonacciGeneratorLoop.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Katas.FibonacciSequence.Code
4 | {
5 | public class FibonacciGeneratorLoop
6 | {
7 | public int GetNumberFor(int n)
8 | {
9 | int a = 0;
10 | int b = 1;
11 | // In N steps compute Fibonacci sequence iteratively.
12 | for (int i = 0; i < n; i++)
13 | {
14 | int temp = a;
15 | a = b;
16 | b = temp + b;
17 |
18 | Console.WriteLine("i={0}, temp={1}, a (returned) ={2}, b={3}", i, temp, a, b);
19 | }
20 | return a;
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/Katas.FizzBuzzWhiz/readme.md:
--------------------------------------------------------------------------------
1 | # FizzBuzzWhiz Kata #
2 |
3 | Same as FizzBuzz but substitute prime numbers with "Whiz"
4 |
5 | Write some code that will generate a string of integers, starting at 1 and going up to 100, all separated by commas. Substitute any integer which is divisible by 3 with "Fizz", and any integer which is divisible by 5 with "Buzz", and any integer divisible by 3 and 5 with "FizzBuzz".
6 |
7 | 1
8 | Whiz
9 | FizzWhiz
10 | 4
11 | BuzzWhiz
12 | Fizz
13 | Whiz
14 | 8
15 | Fizz
16 | Buzz
17 | Whiz
18 |
19 | The smallest twenty-five prime numbers (all the prime numbers under 100) are:
20 |
21 | 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
--------------------------------------------------------------------------------
/Katas.LeapYear/LeapYearSpecs.cs:
--------------------------------------------------------------------------------
1 | using FluentAssertions;
2 | using NUnit.Framework;
3 |
4 | namespace Katas.LeapYear
5 | {
6 | public class LeapYearSpecs
7 | {
8 | [Test]
9 | public void NormalLeapYearShouldBeLeapYear()
10 | {
11 | 1996.IsLeapYear().Should().BeTrue();
12 | }
13 |
14 | [Test]
15 | public void NormalCommonYearShouldNotBeLeapYear()
16 | {
17 | 2001.IsLeapYear().Should().BeFalse();
18 | }
19 |
20 | [Test]
21 | public void SpecialCommonYearShouldNotBeLeapYear()
22 | {
23 | 1900.IsLeapYear().Should().BeFalse();
24 | }
25 |
26 | [Test]
27 | public void SpecialLeapYearShouldNotBeLeapYear()
28 | {
29 | 2000.IsLeapYear().Should().BeTrue();
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Katas.WordCounter/Counter.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Katas.WordCounter
4 | {
5 | public class Counter
6 | {
7 | public Dictionary CountWordsIn(string input, char delimiter = ' ')
8 | {
9 | var registry = new Dictionary();
10 | if (string.IsNullOrEmpty(input))
11 | {
12 | return registry;
13 | }
14 |
15 | var words = input.Split(delimiter);
16 | foreach (var word in words)
17 | {
18 | if(registry.ContainsKey(word))
19 | {
20 | registry[word] = registry[word] + 1;
21 | }
22 | else
23 | {
24 | registry.Add(word, 1);
25 | }
26 | }
27 |
28 | return registry;
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/Katas.ConwayGameOfLife/Code/LifeRules.cs:
--------------------------------------------------------------------------------
1 | namespace Katas.ConwayGameOfLife.Code
2 | {
3 | public class LifeRules
4 | {
5 | public static CellState GetNewState(CellState currentState, int liveNeighbours)
6 | {
7 | if (currentState == CellState.Dead)
8 | {
9 | if (liveNeighbours == 3)
10 | {
11 | return CellState.Alive;
12 | }
13 | else
14 | {
15 | return currentState;
16 | }
17 | }
18 |
19 | if (liveNeighbours < 2)
20 | {
21 | return CellState.Dead;
22 | }
23 |
24 | if (liveNeighbours == 2 || liveNeighbours ==3)
25 | {
26 | return CellState.Alive;
27 | }
28 |
29 | return CellState.Dead;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Katas.Anagrams/Anagram.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Katas.Anagrams
4 | {
5 | public static class Anagram
6 | {
7 | public static List Of(string s)
8 | {
9 | if (s.Length <= 1)
10 | return new List { s };
11 | var anagrams = new List();
12 | for (var i = 0; i < s.Length; i++)
13 | {
14 | var droppedCharacter = s.Substring(i, 1);
15 | var anagramsOfRest = Anagram.Of(DropCharacter(s, i));
16 | foreach (var anagramOfRest in anagramsOfRest)
17 | anagrams.Add(droppedCharacter + anagramOfRest);
18 | }
19 | return anagrams;
20 | }
21 | private static string DropCharacter(string s, int index)
22 | {
23 | return s.Substring(0, index) + s.Substring(index + 1, s.Length - (index + 1));
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/Katas.FizzBuzz/FizzBuzzer.cs:
--------------------------------------------------------------------------------
1 | namespace Katas.FizzBuzz
2 | {
3 | public class FizzBuzzer
4 | {
5 | public string GetFizzBuzzValueFor(int number)
6 | {
7 | if (NumberDivisbleBy(3,number) && NumberDivisbleBy(5, number))
8 | {
9 | return "FizzBuzz";
10 | }
11 | if (NumberDivisbleBy(3, number))
12 | {
13 | return "Fizz";
14 | }
15 | if (NumberDivisbleBy(5, number))
16 | {
17 | return "Buzz";
18 | }
19 | return number.ToString();
20 | }
21 |
22 | private bool NumberDivisbleBy(int divisor, int number )
23 | {
24 | return number % divisor == 0;
25 | }
26 |
27 | public string GetFizBuzzString()
28 | {
29 | string fizz = GetFizzBuzzValueFor(1);
30 | for (int i = 2; i <= 100; i++)
31 | {
32 | fizz += "," + GetFizzBuzzValueFor(i);
33 | }
34 | return fizz;
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/Katas.StringCalculator/Calculator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 |
4 | namespace Katas.StringCalculator
5 | {
6 | public class Calculator
7 | {
8 | public int Add(string numbers)
9 | {
10 | if (string.IsNullOrEmpty(numbers))
11 | {
12 | return 0;
13 | }
14 |
15 | char[] delimiters;
16 | if (numbers.StartsWith("//"))
17 | {
18 | delimiters = new char[]{numbers[2]};
19 | numbers = numbers.Substring(4);
20 | }
21 | else
22 | {
23 | delimiters = new char[]{',','\n'};
24 | }
25 | var strings = numbers
26 | .Split(delimiters)
27 | .Select(int.Parse);
28 |
29 | if (strings.Any(x => x <0))
30 | {
31 | throw new ArgumentOutOfRangeException();
32 | }
33 |
34 | return strings
35 | .Where(x => x <= 1000)
36 | .Sum(x => x);
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/Katas.PrimeNumbers/PrimeNumberSpecs.cs:
--------------------------------------------------------------------------------
1 | using FluentAssertions;
2 | using NUnit.Framework;
3 |
4 | namespace Katas.PrimeNumbers
5 | {
6 | // Prime numbers: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37,
7 | // 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97
8 |
9 | [TestFixture]
10 | public class PrimeNumberSpecs
11 | {
12 | private PrimeCalculator SUT;
13 |
14 | [SetUp]
15 | public void SetUp()
16 | {
17 | SUT = new PrimeCalculator();
18 | }
19 |
20 | [Test]
21 | public void One_should_return_false()
22 | {
23 | SUT.IsPrime(1).Should().BeFalse();
24 | }
25 |
26 | [Test]
27 | public void Two_should_return_true()
28 | {
29 | SUT.IsPrime(2).Should().BeTrue();
30 | }
31 |
32 | [Test]
33 | public void Three_should_return_true()
34 | {
35 | SUT.IsPrime(3).Should().BeTrue();
36 | }
37 |
38 | [Test]
39 | public void Four_should_return_false()
40 | {
41 | SUT.IsPrime(4).Should().BeFalse();
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/Katas.Pager/readme.md:
--------------------------------------------------------------------------------
1 | # Page Kata #
2 |
3 | Source: [Tomek Kaczanowski](http://kaczanowscy.pl/tomek/2013-04/code-kata-pager)
4 |
5 | The kata is about the writing of the underlying data model for a pager control (NOT about the presentation). What you should create is a class (bunch of classes) which is smart enough to provide all the data required to actually render the links to pages.
6 |
7 | 
8 |
9 | So, the pager gets the following data as input:
10 |
11 | - total number of items
12 | - page size. That is, number of items per page
13 | - offset e.g. 4680, which means that the user has already flipped through 234 pages (20 items each)
14 | - current page number e.g. 234 (which in fact is the same information)
15 |
16 | Given this data pager should be able to answer the following questions:
17 |
18 | - how many pages are there? e.g. total records / records per page,
19 | - should prev/next link be visible? e.g. prev button should not be visible when user is on the first page,
20 | - which links to print? e.g. when user is on 25th page, then links to 24, 25 and 26 should be printed,
21 | - which page is current? so we could bold/highlight it's number (and remove the link).
22 | - And so on.
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Katas.Anagrams/AnagramsSpecs.cs:
--------------------------------------------------------------------------------
1 | using FluentAssertions;
2 | using NUnit.Framework;
3 | using System.Collections.Generic;
4 |
5 | namespace Katas.Anagrams
6 | {
7 | [TestFixture]
8 | public class AnagramsSpecs
9 | {
10 | [Test]
11 | public void should_return_empty_string_for_no_characters()
12 | {
13 | var expected = new List { "" };
14 | Anagram.Of("").Should().BeEquivalentTo(expected);
15 | }
16 |
17 | [Test]
18 | public void should_return_character_for_one_character()
19 | {
20 | var expected = new List {"A"};
21 | Anagram.Of("A").Should().BeEquivalentTo(expected);
22 | }
23 |
24 | [Test]
25 | [TestCase("AB", "AB", "BA")]
26 | [TestCase("YZ", "YZ", "ZY")]
27 | public void should_return_two_results_for_two_characters(string testCase, string first, string second)
28 | {
29 | var expected = new List { first, second };
30 | Anagram.Of(testCase).Should().BeEquivalentTo(expected);
31 | }
32 |
33 | [Test]
34 | public void should_return_six_results_for_three_characters()
35 | {
36 | var expected = new List { "ABC", "ACB", "BAC", "BCA", "CAB", "CBA" };
37 | Anagram.Of("ABC").Should().BeEquivalentTo(expected);
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/Katas.Fibonacci/FibonacciGeneratorSpecs.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 |
3 | namespace Katas.Fibonacci
4 | {
5 | [TestFixture]
6 | public class FibonacciGeneratorSpecs
7 | {
8 | [Test]
9 | public void FibonacciValueOfZeroShouldBeZero()
10 | {
11 | int result = GetFibonacciValueFor(0);
12 | Assert.AreEqual(0, result);
13 | }
14 |
15 | [Test]
16 | public void FibonacciValueOfOneShouldBeOne()
17 | {
18 | int result = GetFibonacciValueFor(1);
19 | Assert.AreEqual(1, result);
20 | }
21 |
22 | [Test]
23 | public void FibonacciValueOfTwoShouldBeOne()
24 | {
25 | int result = GetFibonacciValueFor(2);
26 | Assert.AreEqual(1, result);
27 | }
28 |
29 | [Test]
30 | public void FibonacciValueOfFiveShouldBeFive()
31 | {
32 | int result = GetFibonacciValueFor(5);
33 | Assert.AreEqual(5, result);
34 | }
35 |
36 | [Test]
37 | public void FibonacciValueOfEightShouldBeTwentyOne()
38 | {
39 | int result = GetFibonacciValueFor(8);
40 | Assert.AreEqual(21, result);
41 | }
42 |
43 | private int GetFibonacciValueFor(int number)
44 | {
45 | var fg = new FibonacciGenerator();
46 | return fg.GetFibonacciValueFor(number);
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/Katas.Anagrams/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Katas.Anagrams")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Katas.Anagrams")]
13 | [assembly: AssemblyCopyright("Copyright © 2013")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("b17602bc-d493-41d3-8b49-2f1a911ddb4e")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Katas.LeapYear/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Katas.LeapYear")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Katas.LeapYear")]
13 | [assembly: AssemblyCopyright("Copyright © 2016")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("bd1c6943-3414-4a7e-a6ad-be8eaacaa2b4")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Katas.Dojo.Core/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Katas.Dojo.Core")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Katas.Dojo.Core")]
13 | [assembly: AssemblyCopyright("Copyright © 2016")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("d74bf109-b03f-499b-acb5-ed8fa315e308")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Katas.Dojo.Specs/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Katas.Dojo.Specs")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Katas.Dojo.Specs")]
13 | [assembly: AssemblyCopyright("Copyright © 2016")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("d68ef31e-94c0-4163-b8fd-05a4d6a0f2a0")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Katas.Pager/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Katas.Pager")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("Katas.Pager")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2013")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("d18a97ed-36ae-411a-9813-c05c6193d42d")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Katas.WordCounter/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Katas.WordCounter")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Katas.WordCounter")]
13 | [assembly: AssemblyCopyright("Copyright © 2013")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("50e1cfcd-ed8c-487b-9e0d-2e03d5f0808f")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Katas.PrimeNumbers/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Katas.PrimeNumbers")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Katas.PrimeNumbers")]
13 | [assembly: AssemblyCopyright("Copyright © 2013")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("86c7ab5e-148c-446d-b40b-79acbcba7b0f")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Katas.ConwayGameOfLife/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Katas.ConwayGameOfLife")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Katas.ConwayGameOfLife")]
13 | [assembly: AssemblyCopyright("Copyright © 2016")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("f284cf9e-3fab-42ef-9f1d-b883bfadb99d")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Katas.StringCalculator/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Katas.StringCalculator")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Katas.StringCalculator")]
13 | [assembly: AssemblyCopyright("Copyright © 2013")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("7d8cfb6c-6700-43d3-acc3-989ff5b1fb5a")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Katas.FibonacciSequence/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Katas.FibonacciSequence")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Katas.FibonacciSequence")]
13 | [assembly: AssemblyCopyright("Copyright © 2013")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("c0bbefc7-2a2d-4956-8ccd-39d05eb0c3e1")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Katas.FizzBuzzWhiz/Specs/FizzBuzzWhizerSpecs.cs:
--------------------------------------------------------------------------------
1 | using Katas.FizzBuzzWhiz.Code;
2 | using NUnit.Framework;
3 |
4 | namespace Katas.FizzBuzzWhiz.Specs
5 | {
6 | [TestFixture]
7 | public class FizzBuzzWhizerSpecs
8 | {
9 | [Test]
10 | public void FizzBuzzWhizValueForOneShouldBeOne()
11 | {
12 | Assert.AreEqual("1", GetFizzBuzzWhizValueFor(1));
13 | }
14 |
15 | [Test]
16 | public void FizzBuzzWhizValueForTwoShouldBeWhiz()
17 | {
18 | Assert.AreEqual("Whiz", GetFizzBuzzWhizValueFor(2));
19 | }
20 |
21 | [Test]
22 | public void FizzBuzzWhizValueForThreeShouldBeFizzWhiz()
23 | {
24 | Assert.AreEqual("FizzWhiz", GetFizzBuzzWhizValueFor(3));
25 | }
26 |
27 | [Test]
28 | public void FizzBuzzWhizValueForFourShouldBeFour()
29 | {
30 | Assert.AreEqual("4", GetFizzBuzzWhizValueFor(4));
31 | }
32 |
33 | [Test]
34 | [TestCase(5, "BuzzWhiz")]
35 | [TestCase(6, "Fizz")]
36 | [TestCase(7, "Whiz")]
37 | [TestCase(8, "8")]
38 | [TestCase(9, "Fizz")]
39 | [TestCase(10, "Buzz")]
40 | public void FizzBuzzValuesShouldBe(int number, string expected)
41 | {
42 | Assert.AreEqual(expected, GetFizzBuzzWhizValueFor(number));
43 | }
44 |
45 | private string GetFizzBuzzWhizValueFor(int number)
46 | {
47 | FizzBuzzWhizer fbw = new FizzBuzzWhizer();
48 | return fbw.GetFizzBuzzWhizValueFor(number);
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/Katas.FizzBuzz/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Codemanship.Kata03.FizzBuzz")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("Codemanship.Kata03.FizzBuzz")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("bac9c7f2-b34b-4961-b190-a8dde3fd251c")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Katas.Fibonacci/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Codemanship.Kata02.Fibonacci")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("Codemanship.Kata02.Fibonacci")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("c65d10c0-ea53-4a6b-a2cc-c69fa9cd1c11")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Katas.BankTransfer/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Codemanship.Kata01.BankTransfer")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("Codemanship.Kata01.BankTransfer")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("4643349b-ad7a-4461-82a9-26276c19bed7")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Katas.FizzBuzzWhiz/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Codemanship.Kata04.FizzBuzzWhiz")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("Codemanship.Kata04.FizzBuzzWhiz")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("6b896dde-ced6-4f4d-aa30-0a5633a0f3c5")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Katas.WordCounter/WordCounterSpecs.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using FluentAssertions;
3 | using NUnit.Framework;
4 |
5 | namespace Katas.WordCounter
6 | {
7 | [TestFixture]
8 | public class WordCounterSpecs
9 | {
10 | [Test]
11 | public void empty_string_should_return_empty_collection()
12 | {
13 | CountWordsIn("").Should().BeEmpty();
14 | }
15 |
16 | [Test]
17 | public void one_word_should_return_word()
18 | {
19 | var expected = new Dictionary { { "boom", 1 } };
20 | CountWordsIn("boom").Should().Equal(expected);
21 | }
22 |
23 | [Test]
24 | public void different_two_words_should_return_two_words()
25 | {
26 | var expected = new Dictionary { {"boom", 1}, {"bang", 1} };
27 | CountWordsIn("boom bang").Should().Equal(expected);
28 | }
29 |
30 | [Test]
31 | public void same_two_words_should_return_one_word_with_count_of_2()
32 | {
33 | var expected = new Dictionary { { "boom", 2 }, { "bang", 1 } };
34 | CountWordsIn("boom bang boom").Should().Equal(expected);
35 | }
36 |
37 | [Test]
38 | public void should_be_able_to_specify_delimiter()
39 | {
40 | var expected = new Dictionary { { "boom", 2 }, { "bang", 1 } };
41 | CountWordsIn("boom,bang,boom", ',').Should().Equal(expected);
42 | }
43 |
44 | private static Dictionary CountWordsIn(string input, char delimiter = ' ')
45 | {
46 | var counter = new Counter();
47 | var result = counter.CountWordsIn(input, delimiter);
48 | return result;
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/Katas.ConwayGameOfLife/Specs/LifeRulesSpecs.cs:
--------------------------------------------------------------------------------
1 | using FluentAssertions;
2 | using Katas.ConwayGameOfLife.Code;
3 | using NUnit.Framework;
4 |
5 | namespace Katas.ConwayGameOfLife.Specs
6 | {
7 | [TestFixture]
8 | public class LifeRulesSpecs
9 | {
10 | // Any live cell with fewer than two live neighbours dies, as if caused by under-population.
11 | // Any live cell with two or three live neighbours lives on to the next generation.
12 | // Any live cell with more than three live neighbours dies, as if by overcrowding.
13 | // Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.
14 |
15 | [Test]
16 | [TestCase(0)]
17 | [TestCase(1)]
18 | public void LiveCell_LessThanTwoLiveNeighbours_Dies(int liveNeighbours)
19 | {
20 | LifeRules
21 | .GetNewState(CellState.Alive, liveNeighbours)
22 | .Should().Be(CellState.Dead);
23 | }
24 |
25 | [Test]
26 | [TestCase(2)]
27 | [TestCase(3)]
28 | public void LiveCell_TwoOrThreeLiveNeighbours_Lives(int liveNeighbours)
29 | {
30 | LifeRules
31 | .GetNewState(CellState.Alive, liveNeighbours)
32 | .Should().Be(CellState.Alive);
33 | }
34 |
35 | [Test]
36 | [TestCase(4)]
37 | [TestCase(99)]
38 | public void LiveCell_ThreeOrMoreLiveNeighbours_Lives(int liveNeighbours)
39 | {
40 | LifeRules
41 | .GetNewState(CellState.Alive, liveNeighbours)
42 | .Should().Be(CellState.Dead);
43 | }
44 |
45 | [Test]
46 | public void DeadCell_ThreeLiveNeighbours_Lives()
47 | {
48 | LifeRules.GetNewState(CellState.Dead, 3)
49 | .Should().Be(CellState.Alive);
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/Katas.BankTransfer/Code/Account.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Katas.BankTransfer.Code
4 | {
5 | public class Account
6 | {
7 | private readonly int _accountNumber;
8 |
9 | public Account(int accountNumber)
10 | {
11 | _accountNumber = accountNumber;
12 | _transactions = new List();
13 | }
14 |
15 | private double _balance;
16 |
17 | public int AccountNumber
18 | {
19 | get { return _accountNumber; }
20 | }
21 |
22 | public double Balance
23 | {
24 | get { return _balance; }
25 | set { _balance = value; }
26 | }
27 |
28 | private readonly List _transactions;
29 | public List Transactions
30 | {
31 | get { return _transactions; }
32 | }
33 |
34 | public void Transfer(double amount, Account payee)
35 | {
36 | _balance -= amount;
37 | Transactions.Add(new Transaction("Debit", payee, amount));
38 | payee.Balance += amount;
39 | payee.Transactions.Add(new Transaction("Credit", this, amount));
40 | }
41 |
42 | public List GetTransactionsWhere(string type, Account account)
43 | {
44 | List transactions = new List();
45 | foreach (Transaction transaction in Transactions)
46 | {
47 | if (transaction.Type == type && transaction.OtherAccount == account)
48 | {
49 | transactions.Add(transaction);
50 | }
51 | }
52 | return transactions;
53 | }
54 |
55 | public override bool Equals(object obj)
56 | {
57 | return ((Account)obj).AccountNumber == _accountNumber;
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/Katas.FizzBuzzWhiz/Code/FizzBuzzWhizer.cs:
--------------------------------------------------------------------------------
1 | namespace Katas.FizzBuzzWhiz.Code
2 | {
3 | public class FizzBuzzWhizer
4 | {
5 | public string GetFizzBuzzWhizValueFor(int number)
6 | {
7 | string fb = string.Empty;
8 | if (IsDivisbleBy(3, number))
9 | {
10 | fb += "Fizz";
11 | }
12 | if (IsDivisbleBy(5, number))
13 | {
14 | fb += "Buzz";
15 | }
16 | if (IsPrime(number))
17 | {
18 | fb += "Whiz";
19 | }
20 |
21 | if (string.IsNullOrEmpty(fb))
22 | {
23 | fb = number.ToString();
24 | }
25 |
26 | return fb;
27 | }
28 |
29 | private bool IsDivisbleBy(int divisor, int number )
30 | {
31 | return number % divisor == 0;
32 | }
33 |
34 | public bool IsPrime(int number)
35 | {
36 | if (number == 1)
37 | {
38 | return false;
39 | }
40 | if (number == 2 || number ==3 || number == 5 || number == 7)
41 | {
42 | return true;
43 | }
44 | if (IsEvenNumber(number))
45 | {
46 | return false;
47 | }
48 | if (IsDivisbleByNumberBetweenThreeAndNine(number))
49 | return false;
50 | return true;
51 | }
52 |
53 | private bool IsDivisbleByNumberBetweenThreeAndNine(int number)
54 | {
55 | for (int i = 3; i < 10; i++)
56 | {
57 | if (number % i == 0)
58 | return true;
59 | }
60 | return false;
61 | }
62 |
63 | private static bool IsEvenNumber(int number)
64 | {
65 | return number % 2 == 0;
66 | }
67 |
68 | public string GetFizBuzzString()
69 | {
70 | string fizz = GetFizzBuzzWhizValueFor(1);
71 | for (int i = 2; i <= 100; i++)
72 | {
73 | fizz += "," + GetFizzBuzzWhizValueFor(i);
74 | }
75 | return fizz;
76 | }
77 |
78 | }
79 | }
--------------------------------------------------------------------------------
/Katas.FibonacciSequence/Specs/FibonacciSequenceSpecs.cs:
--------------------------------------------------------------------------------
1 | using FluentAssertions;
2 | using NUnit.Framework;
3 |
4 | namespace Katas.FibonacciSequence.Specs
5 | {
6 | // Given the sequence 0, 1, 1, 2, 3, 5, 8, 13, 21, 34
7 | // Supplying position 5 would print 3
8 | [TestFixture]
9 | public class FibonacciSequenceSpecs
10 | {
11 | [Test]
12 | public void Zero_Should_Return_Zero()
13 | {
14 | FibonacciValueFor(0).Should().Be(0);
15 | }
16 |
17 | [Test]
18 | public void One_Should_Return_One()
19 | {
20 | FibonacciValueFor(1).Should().Be(1);
21 | }
22 |
23 | [Test]
24 | public void Two_Should_Return_One()
25 | {
26 | FibonacciValueFor(2).Should().Be(1);
27 | }
28 |
29 | [Test]
30 | public void Three_Should_Return_Two()
31 | {
32 | FibonacciValueFor(3).Should().Be(2);
33 | }
34 |
35 | [Test]
36 | public void Nine_should_return_Thirty_Four()
37 | {
38 | FibonacciValueFor(9).Should().Be(34);
39 | }
40 |
41 | private int FibonacciValueFor(int position)
42 | {
43 | var generator = new MyLoopFibonacciGenerator();
44 | return generator.GetNumberFor(position);
45 | }
46 | }
47 |
48 | public class MyLoopFibonacciGenerator
49 | {
50 | public int GetNumberFor(int position)
51 | {
52 | int current = 0;
53 | int next = 1;
54 |
55 | for (int counter = 0; counter < position; counter++)
56 | {
57 | int temp = current;
58 | current = next;
59 | next = temp + next;
60 | }
61 | return current;
62 | }
63 | }
64 |
65 | public class MyRecursiveFibonacciGeneratorLoop
66 | {
67 | public int GetNumberFor(int position)
68 | {
69 | if (position == 0 || position == 1)
70 | {
71 | return position;
72 | }
73 |
74 | var previous = GetNumberFor(position - 1);
75 | var oneBeforeThat = GetNumberFor(position - 2);
76 | return previous + oneBeforeThat;
77 | }
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/Katas.FizzBuzz/FizzBuzzerTests.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 |
3 | namespace Katas.FizzBuzz
4 | {
5 | [TestFixture]
6 | public class FizzBuzzSpecs
7 | {
8 | [Test]
9 | public void FizzBuzzValueForOneShouldBeOne()
10 | {
11 | Assert.AreEqual("1", GetFizzBuzzValueFor(1));
12 | }
13 |
14 | [Test]
15 | public void FizzBuzzValueForTwoShouldBeTwo()
16 | {
17 | Assert.AreEqual("2", GetFizzBuzzValueFor(2));
18 | }
19 |
20 | [Test]
21 | public void FizzBuzzValueForThreeShouldBeFizz()
22 | {
23 | Assert.AreEqual("Fizz", GetFizzBuzzValueFor(3));
24 | }
25 |
26 | [Test]
27 | public void FizzBuzzValueForFiveShouldBeBuzz()
28 | {
29 | Assert.AreEqual("Buzz", GetFizzBuzzValueFor(5));
30 | }
31 |
32 | [Test]
33 | public void FizzBuzzValueForSixShouldBeFizz()
34 | {
35 | Assert.AreEqual("Fizz", GetFizzBuzzValueFor(6));
36 | }
37 |
38 | [Test]
39 | public void FizzBuzzValueForTenShouldBeBuzz()
40 | {
41 | Assert.AreEqual("Buzz", GetFizzBuzzValueFor(10));
42 | }
43 |
44 | [Test]
45 | public void FizzBuzzValueForFifteenShouldBeFizzBuzz()
46 | {
47 | Assert.AreEqual("FizzBuzz", GetFizzBuzzValueFor(15));
48 | }
49 |
50 | [Test]
51 | public void FizzBuzzPrintOutShouldStartWithOne()
52 | {
53 | Assert.That(GetFizzBuzzString().StartsWith("1"));
54 | }
55 |
56 | [Test]
57 | public void FizzBuzzStringShouldStartWithOneCommaTwoCommaFizz()
58 | {
59 | Assert.That(GetFizzBuzzString().StartsWith("1,2,Fizz"));
60 | }
61 |
62 | [Test]
63 | public void FizzBuzzStringShouldEndWithNinetyEightCommaFizzCommaBuzz()
64 | {
65 | Assert.That(GetFizzBuzzString().EndsWith("98,Fizz,Buzz"));
66 | }
67 |
68 | private string GetFizzBuzzString()
69 | {
70 | return new FizzBuzzer().GetFizBuzzString();
71 | }
72 |
73 | private string GetFizzBuzzValueFor(int number)
74 | {
75 | FizzBuzzer fb = new FizzBuzzer();
76 | return fb.GetFizzBuzzValueFor(number);
77 | }
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/Katas.FizzBuzzWhiz/Specs/PrimeNumberSpecs.cs:
--------------------------------------------------------------------------------
1 | using Katas.FizzBuzzWhiz.Code;
2 | using NUnit.Framework;
3 |
4 | namespace Katas.FizzBuzzWhiz.Specs
5 | {
6 | [TestFixture]
7 | public class PrimeNumberSpecs
8 | {
9 | [Test]
10 | public void OneShouldNotBePrimeNumber()
11 | {
12 | Assert.IsFalse(new FizzBuzzWhizer().IsPrime(1));
13 | }
14 |
15 | [Test]
16 | public void TwoShouldBePrimeNumber()
17 | {
18 | Assert.IsTrue(new FizzBuzzWhizer().IsPrime(2));
19 | }
20 |
21 | [Test]
22 | public void EvenNumbersShouldNotBePrimeNumbers()
23 | {
24 | Assert.IsFalse(new FizzBuzzWhizer().IsPrime(4));
25 | }
26 |
27 | [Test]
28 | [TestCase(2)]
29 | [TestCase(3)]
30 | [TestCase(5, Description="It was 5")]
31 | [TestCase(7, Description = "It was 7")]
32 | [TestCase(11, Description = "It was 11")]
33 | [TestCase(13, Description = "It was 13")]
34 | [TestCase(17, Description = "It was 17")]
35 | [TestCase(19, Description = "It was 19")]
36 | [TestCase(23, Description = "It was 23")]
37 | [TestCase(29, Description = "It was 29")]
38 | [TestCase(31, Description = "It was 31")]
39 | [TestCase(37, Description = "It was 37")]
40 | [TestCase(41, Description = "It was 41")]
41 | [TestCase(43, Description = "It was 43")]
42 | [TestCase(47, Description = "It was 47")]
43 | [TestCase(53, Description = "It was 53")]
44 | [TestCase(59, Description = "It was 59")]
45 | [TestCase(61, Description = "It was 61")]
46 | [TestCase(67, Description = "It was 67")]
47 | [TestCase(71, Description = "It was 71")]
48 | [TestCase(73, Description = "It was 73")]
49 | [TestCase(79, Description = "It was 79")]
50 | [TestCase(83, Description = "It was 83")]
51 | [TestCase(89, Description = "It was 89")]
52 | [TestCase(97, Description = "It was 97")]
53 | public void PrimeNumbersShouldBePrimeNumbers(int number)
54 | {
55 | Assert.IsTrue(new FizzBuzzWhizer().IsPrime(number));
56 | }
57 |
58 | [Test]
59 | [TestCase(9, Description = "It was 9")]
60 | [TestCase(21, Description = "It was 21")]
61 | [TestCase(27, Description = "It was 27")]
62 | public void ShouldNotBePrimeNumbers(int number)
63 | {
64 | Assert.IsFalse(new FizzBuzzWhizer().IsPrime(number));
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/Katas.Pager/Katas.Pager.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {D7AA66BD-F943-4AB3-9D6D-4253FED9331F}
8 | Library
9 | Properties
10 | Katas.Pager
11 | Katas.Pager
12 | v4.5
13 | 512
14 |
15 |
16 | true
17 | full
18 | false
19 | bin\Debug\
20 | DEBUG;TRACE
21 | prompt
22 | 4
23 |
24 |
25 | pdbonly
26 | true
27 | bin\Release\
28 | TRACE
29 | prompt
30 | 4
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
53 |
--------------------------------------------------------------------------------
/Katas.BankTransfer/Specs/AccountSpecs.cs:
--------------------------------------------------------------------------------
1 | using Katas.BankTransfer.Code;
2 | using NUnit.Framework;
3 |
4 | namespace Katas.BankTransfer.Specs
5 | {
6 | [TestFixture]
7 | public class AccountSpecs
8 | {
9 | private Account payer;
10 | private Account payee;
11 |
12 | [SetUp]
13 | public virtual void SetUp()
14 | {
15 | payee = new Account(1);
16 | payer = new Account(2);
17 | payer.Balance = 200;
18 | }
19 |
20 | [Test]
21 | public void Transfer_PayerBalanceShouldBeReducedByAmountOfTransaction()
22 | {
23 | payer.Transfer(50, payee);
24 | Assert.AreEqual(150, payer.Balance);
25 | }
26 |
27 | [Test]
28 | public void Transfer_PayeeBalanceShouldBeIncreasedByAmountOfTransaction()
29 | {
30 | payer.Transfer(50, payee);
31 | Assert.AreEqual(50, payee.Balance);
32 | }
33 |
34 | [Test]
35 | public void Transfer_TransactionShouldBeRecordedAsDebitInPayerTransactionHistory()
36 | {
37 | payer.Transfer(50, payee);
38 |
39 | Assert.AreEqual(1, payer.Transactions.Count);
40 | Transaction transaction = payer.Transactions[0];
41 | Assert.AreEqual("Debit", transaction.Type);
42 | Assert.AreEqual(payee, transaction.OtherAccount);
43 | Assert.AreEqual(50, transaction.Amount);
44 | }
45 |
46 | [Test]
47 | public void Transfer_TransactionShouldBeRecordedAsCreditInPayeeTransactionHistory()
48 | {
49 | payer.Transfer(50, payee);
50 |
51 | Assert.AreEqual(1, payee.Transactions.Count);
52 | Transaction transaction = payee.Transactions[0];
53 | Assert.AreEqual("Credit", transaction.Type);
54 | Assert.AreEqual(payer, transaction.OtherAccount);
55 | Assert.AreEqual(50, transaction.Amount);
56 | }
57 |
58 | [Test]
59 | public void TransactionHistory_ShouldBeAbleToQueryToOrFromAccount()
60 | {
61 | payer.Transactions.Add(new Transaction("Credit", payee, 100));
62 | payer.Transactions.Add(new Transaction("Debit", payee, 100));
63 | payer.Transactions.Add(new Transaction("Credit", payee, 100));
64 | payer.Transactions.Add(new Transaction("Debit", new Account(3), 100));
65 |
66 | var payerResults = payer.GetTransactionsWhere("Debit", payee);
67 | Assert.AreEqual(1, payerResults.Count);
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/Katas.Dojo.Core/Katas.Dojo.Core.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {D74BF109-B03F-499B-ACB5-ED8FA315E308}
8 | Library
9 | Properties
10 | Katas.Dojo.Core
11 | Katas.Dojo.Core
12 | v4.5.2
13 | 512
14 |
15 |
16 | true
17 | full
18 | false
19 | bin\Debug\
20 | DEBUG;TRACE
21 | prompt
22 | 4
23 |
24 |
25 | pdbonly
26 | true
27 | bin\Release\
28 | TRACE
29 | prompt
30 | 4
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
53 |
--------------------------------------------------------------------------------
/Katas.StringCalculator/StringCalculatorSpecs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentAssertions;
3 | using NUnit.Framework;
4 |
5 | namespace Katas.StringCalculator
6 | {
7 | // An empty string returns zero
8 | //A single number returns the value
9 | //Two numbers, comma delimited, returns the sum
10 | //Two numbers, newline delimited, returns the sum
11 | //Three numbers, delimited either way, returns the sum
12 | //Negative numbers throw an exception
13 | //Numbers greater than 1000 are ignored
14 | //A single char delimiter can be defined on the first line (e.g. //# for a ‘#’ as the delimiter)
15 | //A multi char delimiter can be defined on the first line (e.g. //[###] for ‘###’ as the delimiter)
16 | //Many single or multi-char delimiters can be defined (each wrapped in square brackets)
17 |
18 | [TestFixture]
19 | public class StringCalculatorSpecs
20 | {
21 | [Test]
22 | public void Empty_string_should_return_zero()
23 | {
24 | Calculate("").Should().Be(0);
25 | }
26 |
27 | [Test]
28 | public void Single_number_should_return_its_value()
29 | {
30 | Calculate("5").Should().Be(5);
31 | }
32 |
33 | [Test]
34 | public void Two_comma_delimited_numbers_returns_the_sum()
35 | {
36 | Calculate("7,4").Should().Be(11);
37 | }
38 |
39 | [Test]
40 | public void Two_newline_delimited_numbers_returns_the_sum()
41 | {
42 | Calculate("5\n7").Should().Be(12);
43 | }
44 |
45 | [Test]
46 | public void Three_numbers_delimited_either_way_returns_the_sum()
47 | {
48 | Calculate("5\n7,119").Should().Be(131);
49 | }
50 |
51 | [Test]
52 | public void Any_negative_number_throws_an_exception()
53 | {
54 | Action action = () => Calculate("5\n7,-3");
55 | action.ShouldThrow();
56 | }
57 |
58 | [Test]
59 | public void Numbers_greater_than_1000_are_ignored()
60 | {
61 | Calculate("5\n7,1001").Should().Be(12);
62 | }
63 |
64 | [Test]
65 | public void Single_custom_delimiter_can_be_applied()
66 | {
67 | Calculate("//;\n1;2").Should().Be(3);
68 | }
69 |
70 | //[Test]
71 | //public void Multi_custom_delimiters_can_be_applied()
72 | //{
73 | // Calculate("//[###]\n1###2").Should().Be(3);
74 | //}
75 |
76 | private int Calculate(string numbers)
77 | {
78 | var calculator = new Calculator();
79 | return calculator.Add(numbers);
80 | }
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/Katas.StringCalculator/readme.md:
--------------------------------------------------------------------------------
1 | # String Calculator Kata #
2 |
3 | Source: [Roy Osherove](http://osherove.com/tdd-kata-1/)
4 |
5 | The essence is a method that, given a delimited string, returns the sum of the values.
6 |
7 | 1. Create a simple String calculator with a method `int Add(string numbers)`
8 | - The method can take 0, 1 or 2 numbers, and will return their sum (for an empty string it will return `0`) for example `“”` or `“1”` or `“1,2”`
9 | - Start with the simplest test case of an empty string and move to 1 and two numbers
10 | - Remember to solve things as simply as possible so that you force yourself to write tests you did not think about
11 | - Remember to refactor after each passing test
12 | 1. Allow the Add method to handle an unknown amount of numbers
13 | 1. Allow the Add method to handle new lines between numbers (instead of commas).
14 | - the following input is ok: “1\n2,3” (will equal 6)
15 | - the following input is NOT ok: “1,\n” (not need to prove it - just clarifying)
16 | 1. Support different delimiters
17 | - to change a delimiter, the beginning of the string will contain a separate line that looks like this:
18 | `“//[delimiter]\n[numbers…]”`
19 | - for example `“//;\n1;2”` should return three where the default delimiter is `‘;’` .
20 | - the first line is optional. All existing scenarios should still be supported.
21 | 1. Calling Add with a negative number will throw an exception `“negatives not allowed”` - and the negative that was passed.if there are multiple negatives, show all of them in the exception message
22 |
23 | Stop here if you are a beginner. Continue if you can finish the steps so far in less than 30 minutes.
24 |
25 | 1. Numbers bigger than 1000 should be ignored, so adding 2 + 1001 = 2
26 | 1. Delimiters can be of any length with the following format: `“//[delimiter]\n” `for example: `“//[***]\n1***2***3”` should return `6`
27 | 1. Allow multiple delimiters like this: “//[delim1][delim2]\n” for example “//[*][%]\n1*2%3” should return 6.
28 | 1. Make sure you can also handle multiple delimiters with length longer than one char
29 |
30 | ## Suggested Tests ##
31 | Here is a suggested list of tests (from [Peter Provost](http://www.peterprovost.org/blog/2012/05/02/kata-the-only-way-to-learn-tdd)):
32 |
33 | 1. An empty string returns zero
34 | 1. A single number returns the value
35 | 1. Two numbers, comma delimited, returns the sum
36 | 1. Two numbers, newline delimited, returns the sum
37 | 1. Three numbers, delimited either way, returns the sum
38 | 1. Negative numbers throw an exception
39 | 1. Numbers greater than 1000 are ignored
40 | 1. A single char delimiter can be defined on the first line (e.g. //# for a ‘#’ as the delimiter)
41 | 1. A multi char delimiter can be defined on the first line (e.g. //[###] for ‘###’ as the delimiter)
42 | 1. Many single or multi-char delimiters can be defined (each wrapped in square brackets)
43 |
44 |
--------------------------------------------------------------------------------
/Katas.FizzBuzz/Katas.FizzBuzz.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {501917BB-B096-47ED-BECB-AAD8BD94C55D}
9 | Library
10 | Properties
11 | Katas.FizzBuzz
12 | Katas.FizzBuzz
13 | v4.0
14 | 512
15 | ..\
16 | true
17 |
18 |
19 | true
20 | full
21 | false
22 | bin\Debug\
23 | DEBUG;TRACE
24 | prompt
25 | 4
26 |
27 |
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 |
37 | ..\packages\NUnit.3.2.1\lib\net40\nunit.framework.dll
38 | True
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
66 |
--------------------------------------------------------------------------------
/Katas.Fibonacci/Katas.Fibonacci.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {09E532FE-B60F-40A2-8E4B-8FE53946945C}
9 | Library
10 | Properties
11 | Katas.Fibonacci
12 | Katas.Fibonacci
13 | v4.0
14 | 512
15 | ..\
16 | true
17 |
18 |
19 | true
20 | full
21 | false
22 | bin\Debug\
23 | DEBUG;TRACE
24 | prompt
25 | 4
26 |
27 |
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 |
37 | ..\packages\NUnit.3.2.1\lib\net40\nunit.framework.dll
38 | True
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
66 |
--------------------------------------------------------------------------------
/Katas.BankTransfer/Katas.BankTransfer.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {8C11C846-DBCD-4305-91EA-625267442041}
9 | Library
10 | Properties
11 | Katas.BankTransfer
12 | Katas.BankTransfer
13 | v4.0
14 | 512
15 | ..\
16 | true
17 |
18 |
19 | true
20 | full
21 | false
22 | bin\Debug\
23 | DEBUG;TRACE
24 | prompt
25 | 4
26 |
27 |
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 |
37 | ..\packages\NUnit.3.2.1\lib\net40\nunit.framework.dll
38 | True
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
66 |
--------------------------------------------------------------------------------
/Katas.StringCalculator/StringCalculatorKata.txt:
--------------------------------------------------------------------------------
1 | this kata, made popular by Roy Osherove, comes with a precise set of steps to
2 | follow.
3 | The essence is a method that given a delimited string,
4 | returns the sum of the values.
5 | I’ve always preferred my kata to define the tests I will follow every time
6 | through the exercise, so here are the tests I use for this one:
7 |
8 | An empty string returns zero
9 | A single number returns the value
10 | Two numbers, comma delimited, returns the sum
11 | Two numbers, newline delimited, returns the sum
12 | Three numbers, delimited either way, returns the sum
13 | Negative numbers throw an exception
14 | Numbers greater than 1000 are ignored
15 | A single char delimiter can be defined on the first line (e.g. //# for a ‘#’ as the delimiter)
16 | A multi char delimiter can be defined on the first line (e.g. //[###] for ‘###’ as the delimiter)
17 | Many single or multi-char delimiters can be defined (each wrapped in square brackets)
18 | I rarely bother with Test #10 when I do it, because it feels like a big step to take all at once, but Roy does include it in his definition, and I have it in my kata notebook.
19 |
20 | Here is Roy’s original description of the kata
21 |
22 | Before you start:
23 |
24 |
25 | Try not to read ahead.
26 | Do one task at a time. The trick is to learn to work incrementally.
27 | Make sure you only test for correct inputs. there is no need to test for invalid inputs for this kata
28 |
29 |
30 | String Calculator
31 |
32 | Create a simple String calculator with a method int Add(string numbers)
33 | The method can take 0, 1 or 2 numbers, and will return their sum (for an empty string it will return 0) for example “” or “1” or “1,2”
34 | Start with the simplest test case of an empty string and move to 1 and two numbers
35 | Remember to solve things as simply as possible so that you force yourself to write tests you did not think about
36 | Remember to refactor after each passing test
37 | Allow the Add method to handle an unknown amount of numbers
38 | Allow the Add method to handle new lines between numbers (instead of commas).
39 | the following input is ok: “1\n2,3” (will equal 6)
40 | the following input is NOT ok: “1,\n” (not need to prove it - just clarifying)
41 | Support different delimiters
42 | to change a delimiter, the beginning of the string will contain a separate line that looks like this: “//[delimiter]\n[numbers…]” for example “//;\n1;2” should return three where the default delimiter is ‘;’ .
43 | the first line is optional. all existing scenarios should still be supported
44 | Calling Add with a negative number will throw an exception “negatives not allowed” - and the negative that was passed.if there are multiple negatives, show all of them in the exception message
45 | stop here if you are a beginner. Continue if you can finish the steps so far in less than 30 minutes.
46 | Numbers bigger than 1000 should be ignored, so adding 2 + 1001 = 2
47 | Delimiters can be of any length with the following format: “//[delimiter]\n” for example: “//[***]\n1***2***3” should return 6
48 | Allow multiple delimiters like this: “//[delim1][delim2]\n” for example “//[*][%]\n1*2%3” should return 6.
49 | make sure you can also handle multiple delimiters with length longer than one char
50 |
--------------------------------------------------------------------------------
/Katas.FizzBuzzWhiz/Katas.FizzBuzzWhiz.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {1FEB5512-9367-4FDD-B7F2-AFCF83CA9615}
9 | Library
10 | Properties
11 | Katas.FizzBuzzWhiz
12 | Katas.FizzBuzzWhiz
13 | v4.0
14 | 512
15 | ..\
16 | true
17 |
18 |
19 | true
20 | full
21 | false
22 | bin\Debug\
23 | DEBUG;TRACE
24 | prompt
25 | 4
26 |
27 |
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 |
37 | ..\packages\NUnit.3.2.1\lib\net40\nunit.framework.dll
38 | True
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
67 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.sln.docstates
8 |
9 | # Build results
10 | [Dd]ebug/
11 | [Dd]ebugPublic/
12 | [Rr]elease/
13 | x64/
14 | build/
15 | bld/
16 | [Bb]in/
17 | [Oo]bj/
18 |
19 | # MSTest test Results
20 | [Tt]est[Rr]esult*/
21 | [Bb]uild[Ll]og.*
22 |
23 | #NUNIT
24 | *.VisualState.xml
25 | TestResult.xml
26 |
27 | # Build Results of an ATL Project
28 | [Dd]ebugPS/
29 | [Rr]eleasePS/
30 | dlldata.c
31 |
32 | *_i.c
33 | *_p.c
34 | *_i.h
35 | *.ilk
36 | *.meta
37 | *.obj
38 | *.pch
39 | *.pdb
40 | *.pgc
41 | *.pgd
42 | *.rsp
43 | *.sbr
44 | *.tlb
45 | *.tli
46 | *.tlh
47 | *.tmp
48 | *.tmp_proj
49 | *.log
50 | *.vspscc
51 | *.vssscc
52 | .builds
53 | *.pidb
54 | *.svclog
55 | *.scc
56 |
57 | # Chutzpah Test files
58 | _Chutzpah*
59 |
60 | # Visual C++ cache files
61 | ipch/
62 | *.aps
63 | *.ncb
64 | *.opensdf
65 | *.sdf
66 | *.cachefile
67 |
68 | # Visual Studio profiler
69 | *.psess
70 | *.vsp
71 | *.vspx
72 |
73 | # TFS 2012 Local Workspace
74 | $tf/
75 |
76 | # Guidance Automation Toolkit
77 | *.gpState
78 |
79 | # ReSharper is a .NET coding add-in
80 | _ReSharper*/
81 | *.[Rr]e[Ss]harper
82 | *.DotSettings.user
83 |
84 | # JustCode is a .NET coding addin-in
85 | .JustCode
86 |
87 | # TeamCity is a build add-in
88 | _TeamCity*
89 |
90 | # DotCover is a Code Coverage Tool
91 | *.dotCover
92 |
93 | # NCrunch
94 | *.ncrunch*
95 | _NCrunch_*
96 | .*crunch*.local.xml
97 |
98 | # MightyMoose
99 | *.mm.*
100 | AutoTest.Net/
101 |
102 | # Web workbench (sass)
103 | .sass-cache/
104 |
105 | # Installshield output folder
106 | [Ee]xpress/
107 |
108 | # DocProject is a documentation generator add-in
109 | DocProject/buildhelp/
110 | DocProject/Help/*.HxT
111 | DocProject/Help/*.HxC
112 | DocProject/Help/*.hhc
113 | DocProject/Help/*.hhk
114 | DocProject/Help/*.hhp
115 | DocProject/Help/Html2
116 | DocProject/Help/html
117 |
118 | # Click-Once directory
119 | publish/
120 |
121 | # Publish Web Output
122 | *.[Pp]ublish.xml
123 | *.azurePubxml
124 |
125 | # NuGet Packages Directory
126 | packages/
127 | ## TODO: If the tool you use requires repositories.config uncomment the next line
128 | #!packages/repositories.config
129 |
130 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
131 | # This line needs to be after the ignore of the build folder (and the packages folder if the line above has been uncommented)
132 | !packages/build/
133 |
134 | # Windows Azure Build Output
135 | csx/
136 | *.build.csdef
137 |
138 | # Windows Store app package directory
139 | AppPackages/
140 |
141 | # Others
142 | sql/
143 | *.Cache
144 | ClientBin/
145 | [Ss]tyle[Cc]op.*
146 | ~$*
147 | *~
148 | *.dbmdl
149 | *.dbproj.schemaview
150 | *.pfx
151 | *.publishsettings
152 | node_modules/
153 |
154 | # RIA/Silverlight projects
155 | Generated_Code/
156 |
157 | # Backup & report files from converting an old project file to a newer
158 | # Visual Studio version. Backup files are not needed, because we have git ;-)
159 | _UpgradeReport_Files/
160 | Backup*/
161 | UpgradeLog*.XML
162 | UpgradeLog*.htm
163 |
164 | # SQL Server files
165 | *.mdf
166 | *.ldf
167 |
168 | # Business Intelligence projects
169 | *.rdl.data
170 | *.bim.layout
171 | *.bim_*.settings
172 |
173 | # Microsoft Fakes
174 | FakesAssemblies/
175 |
--------------------------------------------------------------------------------
/Katas.LeapYear/Katas.LeapYear.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {BD1C6943-3414-4A7E-A6AD-BE8EAACAA2B4}
8 | Library
9 | Properties
10 | Katas.LeapYear
11 | Katas.LeapYear
12 | v4.5.2
13 | 512
14 |
15 |
16 | true
17 | full
18 | false
19 | bin\Debug\
20 | DEBUG;TRACE
21 | prompt
22 | 4
23 |
24 |
25 | pdbonly
26 | true
27 | bin\Release\
28 | TRACE
29 | prompt
30 | 4
31 |
32 |
33 |
34 | ..\packages\FluentAssertions.4.6.3\lib\net45\FluentAssertions.dll
35 | True
36 |
37 |
38 | ..\packages\FluentAssertions.4.6.3\lib\net45\FluentAssertions.Core.dll
39 | True
40 |
41 |
42 | ..\packages\NUnit.3.2.1\lib\net45\nunit.framework.dll
43 | True
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
71 |
--------------------------------------------------------------------------------
/Katas.ConwayGameOfLife/Katas.ConwayGameOfLife.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {F284CF9E-3FAB-42EF-9F1D-B883BFADB99D}
8 | Library
9 | Properties
10 | Katas.ConwayGameOfLife
11 | Katas.ConwayGameOfLife
12 | v4.5.2
13 | 512
14 |
15 |
16 | true
17 | full
18 | false
19 | bin\Debug\
20 | DEBUG;TRACE
21 | prompt
22 | 4
23 |
24 |
25 | pdbonly
26 | true
27 | bin\Release\
28 | TRACE
29 | prompt
30 | 4
31 |
32 |
33 |
34 | ..\packages\FluentAssertions.4.6.3\lib\net45\FluentAssertions.dll
35 | True
36 |
37 |
38 | ..\packages\FluentAssertions.4.6.3\lib\net45\FluentAssertions.Core.dll
39 | True
40 |
41 |
42 | ..\packages\NUnit.3.2.1\lib\net45\nunit.framework.dll
43 | True
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
71 |
--------------------------------------------------------------------------------
/Katas.Anagrams/Katas.Anagrams.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {CB464400-9FED-45E6-8D3E-47B5C5A90D61}
8 | Library
9 | Properties
10 | Katas.Anagrams
11 | Katas.Anagrams
12 | v4.5
13 | 512
14 | ..\
15 | true
16 |
17 |
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 | ..\packages\FluentAssertions.4.6.3\lib\net45\FluentAssertions.dll
37 | True
38 |
39 |
40 | ..\packages\FluentAssertions.4.6.3\lib\net45\FluentAssertions.Core.dll
41 | True
42 |
43 |
44 | ..\packages\NUnit.3.2.1\lib\net45\nunit.framework.dll
45 | True
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
72 |
--------------------------------------------------------------------------------
/Katas.PrimeNumbers/Katas.PrimeNumbers.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {9704A03E-EFC6-4E34-B329-708BA1CA342A}
8 | Library
9 | Properties
10 | Katas.PrimeNumbers
11 | Katas.PrimeNumbers
12 | v4.5
13 | 512
14 | ..\
15 | true
16 |
17 |
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 | ..\packages\FluentAssertions.4.6.3\lib\net45\FluentAssertions.dll
37 | True
38 |
39 |
40 | ..\packages\FluentAssertions.4.6.3\lib\net45\FluentAssertions.Core.dll
41 | True
42 |
43 |
44 | ..\packages\NUnit.3.2.1\lib\net45\nunit.framework.dll
45 | True
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
72 |
--------------------------------------------------------------------------------
/Katas.StringCalculator/Katas.StringCalculator.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {4922A721-B8CC-4262-9A17-CED74831CB78}
8 | Library
9 | Properties
10 | Katas.StringCalculator
11 | Katas.StringCalculator
12 | v4.5
13 | 512
14 | ..\
15 | true
16 |
17 |
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 | ..\packages\FluentAssertions.4.6.3\lib\net45\FluentAssertions.dll
37 | True
38 |
39 |
40 | ..\packages\FluentAssertions.4.6.3\lib\net45\FluentAssertions.Core.dll
41 | True
42 |
43 |
44 | ..\packages\NUnit.3.2.1\lib\net45\nunit.framework.dll
45 | True
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
75 |
--------------------------------------------------------------------------------
/Katas.WordCounter/Katas.WordCounter.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {F9608D49-F747-4DA1-8724-1D7B3F40710F}
8 | Library
9 | Properties
10 | Katas.WordCounter
11 | Katas.WordCounter
12 | v4.0
13 | 512
14 | ..\
15 | true
16 |
17 |
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 | ..\packages\FluentAssertions.4.6.3\lib\net40\FluentAssertions.dll
37 | True
38 |
39 |
40 | ..\packages\FluentAssertions.4.6.3\lib\net40\FluentAssertions.Core.dll
41 | True
42 |
43 |
44 | ..\packages\NUnit.3.2.1\lib\net40\nunit.framework.dll
45 | True
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
76 |
--------------------------------------------------------------------------------
/Katas.FibonacciSequence/Katas.FibonacciSequence.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {BC979930-D00F-43F0-A06B-A5935860A0E3}
8 | Library
9 | Properties
10 | Katas.FibonacciSequence
11 | Katas.FibonacciSequence
12 | v4.5
13 | 512
14 | ..\
15 | true
16 |
17 |
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 | ..\packages\FluentAssertions.4.6.3\lib\net45\FluentAssertions.dll
37 | True
38 |
39 |
40 | ..\packages\FluentAssertions.4.6.3\lib\net45\FluentAssertions.Core.dll
41 | True
42 |
43 |
44 | ..\packages\NUnit.3.2.1\lib\net45\nunit.framework.dll
45 | True
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
75 |
--------------------------------------------------------------------------------
/Katas.Dojo.Specs/Katas.Dojo.Specs.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {D68EF31E-94C0-4163-B8FD-05A4D6A0F2A0}
8 | Library
9 | Properties
10 | Katas.Dojo.Specs
11 | Katas.Dojo.Specs
12 | v4.5.2
13 | 512
14 |
15 |
16 | true
17 | full
18 | false
19 | bin\Debug\
20 | DEBUG;TRACE
21 | prompt
22 | 4
23 |
24 |
25 | pdbonly
26 | true
27 | bin\Release\
28 | TRACE
29 | prompt
30 | 4
31 |
32 |
33 |
34 | ..\packages\FluentAssertions.4.6.3\lib\net45\FluentAssertions.dll
35 | True
36 |
37 |
38 | ..\packages\FluentAssertions.4.6.3\lib\net45\FluentAssertions.Core.dll
39 | True
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | ..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll
51 | True
52 |
53 |
54 | ..\packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll
55 | True
56 |
57 |
58 | ..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll
59 | True
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
76 |
--------------------------------------------------------------------------------
/Katas.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25123.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Katas.PrimeNumbers", "Katas.PrimeNumbers\Katas.PrimeNumbers.csproj", "{9704A03E-EFC6-4E34-B329-708BA1CA342A}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Katas.FibonacciSequence", "Katas.FibonacciSequence\Katas.FibonacciSequence.csproj", "{BC979930-D00F-43F0-A06B-A5935860A0E3}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Katas.BankTransfer", "Katas.BankTransfer\Katas.BankTransfer.csproj", "{8C11C846-DBCD-4305-91EA-625267442041}"
11 | EndProject
12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Katas.Fibonacci", "Katas.Fibonacci\Katas.Fibonacci.csproj", "{09E532FE-B60F-40A2-8E4B-8FE53946945C}"
13 | EndProject
14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Katas.FizzBuzz", "Katas.FizzBuzz\Katas.FizzBuzz.csproj", "{501917BB-B096-47ED-BECB-AAD8BD94C55D}"
15 | EndProject
16 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Katas.FizzBuzzWhiz", "Katas.FizzBuzzWhiz\Katas.FizzBuzzWhiz.csproj", "{1FEB5512-9367-4FDD-B7F2-AFCF83CA9615}"
17 | EndProject
18 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{D3ED4EA5-28F6-4983-9135-C7232BFCBA94}"
19 | ProjectSection(SolutionItems) = preProject
20 | .nuget\NuGet.Config = .nuget\NuGet.Config
21 | .nuget\NuGet.exe = .nuget\NuGet.exe
22 | .nuget\NuGet.targets = .nuget\NuGet.targets
23 | EndProjectSection
24 | EndProject
25 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Katas.StringCalculator", "Katas.StringCalculator\Katas.StringCalculator.csproj", "{4922A721-B8CC-4262-9A17-CED74831CB78}"
26 | EndProject
27 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Katas.WordCounter", "Katas.WordCounter\Katas.WordCounter.csproj", "{F9608D49-F747-4DA1-8724-1D7B3F40710F}"
28 | EndProject
29 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Katas.Pager", "Katas.Pager\Katas.Pager.csproj", "{D7AA66BD-F943-4AB3-9D6D-4253FED9331F}"
30 | EndProject
31 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Katas.Anagrams", "Katas.Anagrams\Katas.Anagrams.csproj", "{CB464400-9FED-45E6-8D3E-47B5C5A90D61}"
32 | EndProject
33 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Katas.ConwayGameOfLife", "Katas.ConwayGameOfLife\Katas.ConwayGameOfLife.csproj", "{F284CF9E-3FAB-42EF-9F1D-B883BFADB99D}"
34 | EndProject
35 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Katas.LeapYear", "Katas.LeapYear\Katas.LeapYear.csproj", "{BD1C6943-3414-4A7E-A6AD-BE8EAACAA2B4}"
36 | EndProject
37 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Katas.Dojo.Core", "Katas.Dojo.Core\Katas.Dojo.Core.csproj", "{D74BF109-B03F-499B-ACB5-ED8FA315E308}"
38 | EndProject
39 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dojo", "Dojo", "{57274D88-9C88-4044-AFBC-A615F0FCE6CA}"
40 | EndProject
41 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Katas", "Katas", "{00793B81-5E4A-4EC5-AB09-874098AA5626}"
42 | EndProject
43 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Katas.Dojo.Specs", "Katas.Dojo.Specs\Katas.Dojo.Specs.csproj", "{D68EF31E-94C0-4163-B8FD-05A4D6A0F2A0}"
44 | EndProject
45 | Global
46 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
47 | Debug|Any CPU = Debug|Any CPU
48 | Release|Any CPU = Release|Any CPU
49 | EndGlobalSection
50 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
51 | {9704A03E-EFC6-4E34-B329-708BA1CA342A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
52 | {9704A03E-EFC6-4E34-B329-708BA1CA342A}.Debug|Any CPU.Build.0 = Debug|Any CPU
53 | {9704A03E-EFC6-4E34-B329-708BA1CA342A}.Release|Any CPU.ActiveCfg = Release|Any CPU
54 | {9704A03E-EFC6-4E34-B329-708BA1CA342A}.Release|Any CPU.Build.0 = Release|Any CPU
55 | {BC979930-D00F-43F0-A06B-A5935860A0E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
56 | {BC979930-D00F-43F0-A06B-A5935860A0E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
57 | {BC979930-D00F-43F0-A06B-A5935860A0E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
58 | {BC979930-D00F-43F0-A06B-A5935860A0E3}.Release|Any CPU.Build.0 = Release|Any CPU
59 | {8C11C846-DBCD-4305-91EA-625267442041}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
60 | {8C11C846-DBCD-4305-91EA-625267442041}.Debug|Any CPU.Build.0 = Debug|Any CPU
61 | {8C11C846-DBCD-4305-91EA-625267442041}.Release|Any CPU.ActiveCfg = Release|Any CPU
62 | {8C11C846-DBCD-4305-91EA-625267442041}.Release|Any CPU.Build.0 = Release|Any CPU
63 | {09E532FE-B60F-40A2-8E4B-8FE53946945C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
64 | {09E532FE-B60F-40A2-8E4B-8FE53946945C}.Debug|Any CPU.Build.0 = Debug|Any CPU
65 | {09E532FE-B60F-40A2-8E4B-8FE53946945C}.Release|Any CPU.ActiveCfg = Release|Any CPU
66 | {09E532FE-B60F-40A2-8E4B-8FE53946945C}.Release|Any CPU.Build.0 = Release|Any CPU
67 | {501917BB-B096-47ED-BECB-AAD8BD94C55D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
68 | {501917BB-B096-47ED-BECB-AAD8BD94C55D}.Debug|Any CPU.Build.0 = Debug|Any CPU
69 | {501917BB-B096-47ED-BECB-AAD8BD94C55D}.Release|Any CPU.ActiveCfg = Release|Any CPU
70 | {501917BB-B096-47ED-BECB-AAD8BD94C55D}.Release|Any CPU.Build.0 = Release|Any CPU
71 | {1FEB5512-9367-4FDD-B7F2-AFCF83CA9615}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
72 | {1FEB5512-9367-4FDD-B7F2-AFCF83CA9615}.Debug|Any CPU.Build.0 = Debug|Any CPU
73 | {1FEB5512-9367-4FDD-B7F2-AFCF83CA9615}.Release|Any CPU.ActiveCfg = Release|Any CPU
74 | {1FEB5512-9367-4FDD-B7F2-AFCF83CA9615}.Release|Any CPU.Build.0 = Release|Any CPU
75 | {4922A721-B8CC-4262-9A17-CED74831CB78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
76 | {4922A721-B8CC-4262-9A17-CED74831CB78}.Debug|Any CPU.Build.0 = Debug|Any CPU
77 | {4922A721-B8CC-4262-9A17-CED74831CB78}.Release|Any CPU.ActiveCfg = Release|Any CPU
78 | {4922A721-B8CC-4262-9A17-CED74831CB78}.Release|Any CPU.Build.0 = Release|Any CPU
79 | {F9608D49-F747-4DA1-8724-1D7B3F40710F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
80 | {F9608D49-F747-4DA1-8724-1D7B3F40710F}.Debug|Any CPU.Build.0 = Debug|Any CPU
81 | {F9608D49-F747-4DA1-8724-1D7B3F40710F}.Release|Any CPU.ActiveCfg = Release|Any CPU
82 | {F9608D49-F747-4DA1-8724-1D7B3F40710F}.Release|Any CPU.Build.0 = Release|Any CPU
83 | {D7AA66BD-F943-4AB3-9D6D-4253FED9331F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
84 | {D7AA66BD-F943-4AB3-9D6D-4253FED9331F}.Debug|Any CPU.Build.0 = Debug|Any CPU
85 | {D7AA66BD-F943-4AB3-9D6D-4253FED9331F}.Release|Any CPU.ActiveCfg = Release|Any CPU
86 | {D7AA66BD-F943-4AB3-9D6D-4253FED9331F}.Release|Any CPU.Build.0 = Release|Any CPU
87 | {CB464400-9FED-45E6-8D3E-47B5C5A90D61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
88 | {CB464400-9FED-45E6-8D3E-47B5C5A90D61}.Debug|Any CPU.Build.0 = Debug|Any CPU
89 | {CB464400-9FED-45E6-8D3E-47B5C5A90D61}.Release|Any CPU.ActiveCfg = Release|Any CPU
90 | {CB464400-9FED-45E6-8D3E-47B5C5A90D61}.Release|Any CPU.Build.0 = Release|Any CPU
91 | {F284CF9E-3FAB-42EF-9F1D-B883BFADB99D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
92 | {F284CF9E-3FAB-42EF-9F1D-B883BFADB99D}.Debug|Any CPU.Build.0 = Debug|Any CPU
93 | {F284CF9E-3FAB-42EF-9F1D-B883BFADB99D}.Release|Any CPU.ActiveCfg = Release|Any CPU
94 | {F284CF9E-3FAB-42EF-9F1D-B883BFADB99D}.Release|Any CPU.Build.0 = Release|Any CPU
95 | {BD1C6943-3414-4A7E-A6AD-BE8EAACAA2B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
96 | {BD1C6943-3414-4A7E-A6AD-BE8EAACAA2B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
97 | {BD1C6943-3414-4A7E-A6AD-BE8EAACAA2B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
98 | {BD1C6943-3414-4A7E-A6AD-BE8EAACAA2B4}.Release|Any CPU.Build.0 = Release|Any CPU
99 | {D74BF109-B03F-499B-ACB5-ED8FA315E308}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
100 | {D74BF109-B03F-499B-ACB5-ED8FA315E308}.Debug|Any CPU.Build.0 = Debug|Any CPU
101 | {D74BF109-B03F-499B-ACB5-ED8FA315E308}.Release|Any CPU.ActiveCfg = Release|Any CPU
102 | {D74BF109-B03F-499B-ACB5-ED8FA315E308}.Release|Any CPU.Build.0 = Release|Any CPU
103 | {D68EF31E-94C0-4163-B8FD-05A4D6A0F2A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
104 | {D68EF31E-94C0-4163-B8FD-05A4D6A0F2A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
105 | {D68EF31E-94C0-4163-B8FD-05A4D6A0F2A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
106 | {D68EF31E-94C0-4163-B8FD-05A4D6A0F2A0}.Release|Any CPU.Build.0 = Release|Any CPU
107 | EndGlobalSection
108 | GlobalSection(SolutionProperties) = preSolution
109 | HideSolutionNode = FALSE
110 | EndGlobalSection
111 | GlobalSection(NestedProjects) = preSolution
112 | {9704A03E-EFC6-4E34-B329-708BA1CA342A} = {00793B81-5E4A-4EC5-AB09-874098AA5626}
113 | {BC979930-D00F-43F0-A06B-A5935860A0E3} = {00793B81-5E4A-4EC5-AB09-874098AA5626}
114 | {8C11C846-DBCD-4305-91EA-625267442041} = {00793B81-5E4A-4EC5-AB09-874098AA5626}
115 | {09E532FE-B60F-40A2-8E4B-8FE53946945C} = {00793B81-5E4A-4EC5-AB09-874098AA5626}
116 | {501917BB-B096-47ED-BECB-AAD8BD94C55D} = {00793B81-5E4A-4EC5-AB09-874098AA5626}
117 | {1FEB5512-9367-4FDD-B7F2-AFCF83CA9615} = {00793B81-5E4A-4EC5-AB09-874098AA5626}
118 | {4922A721-B8CC-4262-9A17-CED74831CB78} = {00793B81-5E4A-4EC5-AB09-874098AA5626}
119 | {F9608D49-F747-4DA1-8724-1D7B3F40710F} = {00793B81-5E4A-4EC5-AB09-874098AA5626}
120 | {D7AA66BD-F943-4AB3-9D6D-4253FED9331F} = {00793B81-5E4A-4EC5-AB09-874098AA5626}
121 | {CB464400-9FED-45E6-8D3E-47B5C5A90D61} = {00793B81-5E4A-4EC5-AB09-874098AA5626}
122 | {F284CF9E-3FAB-42EF-9F1D-B883BFADB99D} = {00793B81-5E4A-4EC5-AB09-874098AA5626}
123 | {BD1C6943-3414-4A7E-A6AD-BE8EAACAA2B4} = {00793B81-5E4A-4EC5-AB09-874098AA5626}
124 | {D74BF109-B03F-499B-ACB5-ED8FA315E308} = {57274D88-9C88-4044-AFBC-A615F0FCE6CA}
125 | {D68EF31E-94C0-4163-B8FD-05A4D6A0F2A0} = {57274D88-9C88-4044-AFBC-A615F0FCE6CA}
126 | EndGlobalSection
127 | EndGlobal
128 |
--------------------------------------------------------------------------------