public void CalculateTest() { double expected = 0.333; double actual = new DivisionCalculator().Calculate(1, 3); Assert.AreEqual(expected, actual, 0.001); }
public void DivisionCalculatorTests(double firstArgument, double secondArgument, double result) { var calculator = new DivisionCalculator(); var actualResult = calculator.Calculate(firstArgument, secondArgument); Assert.AreEqual(result, actualResult); }
public void CalculateTests() { DivisionCalculator divisionCalculator = new DivisionCalculator(); double result = divisionCalculator.Calculate(2, 2); Assert.AreEqual(1, result); }
public void CalculateTest() { ITwoArgumentsCalculator calculator = new DivisionCalculator(); double result = calculator.Calculate(14, 2); Assert.AreEqual(7, result); }
public DivisionCalculatorActionController() { display = new Display(); divisionCalculator = new DivisionCalculator(display.Numbers); display.Percent = divisionCalculator.CalculatePercent(); display.Print(); }
public void DivisionCalculatorTest() { var calculator = new DivisionCalculator(); double actual = calculator.Calculate(2, 1); Assert.AreEqual(2, actual); }
void CalcMetTests() { DivisionCalculator divc = new DivisionCalculator(); double ExpResult = 66 / 33, ActResult = divc.CalcMet(66, 33); Assert.AreEqual(ExpResult, ActResult); }
public void CalculateTest(double firstAgrument, double secondArgument, double expectedResult) { var calculator = new DivisionCalculator(); var actualResult = calculator.Calculate(firstAgrument, secondArgument); Assert.AreEqual(expectedResult, actualResult, 0.001); }
public void DivisionCalculator() { DivisionCalculator calculator = new DivisionCalculator(); Assert.Throws <Exception>(() => calculator.Calculate(1, 0)); }
public void DivisionByZeroTest() { ITwoArgumentsCalculator calculator = new DivisionCalculator(); Assert.Throws <Exception>(() => calculator.Calculate(1, 0)); }
public void DivisionTest(double firstValue, double secondValue, double expected) { var calculator = new DivisionCalculator(); var actualResult = calculator.Calculate(firstValue, secondValue); Assert.AreEqual(expected, actualResult); }
public void CalculateTest() { DivisionCalculator calculator = new DivisionCalculator(); Assert.AreEqual(5, calculator.Calculate(51, 17)); Assert.AreEqual(1, calculator.Calculate(3, 3)); Assert.AreEqual(2, calculator.Calculate(40, 20)); }
public void DivisionCalculator() { DivisionCalculator calculator = new DivisionCalculator(); double actual = calculator.Calculate(4, 2); Assert.AreEqual(2, actual); }
public void CalculateTest(double valueOne, double valueTwo, double result, double accuracy) { var calculator = new DivisionCalculator(); var testResult = calculator.Calculate(valueOne, valueTwo); Assert.AreEqual(result, testResult, accuracy); }
public void CalculateTest() { DivisionCalculator calculator = new DivisionCalculator(); Assert.AreEqual(5, calculator.Calculate(100, 20)); Assert.AreEqual(33, calculator.Calculate(99, 3)); Assert.AreEqual(12.5, calculator.Calculate(50, 4)); }
public void DivisionCalculator( double firstValue, double secondValue, double expected) { DivisionCalculator calculator = new DivisionCalculator(); double actual = calculator.Calculate(firstValue, secondValue); Assert.AreEqual(expected, actual); }
public void ShouldReturnCorrectDivisionOfNumbers() { var calculator = new DivisionCalculator(new List <int> { 10, 2, 2 }); var actualResult = calculator.Calculate(); Assert.AreEqual(actualResult, 2); calculator = new DivisionCalculator(new List <int> { 27, 3, 2 }); actualResult = calculator.Calculate(); Assert.AreEqual(actualResult, 4); }
private ICalculator <float> CreateCalculator(CalculateType calculateType, params float[] values) { ICalculator <float> ret = null; switch (calculateType) { case CalculateType.Addition: ret = new AdditionCalculator <float>(values[0], values[1]); break; case CalculateType.Subtraction: ret = new SubtractionCalculator <float>(values[0], values[1]); break; case CalculateType.Multiplication: ret = new MultiplicationCalculator <float>(values[0], values[1]); break; case CalculateType.Division: ret = new DivisionCalculator <float>(values[0], values[1]); break; case CalculateType.Power: ret = new PowerCalculator <float>(values[0], values[1]); break; case CalculateType.Sine: ret = new SineCalculator <float>(values[0]); break; case CalculateType.Cosine: ret = new CosineCalculator <float>(values[0]); break; } return(ret); }
public void ExceptionZeroTest(double firstArgument, double secondArgument) { var calculator = new DivisionCalculator(); Assert.Throws <Exception>(() => calculator.Calculate(firstArgument, secondArgument)); }
public void DivisionZero() { var calculator = new DivisionCalculator(); calculator.Calculate(5, 0); }
public void ExceptionTest() { var calculator = new DivisionCalculator(); Assert.Throws <DivideByZeroException>(() => calculator.Calculate(1, 0)); }
public void NegativeCalculateTests() { DivisionCalculator divisionCalculator = new DivisionCalculator(); Assert.Throws <Exception>(() => divisionCalculator.Calculate(1, 0)); }
public void NegativeDivisionCalculatorTest() { var calculator = new DivisionCalculator(); Assert.Throws <Exception>(() => calculator.Calculate(1, 0)); }
public void CatchExceptions() { ITwoArgumentCalculator divisionCalculator = new DivisionCalculator(); Assert.Throws <Exception>(() => divisionCalculator.Calculate(1, 0)); }
public void CalculateTest() { DivisionCalculator calculator = new DivisionCalculator(); Assert.Throws <System.DivideByZeroException>(() => calculator.Calculate(5, 0)); }
public void DivisionCalculatorTest() { DivisionCalculator calculator = new DivisionCalculator(); Assert.AreEqual(4, calculator.Calculate(20, 5)); }
public void ExceptionTest(double firstValue, double secondValue) { var calculator = new DivisionCalculator(); Assert.Throws <Exception>(() => calculator.Calculate(firstValue, secondValue)); }