Ejemplo n.º 1
0
        public void Constructor_WithTestCases(string input, Dictionary <string, object> expected)
        {
            var collection = new MercurialCommandHookDictionary(input);

            Assert.That(collection.Count, Is.EqualTo(expected.Count));
            foreach (string key in expected.Keys)
            {
                var value = expected[key];
                Assert.That(collection.ContainsKey(key));

                if (value == null)
                {
                    Assert.That(collection[key], Is.Null);
                }
                else if (value is string)
                {
                    Assert.That(collection[key], Is.EqualTo(value));
                }
                else if (value is string[])
                {
                    CollectionAssert.AreEqual((string[])collection[key], (string[])value);
                }
                else
                {
                    Assert.Fail("key " + key + " has an unsupported value type");
                }
            }
        }
        public void Constructor_EmptyArgumentsString_ReturnsEmptyCollection()
        {
            var arguments = new MercurialCommandHookDictionary("{}");

            Assert.That(arguments.Count, Is.EqualTo(0));
        }
        public void Constructor_WithTestCases(string input, Dictionary<string, object> expected)
        {
            var collection = new MercurialCommandHookDictionary(input);

            Assert.That(collection.Count, Is.EqualTo(expected.Count));
            foreach (string key in expected.Keys)
            {
                var value = expected[key];
                Assert.That(collection.ContainsKey(key));

                if (value == null)
                    Assert.That(collection[key], Is.Null);
                else if (value is string)
                    Assert.That(collection[key], Is.EqualTo(value));
                else if (value is string[])
                    CollectionAssert.AreEqual((string[])collection[key], (string[])value);
                else
                    Assert.Fail("key " + key + " has an unsupported value type");
            }
        }
Ejemplo n.º 4
0
        public void Constructor_EmptyArgumentsString_ReturnsEmptyCollection()
        {
            var arguments = new MercurialCommandHookDictionary("{}");

            Assert.That(arguments.Count, Is.EqualTo(0));
        }