public User(string username, string password, ICompressor compressor, IFormate formator) { this.username = username; this.password = password; this._strategyCompress = compressor; this._strategyFormate = formator; }
public void SetStrategy(IFormate formator) { if (formator == null) { throw new ArgumentNullException(nameof(formator)); } this._strategyFormate = formator; }
public void SetStrategy(ICompressor compressor, IFormate formator) { if (compressor == null) { throw new ArgumentNullException(nameof(compressor)); } if (formator == null) { throw new ArgumentNullException(nameof(formator)); } this._strategyCompress = compressor; this._strategyFormate = formator; }