コード例 #1
0
        public void ReadWriteProperty_Context()
        {

            vCardSource source = new vCardSource();

            source.Context = "LDAP";
            Assert.AreEqual(
                "LDAP",
                source.Context,
                "The Context property is not working.");

        }
コード例 #2
0
        public void ReadWriteProperty_Uri()
        {

            Uri testUri = new Uri("isdn:123456789");
            vCardSource source = new vCardSource();

            source.Uri = testUri;
            Assert.AreEqual(
                testUri,
                source.Uri);

            
        }
コード例 #3
0
        public void Constructor()
        {

            // Tests the default values of the vCardSource
            // class when the parameterless constructor is used.

            vCardSource source = new vCardSource();

            Assert.IsEmpty(
                source.Context,
                "The Context property should default to empty.");

            Assert.IsNull(
                source.Uri,
                "The Uri property should default to null.");

        }
コード例 #4
0
ファイル: Helper.cs プロジェクト: richardsalt/Thought.vCards
        public static void Equals(vCardSource s1, vCardSource s2)
        {

            Assert.AreEqual(
                s1.Context,
                s2.Context,
                "vCardSource.Context differs.");

            Assert.AreEqual(
                s1.ToString(),
                s2.ToString(),
                "vCardSource.ToString differs.");

            Assert.AreEqual(
                s1.Uri,
                s2.Uri,
                "vCardSource.Uri differs.");

        }
コード例 #5
0
        /// <summary>
        ///     Reads the SOURCE property.
        /// </summary>
        private void ReadInto_SOURCE(vCard card, vCardProperty property)
        {

            // The SOURCE property identifies the source of
            // directory information (e.g. an LDAP server).  This
            // is not widely supported.  See RFC 2425, sec. 6.1.

            vCardSource source = new vCardSource();
            source.Context = property.Subproperties.GetValue("CONTEXT");
            source.Uri = new Uri(property.Value.ToString());
            card.Sources.Add(source);

        }