~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/ngit/NGit.Test/NGit/ConfigTest.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
using NGit;
47
47
using NGit.Junit;
48
48
using NGit.Util;
 
49
using NUnit.Framework;
49
50
using Sharpen;
50
51
 
51
52
namespace NGit
59
60
                public virtual void Test001_ReadBareKey()
60
61
                {
61
62
                        Config c = Parse("[foo]\nbar\n");
62
 
                        NUnit.Framework.Assert.AreEqual(true, c.GetBoolean("foo", null, "bar", false));
 
63
                        NUnit.Framework.Assert.IsTrue(c.GetBoolean("foo", null, "bar", false));
63
64
                        NUnit.Framework.Assert.AreEqual(string.Empty, c.GetString("foo", null, "bar"));
64
65
                }
65
66
 
68
69
                public virtual void Test002_ReadWithSubsection()
69
70
                {
70
71
                        Config c = Parse("[foo \"zip\"]\nbar\n[foo \"zap\"]\nbar=false\nn=3\n");
71
 
                        NUnit.Framework.Assert.AreEqual(true, c.GetBoolean("foo", "zip", "bar", false));
 
72
                        NUnit.Framework.Assert.IsTrue(c.GetBoolean("foo", "zip", "bar", false));
72
73
                        NUnit.Framework.Assert.AreEqual(string.Empty, c.GetString("foo", "zip", "bar"));
73
 
                        NUnit.Framework.Assert.AreEqual(false, c.GetBoolean("foo", "zap", "bar", true));
 
74
                        NUnit.Framework.Assert.IsFalse(c.GetBoolean("foo", "zap", "bar", true));
74
75
                        NUnit.Framework.Assert.AreEqual("false", c.GetString("foo", "zap", "bar"));
75
76
                        NUnit.Framework.Assert.AreEqual(3, c.GetInt("foo", "zap", "n", 4));
76
77
                        NUnit.Framework.Assert.AreEqual(4, c.GetInt("foo", "zap", "m", 4));
105
106
                        c.SetStringList("my", null, "somename", values);
106
107
                        object[] expArr = Sharpen.Collections.ToArray(values);
107
108
                        string[] actArr = c.GetStringList("my", null, "somename");
108
 
                        NUnit.Framework.Assert.IsTrue(Arrays.Equals(expArr, actArr));
 
109
                        CollectionAssert.AreEquivalent(expArr, actArr);
109
110
                        string expText = "[my]\n\tsomename = value1\n\tsomename = value2\n";
110
111
                        NUnit.Framework.Assert.AreEqual(expText, c.ToText());
111
112
                }
115
116
                public virtual void Test006_readCaseInsensitive()
116
117
                {
117
118
                        Config c = Parse("[Foo]\nBar\n");
118
 
                        NUnit.Framework.Assert.AreEqual(true, c.GetBoolean("foo", null, "bar", false));
 
119
                        NUnit.Framework.Assert.IsTrue(c.GetBoolean("foo", null, "bar", false));
119
120
                        NUnit.Framework.Assert.AreEqual(string.Empty, c.GetString("foo", null, "bar"));
120
121
                }
121
122