Exemplo n.º 1
0
        internal static void AssertInvalidUrlScheme(TestableAbstractValueNullFlavorPropertyFormatter <TelecommunicationAddress> formatter
                                                    , Ca.Infoway.Messagebuilder.Domainvalue.URLScheme urlScheme, FormatContext context)
        {
            TelecommunicationAddress address = new TelecommunicationAddress();

            address.UrlScheme = urlScheme;
            address.Address   = "sometext";
            formatter.GetAttributeNameValuePairsForTest(context, address, new TELImpl());
            Assert.IsFalse(context.GetModelToXmlResult().IsValid());
            Assert.AreEqual(1, context.GetModelToXmlResult().GetHl7Errors().Count);
            Assert.IsTrue(context.GetModelToXmlResult().GetHl7Errors()[0].GetMessage().Contains("Scheme " + urlScheme.CodeValue + " is not valid"
                                                                                                ), "expected message");
        }
Exemplo n.º 2
0
        /// <exception cref="System.Exception"></exception>
        internal static void AssertValidUrlScheme(TestableAbstractValueNullFlavorPropertyFormatter <TelecommunicationAddress> formatter
                                                  , Ca.Infoway.Messagebuilder.Domainvalue.URLScheme urlScheme, FormatContext context, string expected)
        {
            TelecommunicationAddress address = new TelecommunicationAddress();

            address.UrlScheme = urlScheme;
            address.Address   = "someAddress";
            IDictionary <string, string> result = formatter.GetAttributeNameValuePairsForTest(context, address, new TELImpl());

            Assert.IsTrue(context.GetModelToXmlResult().IsValid());
            Assert.AreEqual(1, result.Count, "map size");
            Assert.IsTrue(result.ContainsKey("value"), "key as expected");
            Assert.AreEqual(expected + address.Address, result.SafeGet("value"), "value as expected");
        }