Add() public method

public Add ( double x, double y ) : double
x double
y double
return double
コード例 #1
0
        public void AddTest_Add5AndNegative5()
        {
            // arrange
            double a        = 5;
            double b        = -5;
            double expected = 0;
            var    calc     = new CalculatorLib.Calculator();
            // act
            double actual = calc.Add(a, b);

            // assert
            Assert.Equal(expected, actual);
        }
コード例 #2
0
        public void AddTest_Add0And1()
        {
            // arrange
            double a        = 0;
            double b        = 1;
            double expected = 1;
            var    calc     = new CalculatorLib.Calculator();
            // act
            double actual = calc.Add(a, b);

            // assert
            Assert.Equal(expected, actual);
        }