PageRenderTime 22ms CodeModel.GetById 16ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/Mercurial.Net.Tests/ConfigurationTests.cs

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