2
0

SftpVersionResponseBuilder.cs 989 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.Collections.Generic;
  2. using Renci.SshNet.Sftp.Responses;
  3. namespace Renci.SshNet.Tests.Classes.Sftp
  4. {
  5. internal class SftpVersionResponseBuilder
  6. {
  7. private uint _version;
  8. private readonly IDictionary<string, string> _extensions;
  9. public SftpVersionResponseBuilder()
  10. {
  11. _extensions = new Dictionary<string, string>();
  12. }
  13. public SftpVersionResponseBuilder WithVersion(uint version)
  14. {
  15. _version = version;
  16. return this;
  17. }
  18. public SftpVersionResponseBuilder WithExtension(string name, string data)
  19. {
  20. _extensions.Add(name, data);
  21. return this;
  22. }
  23. public SftpVersionResponse Build()
  24. {
  25. var sftpVersionResponse = new SftpVersionResponse()
  26. {
  27. Version = _version,
  28. Extentions = _extensions
  29. };
  30. return sftpVersionResponse;
  31. }
  32. }
  33. }