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); }
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; }
public void InitializeNewInstance() { _strategy = new ThirtySixMonthStrategy(); }