public void TestMust_DetectUnknown(string inputString) { //arrange //act DetectInputLanguage detect = new DetectInputLanguage(inputString); DetectInputLanguage.Language result = detect.Detect(); //assert Assert.IsTrue(result == DetectInputLanguage.Language.Unknown); }
private async void startRequestWithValidation(string originalText) { preparedTextForRequest = prepareTextForRequest(originalText); if (!string.IsNullOrEmpty(preparedTextForRequest)) { DetectInputLanguage detect = new DetectInputLanguage(originalText); DetectInputLanguage.Language result = detect.Detect(); if ((result!=DetectInputLanguage.Language.Unknown) && !direction.IsFrom(result)) { direction.Invert(); updateDestinationCaption(); }; await RequestReference(preparedTextForRequest); } }