Esempio n. 1
0
        public async Task AddSynonymsTest()
        {
            var requestData = SynonymMockData.SynonymGoodData();

            Assert.IsNotNull(requestData);

            await _synonymService.AddSynonyms(requestData);

            await Assert.ThrowsExceptionAsync <ArgumentException>(async() => await _synonymService.AddSynonyms(requestData));
        }
Esempio n. 2
0
        public async Task GetSynonymTest()
        {
            var requestData = SynonymMockData.SynonymHappyData();
            await _synonymService.AddSynonyms(requestData);

            var result = await _synonymService.FindSynonym("happy");

            Assert.IsNotNull(result);

            var noresult = await _synonymService.FindSynonym("sad");

            Assert.IsTrue(noresult.Count == 0);

            var synonymIndex = result.First().Value;
            var synonyms     = await _synonymService.GetSynonyms(synonymIndex);

            Assert.IsTrue(synonyms.Count == 4);
        }
Esempio n. 3
0
        public async Task AddSynonymsDuplicateTest()
        {
            var requestData = SynonymMockData.SynonymDuplicateData();

            await Assert.ThrowsExceptionAsync <Exception>(async() => await _synonymService.AddSynonyms(requestData));
        }