-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Labels
Description
Describe the bug
This is an improved documentation suggestion more than a bug.
- The expected impact of the enum DeepL.SentenceSplittingMode.cs in DeepL.Translator.TranslateTextAsync is poorly documented.
- The expected impact cannot be determined in its corresponding unit test; the tests are poorly implemented as they assert only for a non-exception rather than a positively-expected outcome.
Specifically, if and how a new line character \n may or may not be retained is not explained.
To Reproduce
Steps to reproduce the behavior:
- Review the documentation
Enum controlling how input translation text should be split into sentences.
This says nothing for how this input translation text impacts the output translation text.
- Review the unit tests
var translator = CreateTestTranslator();
const string text = "If the implementation is hard to explain, it's a bad idea.\n" +
"If the implementation is easy to explain, it may be a good idea.";
await translator.TranslateTextAsync(
text,
null,
"DE",
new TextTranslateOptions { SentenceSplittingMode = SentenceSplittingMode.Off });
Expected behavior
- Documentation should be made describing how the enum value impacts our expected output translation text.
- Existing unit test should be replaced by unit tests that ensure this expected behaviour is adhered to.