Exemplo n.º 1
0
        public void Calc_Success()
        {
            var inputStack = new Stack <decimal>();

            inputStack.Push(1);
            inputStack.Push(2);

            var(result, history, resultMemberCount) = _calculator.Calculate(inputStack);
            result.Count.Should().Be(1);
            result.First().Should().Be(3);
            history.Count.Should().Be(2);
            history.First().Should().Be(1);
            history.Last().Should().Be(2);
            resultMemberCount.Should().Be(1);
        }
Exemplo n.º 2
0
            public void CalculateTest(double firstValue, double secondValue, double expected)
            {
                var calculator   = new AddCalculator();
                var actualResult = calculator.Calculate(firstValue, secondValue);

                Assert.AreEqual(expected, actualResult);
            }
Exemplo n.º 3
0
        public void CalculateTest()

        {
            ITwoArgumentsCalculator calculator = new AddCalculator();
            double result = calculator.Calculate(1, 2);

            Assert.AreEqual(3, result);
        }