Skip to content

jhannes/csharp-kata-numbers-as-text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Kata: Numbers as words

This kata is originally from codingdojo.org:

It occurs now and then in real life that people want to write about money, especially about a certain amount of money. If it comes to cheques or contracts for example some nations have laws that state that you should write out the amount in words additionally to the amount in numbers to avoid fraud and mistakes. So if you want to transfer 745 $ to someone via cheque you have to fill out two fields:

745.00 $ (amount in numbers)

seven hundred and fourty five dollars (amount in words)

Example assertion (using extension methods)

    public void ShouldTranslateOne()
    {
        Assert.Equal("en", 1.ToWords());
    }

Getting started with a new project

Download dotnet SDK and Visual Studio Code.

  1. dotnet new sln
  2. dotnet new classlib -o NumbersInWords
  3. dotnet sln add ./NumbersInWords/NumbersInWords.csproj
  4. dotnet new xunit -o NumbersInWords.Tests
  5. dotnet sln add ./NumbersInWords.Tests/NumbersInWords.Tests.csproj
  6. dotnet add ./NumbersInWords.Tests/NumbersInWords.Tests.csproj reference ./NumbersInWords/NumbersInWords.csproj
  7. dotnet watch --project ./NumbersInWords.Test/NumbersInWords.Test.csproj test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published