You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Settings.cs 847 B

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
1234567891011121314151617181920212223242526272829303132
  1. using Newtonsoft.Json;
  2. using System.IO;
  3. namespace Discord.Tests
  4. {
  5. internal class Settings
  6. {
  7. private const string path = "../../config.json";
  8. public static readonly Settings Instance;
  9. static Settings()
  10. {
  11. if (!File.Exists(path))
  12. throw new FileNotFoundException("config.json is missing, rename config.json.example and add credentials for three separate unused accounts for testing.");
  13. Instance = JsonConvert.DeserializeObject<Settings>(File.ReadAllText(path));
  14. }
  15. public class Account
  16. {
  17. [JsonProperty("email")]
  18. public string Email { get; set; }
  19. [JsonProperty("password")]
  20. public string Password { get; set; }
  21. }
  22. [JsonProperty("user1")]
  23. public Account User1 { get; set; }
  24. [JsonProperty("user2")]
  25. public Account User2 { get; set; }
  26. [JsonProperty("user3")]
  27. public Account User3 { get; set; }
  28. }
  29. }

Introduction

No Description

No topics