public void Given_Largest_Numbers_Then_Sub_Should_Throw_SuperComputerException()
        {
            // arrange
            var superComputer = new SuperComputer();

            // act
            Action subAction = () => superComputer.Sub(decimal.MaxValue, -decimal.MaxValue);

            // assert
            subAction.Should().Throw <SuperComputerException>();
        }
        public void Given_X_And_Y_Then_Should_Sub_Operation_Compute_Their_Subtraction(decimal x, decimal y, decimal expectedSub)
        {
            // arrange
            var superComputer = new SuperComputer();

            // act
            var sub = superComputer.Sub(x, y);

            // assert
            sub.Should().Be(expectedSub);
        }
Beispiel #3
0
        public static void Main()
        {
            var x = Random.Next(1, 10_000);
            var y = Random.Next(1, 10_000);

            Console.WriteLine($"x = {x}");
            Console.WriteLine($"y = {y}");

            var superComputer = new SuperComputer();

            var sum = superComputer.Sum(x, y);
            var sub = superComputer.Sub(x, y);
            var mul = superComputer.Mul(x, y);
            var div = superComputer.Div(x, y);

            Console.WriteLine($"x + y = {sum}");
            Console.WriteLine($"x - y = {sub}");
            Console.WriteLine($"x * y = {mul}");
            Console.WriteLine($"x / y = {div}");

            Console.WriteLine("Press any key to exit program !");
            Console.ReadKey();
        }