public void Init()
        {
            _compoundStrategy = MockRepository.GenerateMock <ICompoundStrategy>();
            _repository       = MockRepository.GenerateMock <IRepository>();
            _outputDevice     = MockRepository.GenerateMock <IOutputDevice>();
            _loanMatcher      = MockRepository.GenerateMock <ILoanMatcher>();

            _calculator = new Calculator(_compoundStrategy, _repository, _outputDevice, _loanMatcher);
        }
Ejemplo n.º 2
0
        public Calculator(ICompoundStrategy compoundStrategy, IRepository repository, IOutputDevice outputDevice, ILoanMatcher matcher)
        {
            if (compoundStrategy == null)
            {
                throw new ArgumentNullException(nameof(compoundStrategy));
            }
            if (repository == null)
            {
                throw new ArgumentNullException(nameof(repository));
            }
            if (outputDevice == null)
            {
                throw new ArgumentNullException(nameof(outputDevice));
            }
            if (matcher == null)
            {
                throw new ArgumentNullException(nameof(matcher));
            }

            _compoundStrategy = compoundStrategy;
            _repository       = repository;
            _outputDevice     = outputDevice;
            _matcher          = matcher;
        }
Ejemplo n.º 3
0
 public void Init()
 {
     _matcher = new LoanMatcher();
 }