Example #1
0
        public virtual void TestAddressUseOrdering()
        {
            TelecommunicationAddress address = new TelecommunicationAddress();

            address.AddAddressUse(Ca.Infoway.Messagebuilder.Domainvalue.Basic.TelecommunicationAddressUse.WORKPLACE);
            address.AddAddressUse(Ca.Infoway.Messagebuilder.Domainvalue.Basic.TelecommunicationAddressUse.EMERGENCY_CONTACT);
            address.AddAddressUse(Ca.Infoway.Messagebuilder.Domainvalue.Basic.TelecommunicationAddressUse.ANSWERING_MACHINE);
            address.AddAddressUse(Ca.Infoway.Messagebuilder.Domainvalue.Basic.TelecommunicationAddressUse.DIRECT);
            IEnumerator <Ca.Infoway.Messagebuilder.Domainvalue.TelecommunicationAddressUse> i = address.AddressUses.GetEnumerator();

            i.MoveNext();
            //for sharpen .NET mapping
            Assert.AreEqual(i.Current.CodeValue, Ca.Infoway.Messagebuilder.Domainvalue.Basic.TelecommunicationAddressUse.ANSWERING_MACHINE
                            .CodeValue);
            i.MoveNext();
            //for sharpen .NET mapping
            Assert.AreEqual(i.Current.CodeValue, Ca.Infoway.Messagebuilder.Domainvalue.Basic.TelecommunicationAddressUse.DIRECT.CodeValue
                            );
            i.MoveNext();
            //for sharpen .NET mapping
            Assert.AreEqual(i.Current.CodeValue, Ca.Infoway.Messagebuilder.Domainvalue.Basic.TelecommunicationAddressUse.EMERGENCY_CONTACT
                            .CodeValue);
            i.MoveNext();
            //for sharpen .NET mapping
            Assert.AreEqual(i.Current.CodeValue, Ca.Infoway.Messagebuilder.Domainvalue.Basic.TelecommunicationAddressUse.WORKPLACE.CodeValue
                            );
        }
Example #2
0
        /// <exception cref="System.Exception"></exception>
        public virtual void AssertToStringAsExpected(Ca.Infoway.Messagebuilder.Domainvalue.URLScheme urlScheme, string address, string
                                                     expectedValue)
        {
            TelecommunicationAddress telecommunicationAddress = new TelecommunicationAddress();

            telecommunicationAddress.UrlScheme = urlScheme;
            telecommunicationAddress.Address   = address;
            Assert.AreEqual(expectedValue, telecommunicationAddress.ToString(), "value");
        }
Example #3
0
        public virtual void TestTelecomAddressEquals()
        {
            TelecommunicationAddress telecomAddress1 = new TelecommunicationAddress();

            telecomAddress1.Address   = "192.168.0.27";
            telecomAddress1.UrlScheme = Ca.Infoway.Messagebuilder.Domainvalue.Basic.URLScheme.HTTP;
            telecomAddress1.AddAddressUse(Ca.Infoway.Messagebuilder.Domainvalue.Basic.TelecommunicationAddressUse.ANSWERING_MACHINE);
            TelecommunicationAddress telecomAddress2 = new TelecommunicationAddress();

            telecomAddress2.Address   = "192.168.0.27";
            telecomAddress2.UrlScheme = Ca.Infoway.Messagebuilder.Domainvalue.Basic.URLScheme.HTTP;
            telecomAddress2.AddAddressUse(Ca.Infoway.Messagebuilder.Domainvalue.Basic.TelecommunicationAddressUse.ANSWERING_MACHINE);
            Assert.AreEqual(telecomAddress1, telecomAddress2);
        }
Example #4
0
 public EncapsulatedData(
     x_DocumentMediaType mediaType_0,
     String reference_1, String lanuage_2, byte[] content_3)
 {
     MediaType    = mediaType_0;
     Language     = lanuage_2;
     this.content = content_3 == null || content_3.Length == 0 ? null : XmlStringEscape.Escape(ASCIIEncoding.ASCII.GetString(content_3));
     if (!StringUtils.IsBlank(reference_1))
     {
         String[] parts = reference_1.Split(new string[] { "://" }, StringSplitOptions.None);
         if (parts.Length > 0)
         {
             Ca.Infoway.Messagebuilder.Domainvalue.Basic.URLScheme urlsScheme = null;
             if (parts.Length > 1)
             {
                 urlsScheme = Ca.Infoway.Messagebuilder.Domainvalue.Basic.URLScheme.ValueOf <Ca.Infoway.Messagebuilder.Domainvalue.Basic.URLScheme>(
                     typeof(Ca.Infoway.Messagebuilder.Domainvalue.Basic.URLScheme), parts[0]);
             }
             String address = (parts.Length > 1 ? parts[1] : parts[0]);
             ReferenceObj = new TelecommunicationAddress(urlsScheme, address);
         }
     }
 }