Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("-------------------------------------------------");
            Console.WriteLine("Conversion of decimal to binary system.");
            Console.WriteLine("-------------------------------------------------");
            Console.WriteLine(MathConvertor.DecToBin(8));


            Console.WriteLine("\n-------------------------------------------------");
            Console.WriteLine("Conversion of binary to decimal system.");
            Console.WriteLine("-------------------------------------------------");
            Console.WriteLine(MathConvertor.BinToDec("0101"));


            Console.WriteLine("\n-------------------------------------------------");
            Console.WriteLine("Conversion of decimal number to roman.");
            Console.WriteLine("-------------------------------------------------");
            Console.WriteLine(MathConvertor.DecToRoman(3269));


            Console.WriteLine("\n-------------------------------------------------");
            Console.WriteLine("Conversion of roman number to decimal.");
            Console.WriteLine("-------------------------------------------------");
            Console.WriteLine(MathConvertor.RomanToDec("XLMCD"));


            Console.WriteLine("\n-------------------------------------------------");
            Console.WriteLine("Solving of a quadratic equation.");
            Console.WriteLine("-------------------------------------------------");
            ExtraMath.SolveQuadraticEquation(1, -3, -4);

            Console.WriteLine("\n-------------------------------------------------");
            Console.WriteLine("Generation of random double.");
            Console.WriteLine("-------------------------------------------------");
            ExtraMath.GenerateRndNum(new Random(), 0.56256, 10.581254);
        }
Exemplo n.º 2
0
 public void AssertEqualResultOfConvertInt32ToRomanNumberString()
 {
     Assert.Equal("MMMDLV", MathConvertor.ConvertInt32ToRomanNumberString(3555));
 }
Exemplo n.º 3
0
 public void AssertIfConvertRomanNumeralStringToInt32ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() => MathConvertor.ConvertRomanNumeralStringToInt32("IIL"));
 }
Exemplo n.º 4
0
 public void AssertEqualResultOfConvertRomanNumeralStringToInt32()
 {
     Assert.Equal(3555, MathConvertor.ConvertRomanNumeralStringToInt32("MMMDLV"));
 }
Exemplo n.º 5
0
 public void AssertIfConvertInt32ToRomanNumberStringThrowsArgumentOutOfRange()
 {
     Assert.Throws <ArgumentOutOfRangeException>(() => MathConvertor.ConvertInt32ToRomanNumberString(4001));
 }