public void CalculateTest() { SqrtCalculator calculator = new SqrtCalculator(); Assert.AreEqual(0, calculator.Calculate(0)); Assert.AreEqual(1, calculator.Calculate(1)); Assert.AreEqual(4, calculator.Calculate(16)); }
public void Calc_Success() { var inputStack = new Stack <decimal>(); inputStack.Push(4); var(result, history, resultMemberCount) = _calculator.Calculate(inputStack); result.Count.Should().Be(1); result.First().Should().Be(2); history.Count.Should().Be(1); history.First().Should().Be(4); resultMemberCount.Should().Be(1); }
public void SqrtTest(double firstValue, double expected) { var calculator = new SqrtCalculator(); var actualResult = calculator.Calculate(firstValue); Assert.AreEqual(expected, actualResult); }
public void CalculateTest(double argument, double result, double accuracy) { var calculator = new SqrtCalculator(); var testResult = calculator.Calculate(argument); Assert.AreEqual(result, testResult, accuracy); }
public void CalculateTest() { SqrtCalculator calculator = new SqrtCalculator(); Assert.AreEqual(2, calculator.Calculate(4)); }
public void CalculateTest() { SqrtCalculator calculator = new SqrtCalculator(); Assert.Throws <System.DivideByZeroException>(() => calculator.Calculate(-5)); }
public void ExceptionTest() { var calculator = new SqrtCalculator(); Assert.Throws <Exception>(() => calculator.Calculate(-1)); }
public void SqrtNegativeTest() { var calculator = new SqrtCalculator(); var testResult = calculator.Calculate(-0.1); }