Inheritance: IRequestFactory
Exemplo n.º 1
0
        public void ResolveTranslateLinkUsingCreate2()
        {
            var link = new TranslationLink2()
            {
                FromLanguage = "English",
                ToLanguage   = "French",
                FromPhrase   = "Hello"
            };

            var request = link.CreateRequest();

            Assert.Equal("http://api.microsofttranslator.com/V2/Http.svc/Translate?text=Hello&to=French&from=English", request.RequestUri.AbsoluteUri);
        }
Exemplo n.º 2
0
        public void ResolveTranslateLinkUsingCreate2()
        {
            var link = new TranslationLink2()
            {
                FromLanguage = "English",
                ToLanguage = "French",
                FromPhrase = "Hello"
            };

            var request = link.CreateRequest();

            Assert.Equal("http://api.microsofttranslator.com/V2/Http.svc/Translate?text=Hello&to=French&from=English", request.RequestUri.AbsoluteUri);
        }