예제 #1
0
 public HomeModule()
 {
     Get["/"] = _ => {
     return View["index.cshtml"];
       };
       Post["/result"] = _ => {
     float userNumber = Request.Form["number"];
     Converter newNumberToCovert = new Converter();
     string convertedNumber = newNumberToCovert.numberToString(userNumber);
     return View["result.cshtml", convertedNumber];
       };
 }
 public void Convert_4_four()
 {
     Converter convert = new Converter();
       Assert.Equal("four", convert.numberToString(4));
 }
 public void Convert_4point00003_fourandthreemillionths()
 {
     Converter convert = new Converter();
       Assert.Equal("four and three hundred thousandths", convert.numberToString(4.00003F));
 }
 public void Convert_4point3_fourandthreetenths()
 {
     Converter convert = new Converter();
       Assert.Equal("four and three tenths", convert.numberToString(4.3F));
 }
 public void Convert_43_fortythree()
 {
     Converter convert = new Converter();
       Assert.Equal("forty three", convert.numberToString(43));
 }
 public void Convert_45433_fortyfivethousandfourhundredthirtythree()
 {
     Converter convert = new Converter();
       Assert.Equal("forty five thousand four hundred thirty three", convert.numberToString(45433));
 }
 public void Convert_400_fourhundred()
 {
     Converter convert = new Converter();
       Assert.Equal("four hundred", convert.numberToString(400));
 }
 public void Convert_4001433_fourmilliononethousandfourhundredthirtythree()
 {
     Converter convert = new Converter();
       Assert.Equal("four million one thousand four hundred thirty three", convert.numberToString(4001433));
 }
 public void Convert_13_thirteen()
 {
     Converter convert = new Converter();
       Assert.Equal("thirteen", convert.numberToString(13));
 }
 public void Convert_0_zero()
 {
     Converter convert = new Converter();
       Assert.Equal("zero", convert.numberToString(0));
 }
 public void Convert_minus4point03_minusfourandthreehundredths()
 {
     Converter convert = new Converter();
       Assert.Equal("negative four and three hundredths", convert.numberToString(-4.03F));
 }