示例#1
0
 public AuthenticationService(IProfileRepo profileRepo, IHashedAdapter hashedAdapter, IOtpService otpService, INotifyAdapter notifyAdapter)
 {
     _profileRepo   = profileRepo;
     _hashedAdapter = hashedAdapter;
     _otpService    = otpService;
     _notifyAdapter = notifyAdapter;
 }
        public void Setup()
        {
            _profileRepo   = Substitute.For <IProfileRepo>();
            _hashedAdapter = Substitute.For <IHashedAdapter>();
            _otpService    = Substitute.For <IOtpService>();
            _logAdapter    = Substitute.For <ILogAdapter>();
            _notifyAdapter = Substitute.For <INotifyAdapter>();
            _failedCounter = Substitute.For <IFailedCounter>();

            _authenticationService = new AuthenticationService(_profileRepo, _hashedAdapter, _otpService, _notifyAdapter);

            var failedCounterDecorator = new FailedCounterDecorator(_authenticationService, _failedCounter);
            var logDecorator           = new LogDecorator(failedCounterDecorator, _logAdapter, _failedCounter);

            _authenticationService = logDecorator;
        }