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 752 B

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