Giter Site home page Giter Site logo

garora / tdd-katas Goto Github PK

View Code? Open in Web Editor NEW
718.0 51.0 191.0 3.75 MB

This repository contains Hands on Test Driven Development Katas (C#)

License: MIT License

C# 100.00%
tdd-kata csharp8 netframework dotnet-core2 dotnetcore31 nunit2 nunit3 csharp9 net5 net50

tdd-katas's Introduction

Description

Simply defines the Test Driven Development Katas. In this, lets try to create most famous katas to understand what are exactly Katas. These Katas can also be used for practicising your C# skills for Unit testing.

How to contribute:

Want to contribute? Make a pull request (PR) to develop branch. Do not make any PR to Master branch.

Explained

Nuget package: TDD Katas

For more info visit: here

Articles on TDD-Katas

Articles from the developers:

  1. Learning Test Driven Development with TDD Katas
  2. TDD-Kata practices - Obsolete

Contributors

Many thanks to all the contributors who spent their time to create Katas and write code. Their contribution is priceless, A small gratitude for their contributions:

  1. Justin Kurtz
  2. Choi Jung Hyun
  3. Mikkel Nylander Bundgaard
  4. Krzysztof Mędrela
  5. Bruno Sanches
  6. Stephanie Melnyk
  7. Saurabh Mishra
  8. John Lianoglou
  9. Mattias Josefsson
  10. Māris Krivtežs
  11. Florian Brinker
  12. Santiago Castro
  13. Sean Killeen
  14. M Farag
  15. Oleg Kainov
  16. Javier González
  17. Javier González

More flavors

Lookig for implementation in your technology? There are more flavors of the repository:

  1. TDD Katas in Java
  2. TDD Katas in JavaScript
  3. TDD Katas in Python
  4. TDD Katas in PHP

License

MIT License, refer: License info for more information.

Note: We recently upgraded our projects to .NET5.0. For previous releases, please refer to:

  1. .NETCore31
  2. .NET45

Feel free to submit pull requests with additional tests.

tdd-katas's People

Contributors

brunops avatar bryant1410 avatar chrismedrela avatar cjhnim avatar fbrinker avatar garora avatar justinkurtz avatar marisks avatar matjos avatar mikkelbu avatar moefarag avatar okainov avatar prometheas avatar saurabh9694 avatar seankilleen avatar vitota95 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tdd-katas's Issues

Create wiki page

There is a long list of katas in readme.md file and many more are in line. To make short this file, I propose to create a wiki page describing all the details about katas.

Afterwards, readme.md file would be simply contain definitions of specific kata. Lets give your hand to start this.

Thanks,
Gaurav Arora

Can't open TDD-Katas-NETCore

I've cloned latest repository and I opened the solution (TDD-Katas-project.sln)
As a result, I saw the following errors.

C:\git\github\TDD-Katas-master\Src\CSharp\Net Core\TDD-Katas-NETCore.csproj : error : The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. C:\git\github\TDD-Katas-master\Src\CSharp\Net Core\TDD-Katas-NETCore.csproj

image

Also I attached my VS2015 info.

Microsoft Visual Studio Professional 2015
Version 14.0.25424.00 Update 3
Microsoft .NET Framework
Version 4.7.02556

Installed Version: Professional

LightSwitch for Visual Studio 2015 00322-50052-59877-AA145
Microsoft LightSwitch for Visual Studio 2015

Visual Basic 2015 00322-50052-59877-AA145
Microsoft Visual Basic 2015

Visual C# 2015 00322-50052-59877-AA145
Microsoft Visual C# 2015

Visual C++ 2015 00322-50052-59877-AA145
Microsoft Visual C++ 2015

Visual F# 2015 00322-50052-59877-AA145
Microsoft Visual F# 2015

Windows Phone SDK 8.0 - ENU 00322-50052-59877-AA145
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package 7.18.00214.2
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1 (Beta8) 14.1.11107.0
ASP.NET and Web Tools 2015.1 (Beta8)

ASP.NET Web Frameworks and Tools 2012.2 4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013 5.2.40314.0
For additional information, visit http://www.asp.net/

Clang with Microsoft CodeGen 14.0.25515
Clang with Microsoft CodeGen

Command Bus, Event Stream and Async Manager Merq
Provides ICommandBus, IEventStream and IAsyncManager MEF services for loosely coupled Visual Studio extension components communication and integration.

Common Azure Tools 1.8
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Debugging Tools for Windows 10.0.15063.0
Integrates the Windows Debugger functionality (http://go.microsoft.com/fwlink/?linkid=223405) in Visual Studio.

InstallShield Limited Edition
InstallShield. For more information visit the Flexera Software website at http://www.FlexeraSoftware.com. Copyright © 2015 Flexera Software LLC. All Rights Reserved.

JavaScript Language Service 2.0
JavaScript Language Service

JavaScript Project System 2.0
JavaScript Project System

KofePackagePackage Extension 1.0
KofePackagePackage Visual Studio Extension Detailed Info

Microsoft Azure Mobile Services Tools 1.4
Microsoft Azure Mobile Services Tools

Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers

NuGet Package Manager 3.4.4
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Office Developer Tools for Visual Studio 2015 ENU 14.0.23025
Microsoft Office Developer Tools for Visual Studio 2015 ENU

PreEmptive Analytics Visualizer 1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

Python Tools for Visual Studio 2.2.50113.00
Python Tools for Visual Studio provides IntelliSense, projects, templates, Interactive windows, and other support for Python developers.

Python Tools for Visual Studio - Django Integration 2.2.50113.00
Provides templates and integration for the Django web framework.

Python Tools for Visual Studio - Profiling Support 2.2.50113.00
Profiling support for Python projects.

Sandcastle Help File Builder SHFB
Visual Studio integration for the Sandcastle Help File Builder.
https://GitHub.com/EWSoftware/SHFB

SQL Server Data Tools 14.0.60519.0
Microsoft SQL Server Data Tools

TypeScript 1.8.35.0
TypeScript tools for Visual Studio

Visual C++ for Cross Platform Mobile Development (Android) 14.0.25401.00
Visual C++ for Cross Platform Mobile Development (Android)

Visual C++ for Cross Platform Mobile Development (iOS) 14.0.25401.00
Visual C++ for Cross Platform Mobile Development (iOS)

Visual Studio Tools for Apache Cordova Update 10
Visual Studio Tools for Apache Cordova

Visual Studio Tools for Unity 2.8.0.0
Visual Studio Tools for Unity

Visual Studio Tools for Universal Windows Apps 14.0.25527.01
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Windows Driver Kit 10.0.15063.0
Headers, libraries, and tools needed to develop, debug, and test Windows drivers (msdn.microsoft.com/en-us/windows/hardware/gg487428.aspx)

Workflow Manager Tools 1.0 1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin 4.2.1.62 (680125b)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android 7.0.2.37 (ce955cc)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS 10.2.1.5 (44931ae)
Visual Studio extension to enable development for Xamarin.iOS.

Task to trace and resolve this issue:

  • Check the problem
  • Check the problem in previous versions
  • Provide solutions

Create Nuget Package

In my last seminar - I received lot of requests to create a nuget package for TDD-Katas.

Contributors detail in README.md file

This repository was created with an aim to do some tdd katas. With time, this repository grew and having many contributors. Its time to pay gratitude to all the contributors, add Contributors section in the README.MD file.

OddEven Kata

The definition of OddEven kata is a confusing, it says :

  • Print "Odd" instead of number, if the number is odd, means not divisible by 2 but not divisible by itself too

I think the definition of odd is not divisible by 2. There is no need to add the words not divisible by itself.

Include prime composite kata

Include primecompositekata .This is inherited from oddevenkata

  • Write a program that prints numbers within specified range lets say 1 to 100. If number is prime print 'prime' instead of the number. If number is composite but not even print 'composite' instead of number. Else print number. Reference(s): Prime numbers, Composite numbers, odd even.

    Steps 👍

  • Prints numbers from 1 to 100.

  • Print "Prime" instead of number, if the number is prime, means number greater than 1 that has no positive divisors other than 1 and itself.

  • Print "Composite" instead of number, if the number is composite, means number has at least one positive divisor other than one or the number itself. In other words, a composite number is any integer greater than one that is not a prime number but not a even number. An even number is an integer is even if it is 'evenly divisible' by two.

  • Print number, if it does not meet above two conditions.

  • Make method to accept any number of range [currently we have 1 to 100].

  • Create a new method to check Prime/Composite of a single supplied method.

HarryPotterKata - Issue with result

Hello,

First of all, thanks for gathering this nice collection of katas.

On the HarryPotterKata, the description mentions

	2 copies of the first book
	2 copies of the second book
	2 copies of the third book
	1 copy of the fourth book
	1 copy of the fifth book

	Answer: 51.20 EUR. We apply 2 times a discount for four books. 4 * 8 * 0.8 * 2 = 51.

While performing the kata, I have ended up with the following answer: 5 * 8 * 0.75 + 3 * 8 * 0.9 = 51.60 which was the previous result before you edited the file 🤔

Here's my result : gquemener/tdd-katas#1 and another one that ends up with the same result.

Would it be possible that the expected result is 51.60 €, or are we both wrong?

.NET 5

.NET 5 is here and .NET 6 is coming soon.
Lets upgrade our code to current stable release of .NET 5

Add new Kata based on image file- jpeg

There are several way to extract image files, extracting stream is the way mostly liked. Lets create a Kata called Extract image file by stream kata

  • Study problem
  • Create cases
  • Approach for implementation
  • Create code and implement
  • PUTTING ON HOLD - shall pick it in future
    Here are the high-level steps to go with this:
  1. Name kata
  2. Create a description
  3. Steps to implementation
  4. Create various cases

Here are the high-level steps to go with this:

Harry Potter kata example is wrong

Hello,

First of all, thank you for this repository, it is great to have that many katas together and well explained.

While doing the Harry Potter kata I found out that the solution to the example that you proposed should have been 51.20 instead of 51.60. To arrive at this solution I apply a discount of 0.8 (buying four books) 2 times.

The calculation is 4 * 8 * 0.8 * 2 = 51.20

To arrive at the result of 51.60 we should apply a discount to 5 books and later to 3. However, this is more expensive than the one above.

Upgrade .NET6

Its time to upgrade our Katas to NET6. If anyone wants to add stuffs, please comment, I have created a new Branch NET6.0.

Happy TDD-Katas :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.