Example #1
0
 public void SetUp()
 {
     _digitWriter    = new DigitWriter(BritishNumbersDictionary.DigitDictionary());
     _tensWriter     = new TensWriter(BritishNumbersDictionary.TensDictionary(), _digitWriter);
     _hundredsWriter = new HundredsWriter(_tensWriter);
     _unitWriter     = new UnitWriter(BritishNumbersDictionary.UnitsDictionary(), _hundredsWriter);
 }
Example #2
0
        public void Write(int numberToWrite, string expectedWrittenNumber)
        {
            var tensWriter = new TensWriter(BritishNumbersDictionary.TensDictionary(), _digitWriter);

            string writtenNumber = tensWriter.Write(numberToWrite);

            Assert.AreEqual(expectedWrittenNumber, writtenNumber);
        }
Example #3
0
        public void Write_900_NineHundred(int numberToWrite, string expectedWrittenNumber)
        {
            var digitWriter    = new DigitWriter(BritishNumbersDictionary.DigitDictionary());
            var tensWriter     = new TensWriter(BritishNumbersDictionary.TensDictionary(), digitWriter);
            var hundredsWriter = new HundredsWriter(tensWriter);

            var nineHundred = hundredsWriter.Write(numberToWrite);

            Assert.AreEqual(expectedWrittenNumber, nineHundred);
        }
 public INumberWriter CreateTensDigitWriter()
 {
     return(new TensWriter(BritishNumbersDictionary.TensDictionary(), CreateSingleDigitWriter()));
 }
Example #5
0
        public void Write_HundredNumber()
        {
            var tensWriter = new TensWriter(BritishNumbersDictionary.TensDictionary(), _digitWriter);

            tensWriter.Write(100);
        }