Esempio n. 1
0
        public void AddOrUpdate_UpdatedValue()
        {
            vCardSubpropertyCollection subs =
                new vCardSubpropertyCollection();

            subs.AddOrUpdate("NAME", "VALUE");

            Assert.AreEqual(
                1,
                subs.Count,
                "Only one property should be in the collection.");

            Assert.AreEqual(
                "NAME",
                subs[0].Name,
                "The subproperty does not have the correct name.");

            Assert.AreEqual(
                "VALUE",
                subs[0].Value,
                "The subproperty does not have the correct value.");

            subs.AddOrUpdate("NAME", "VALUE2");

            Assert.AreEqual(
                1,
                subs.Count,
                "Only one property should be in the collection.");

            Assert.AreEqual(
                "NAME",
                subs[0].Name,
                "The subproperty does not have the correct name.");

            Assert.AreEqual(
                "VALUE2",
                subs[0].Value,
                "The subproperty does not have the updated value.");
        }
        public void AddOrUpdate_UpdatedValue()
        {

            vCardSubpropertyCollection subs =
                new vCardSubpropertyCollection();

            subs.AddOrUpdate("NAME", "VALUE");

            Assert.AreEqual(
                1,
                subs.Count,
                "Only one property should be in the collection.");

            Assert.AreEqual(
                "NAME",
                subs[0].Name,
                "The subproperty does not have the correct name.");

            Assert.AreEqual(
                "VALUE",
                subs[0].Value,
                "The subproperty does not have the correct value.");

            subs.AddOrUpdate("NAME", "VALUE2");

            Assert.AreEqual(
                1,
                subs.Count,
                "Only one property should be in the collection.");

            Assert.AreEqual(
                "NAME",
                subs[0].Name,
                "The subproperty does not have the correct name.");

            Assert.AreEqual(
                "VALUE2",
                subs[0].Value,
                "The subproperty does not have the updated value.");

        }