public void GetXmlResponseTranslationByRequestUrl()
        {
            var translation1 = new XmlResponseTranslation {
                MatchingPattern = string.Empty, ReplacementPattern = "urn:ns", Url = "/api/v1/resource"
            };
            var translation2 = new XmlResponseTranslation {
                MatchingPattern = "urn:old", ReplacementPattern = "urn:new", Url = "/api/v2/resource#fragment"
            };
            var sut = new XmlResponseTranslationCollection {
                translation1, translation2
            };

            sut.GetXmlResponseTranslationByRequestUrl(new("http://localhost/api/v1/resource")).Should().Be(translation1);
            sut.GetXmlResponseTranslationByRequestUrl(new("http://localhost/api/v2/resource")).Should().BeNull();
            sut.GetXmlResponseTranslationByRequestUrl(new("http://localhost/api/v2/resource#fragment")).Should().Be(translation2);
        }
Пример #2
0
 public void Add(XmlResponseTranslation xmlResponseTranslation)
 {
     BaseAdd(xmlResponseTranslation);
 }