public void AddTermTest()
        {
            IModeratorService moderatorService = new ModeratorService(this.serviceOptions);

            // We are creating a term "FakeProfanity" in english (thus provide tha same english translation), then matching against it.
            TextModeratableContent textContent = new TextModeratableContent(text: "FakeProfanity", englishTranslation: "FakeProfanity");
            var taskResult = moderatorService.AddTermAsync(textContent, "eng");

            var actualResult = taskResult.Result;

            Assert.IsTrue((actualResult.StatusCode != System.Net.HttpStatusCode.Created) || (actualResult.StatusCode != System.Net.HttpStatusCode.MultipleChoices), "Expected valid result for AddTerm");

            var refreshTask   = moderatorService.RefreshTextIndexAsync("eng");
            var refreshResult = refreshTask.Result;

            Assert.IsTrue(refreshResult != null, "Expected valid result for RefreshIndex");

            var screenResponse = moderatorService.ScreenTextAsync(new TextModeratableContent("This is a FakeProfanity!"), "eng");
            var screenResult   = screenResponse.Result;

            Assert.IsTrue(screenResult.MatchDetails != null, "Expected valid terms");

            var deleteTask   = moderatorService.RemoveTermAsync(textContent, "eng");
            var deleteResult = deleteTask.Result;

            Assert.IsTrue(deleteResult.IsSuccessStatusCode, "Expected valid result for DeleteTerm");
        }
        public void ScreenTextTest()
        {
            IModeratorService moderatorService = new ModeratorService(this.serviceOptions);

            // Import the term list. This needs to only be done once before screen
            moderatorService.ImportTermListAsync("eng").Wait();

            moderatorService.RefreshTextIndexAsync("eng").Wait();

            // Run screen to match, validating match result
            string text = "My evil freaking text!";
            TextModeratableContent textContent = new TextModeratableContent(text);

            var screenResponse = moderatorService.ScreenTextAsync(textContent, "eng");
            var screenResult   = screenResponse.Result;

            Assert.IsTrue(screenResult != null, "Expected valid result");
            Assert.IsTrue(screenResult.MatchDetails != null, "Expected valid Match Details");
            Assert.IsTrue(screenResult.MatchDetails.MatchFlags != null, "Expected valid Match Flags");

            var matchFlag = screenResult.MatchDetails.MatchFlags.FirstOrDefault();

            Assert.IsTrue(matchFlag != null, "Expected to see a match flag!");
            Assert.AreEqual("freaking", matchFlag.Source, "Expected term to match");
        }