RedmineFixture.cs 719 B

123456789101112131415161718192021222324252627282930
  1. using System.Diagnostics;
  2. using Redmine.Net.Api;
  3. namespace Padi.RedmineApi.Tests
  4. {
  5. public class RedmineFixture
  6. {
  7. public RedmineCredentials Credentials { get; private set; }
  8. public RedmineManager RedmineManager { get; set; }
  9. public RedmineFixture ()
  10. {
  11. Credentials = TestHelper.GetApplicationConfiguration();
  12. SetMimeTypeXml();
  13. SetMimeTypeJson();
  14. }
  15. [Conditional("DEBUG_JSON")]
  16. private void SetMimeTypeJson()
  17. {
  18. RedmineManager = new RedmineManager(Credentials.Uri, Credentials.ApiKey, MimeFormat.Json);
  19. }
  20. [Conditional("DEBUG_XML")]
  21. private void SetMimeTypeXml()
  22. {
  23. RedmineManager = new RedmineManager(Credentials.Uri, Credentials.ApiKey);
  24. }
  25. }
  26. }