public CalculatorManagerTestsAlternate()
        {
            _mathRepository = Substitute.For <IMathRepository>();

            _mathRepository.GetIntMax().Returns(Int32.MaxValue);
            _mathRepository.GetIntMin().Returns(Int32.MinValue);

            _calculatorManager = new CalculatorManager(_mathRepository);
        }
예제 #2
0
        public int SubtractFromMaxInt(int number)
        {
            //numeric owerflow durumnda  exception patlatmak için
            int result;

            checked
            {
                result = _mathRepositories.GetIntMax() - number;
            }

            return(result);
        }