Beispiel #1
0
        public void ParseNEgativeNumbersCorrectly()
        {
            var expectedName = "test";

            var convertingService = new ConvertingService();
            var result            = convertingService.ToEnglish(expectedName, -1.5);

            Assert.AreEqual(expectedName, result.Name);
            Assert.AreEqual("MINUS ONE DOLLAR AND FIVE CENTS", result.Amount);


            result = convertingService.ToEnglish(expectedName, -0.5);

            Assert.AreEqual(expectedName, result.Name);
            Assert.AreEqual("MINUS FIVE CENTS", result.Amount);
        }
Beispiel #2
0
        public void ParseFloatsCorrectly()
        {
            var expectedName = "test";

            var convertingService = new ConvertingService();
            var result            = convertingService.ToEnglish(expectedName, 1.5);

            Assert.AreEqual(expectedName, result.Name);
            Assert.AreEqual("ONE DOLLAR AND FIVE CENTS", result.Amount);


            result = convertingService.ToEnglish(expectedName, 0.5);

            Assert.AreEqual(expectedName, result.Name);
            Assert.AreEqual("FIVE CENTS", result.Amount);
        }
Beispiel #3
0
        public void ParseIntsCorrectly()
        {
            var expectedName = "test";

            var convertingService = new ConvertingService();
            var result            = convertingService.ToEnglish(expectedName, 1);

            Assert.AreEqual(expectedName, result.Name);
            Assert.AreEqual("ONE DOLLAR", result.Amount);


            result = convertingService.ToEnglish(expectedName, 0);

            Assert.AreEqual(expectedName, result.Name);
            Assert.AreEqual("ZERO DOLLAR", result.Amount);


            result = convertingService.ToEnglish(expectedName, -1);

            Assert.AreEqual(expectedName, result.Name);
            Assert.AreEqual("MINUS ONE DOLLAR", result.Amount);
        }
 public MainWindow()
 {
     InitializeComponent();
     _dataCapacityConvertingService = new DataCapacityConvertingService();
     _convertingService             = new ConvertingService();
 }
        public AccountHolder Get(string name, double amount)
        {
            var convertingService = new ConvertingService();

            return(convertingService.ToEnglish(name, amount));
        }