コード例 #1
0
ファイル: Program.cs プロジェクト: KubikJan7/ICSHP
        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);
        }
コード例 #2
0
 public void AssertEqualResultOfConvertInt32ToRomanNumberString()
 {
     Assert.Equal("MMMDLV", MathConvertor.ConvertInt32ToRomanNumberString(3555));
 }
コード例 #3
0
 public void AssertIfConvertRomanNumeralStringToInt32ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() => MathConvertor.ConvertRomanNumeralStringToInt32("IIL"));
 }
コード例 #4
0
 public void AssertEqualResultOfConvertRomanNumeralStringToInt32()
 {
     Assert.Equal(3555, MathConvertor.ConvertRomanNumeralStringToInt32("MMMDLV"));
 }
コード例 #5
0
 public void AssertIfConvertInt32ToRomanNumberStringThrowsArgumentOutOfRange()
 {
     Assert.Throws <ArgumentOutOfRangeException>(() => MathConvertor.ConvertInt32ToRomanNumberString(4001));
 }