Exemplo n.º 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);
 }
Exemplo n.º 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);
        }
Exemplo n.º 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 CreateSingleDigitWriter()
 {
     return(new DigitWriter(BritishNumbersDictionary.DigitDictionary()));
 }
 public INumberWriter CreateMillionsDigitWriter()
 {
     return(new UnitWriter(BritishNumbersDictionary.UnitsDictionary(), CreateHundredsDigitWriter()));
 }
 public INumberWriter CreateTensDigitWriter()
 {
     return(new TensWriter(BritishNumbersDictionary.TensDictionary(), CreateSingleDigitWriter()));
 }
Exemplo n.º 7
0
 public void SetUp()
 {
     _digitHandler = new DigitWriter(BritishNumbersDictionary.DigitDictionary());
 }
Exemplo n.º 8
0
        public void Write_HundredNumber()
        {
            var tensWriter = new TensWriter(BritishNumbersDictionary.TensDictionary(), _digitWriter);

            tensWriter.Write(100);
        }