Ejemplo n.º 1
0
        public async Task ShouldThrowException()
        {
            var service = new ReversoService();

            var result = await service.TranslateText(new TranslateTextRequest(Language.En, Language.Ru)
            {
                Source = ""
            });

            Assert.True(result.Error);
            Assert.Equal("Source is empty", result.Message);
        }
Ejemplo n.º 2
0
        public async Task ShouldTranslateText()
        {
            var service = new ReversoService();

            var result = await service.TranslateText(new TranslateTextRequest(Language.En, Language.Ru)
            {
                Source = "Private methods"
            });

            Assert.NotNull(result.Translation);
            Assert.False(result.Error);
        }