PageRenderTime 32ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/Mercurial.Net.Tests/ConfigurationTests.cs

#
C# | 39 lines | 35 code | 4 blank | 0 comment | 0 complexity | ca59968651eb01722c3b71a855460260 MD5 | raw file
Possible License(s): BSD-3-Clause, GPL-2.0
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using NUnit.Framework;
  4. namespace Mercurial.Tests
  5. {
  6. [TestFixture]
  7. public class ConfigurationTests
  8. {
  9. [TestCase("ui")]
  10. [TestCase("extensions")]
  11. [Test]
  12. [Category("Integration")]
  13. public void Sections_ReturnsCollectionOfSectionNames_ContainingAtLeastAFewOfTheDefaultOnes(string sectionName)
  14. {
  15. IEnumerable<string> sectionNames = ClientExecutable.Configuration.Sections;
  16. Assert.That(sectionNames.Contains(sectionName), Is.True);
  17. }
  18. [TestCase("ui", "username")]
  19. [TestCase("extensions", "graphlog")]
  20. [Test]
  21. [Category("Integration")]
  22. public void Entries_ForSpecifiedTypicalOnes_Exists(string sectionName, string name)
  23. {
  24. Assert.That(ClientExecutable.Configuration.ValueExists(sectionName, name), Is.True);
  25. }
  26. [TestCase("dummysection", "username")]
  27. [TestCase("ui", "dummyname")]
  28. [Test]
  29. [Category("Integration")]
  30. public void Entries_ForRandomlyGeneratedNames_DoesNotExist(string sectionName, string name)
  31. {
  32. Assert.That(ClientExecutable.Configuration.ValueExists(sectionName, name), Is.False);
  33. }
  34. }
  35. }