public void SetUp() { _logger = Substitute.For <ILogger>(); _notifier = Substitute.For <INotifier>(); _profile = Substitute.For <IProfile>(); _failCounter = Substitute.For <IFailCounter>(); _otpService = Substitute.For <IOtpService>(); _hash = Substitute.For <IHash>(); var authenticationService = new AuthenticationService(_otpService, _hash, _profile); var failCounterDecorator = new FailCounterDecorator(authenticationService, _failCounter, _logger); _authentication = new NotifyDecorator(failCounterDecorator, _notifier); }
public void Setup() { _ProfileDao = Substitute.For <IProfileDao>(); _Otp = Substitute.For <IOtp>(); _Hash = Substitute.For <IHash>(); _FailCounter = Substitute.For <IFailCounter>(); _Notification = Substitute.For <INotification>(); _Logger = Substitute.For <ILogger>(); _AuthenticationService = new AuthenticationService(_ProfileDao, _Hash, _Otp); //composite _AuthenticationService = new NotificationDecorator(_AuthenticationService, _Notification); _AuthenticationService = new LogFailedCountDecorator(_AuthenticationService, _FailCounter, _Logger); _AuthenticationService = new FailedCounterDecorator(_AuthenticationService, _FailCounter); }
public void SetUp() { _Logger = Substitute.For <ILogger>(); _FailedCounter = Substitute.For <IFailCounter>(); _Notification = Substitute.For <INotification>(); _OtpService = Substitute.For <IOtpService>(); _Hash = Substitute.For <IHashAdapter>(); _Profile = Substitute.For <IProfile>(); _AuthenticationService = new AuthenticationService(_Profile, _Hash, _OtpService); _AuthenticationService = new FailCounterDecorator(_AuthenticationService, _FailedCounter); _AuthenticationService = new LogFailCountDecorator(_AuthenticationService, _Logger, _FailedCounter); _AuthenticationService = new NotificationDecorator(_AuthenticationService, _Notification); }
public LogFailCountDecorator(IAuthentication authentication, ILogger logger, IFailCounter failCounter) : base(authentication) { _Logger = logger; _FailCounter = failCounter; }
public FailCounterDecorator(IAuthentication authentication, IFailCounter failCounter) : base( authentication) { _FailCounter = failCounter; }
public LogFailedCountDecorator(IAuthentication authenticationService, IFailCounter failCounter, ILogger logger) : base(authenticationService) { _FailCounter = failCounter; _Logger = logger; }