Exemple #1
0
        public void EditPhraseDescriptionTest()
        {
            var oldPhrase = GenerateNewPhrase();

            _packService.AddPhrase(Id, oldPhrase);
            var newPhrase = new PhraseItem
            {
                Phrase      = oldPhrase.Phrase,
                Description = $"{oldPhrase.Description} {Lorem.Sentence()}",
                Complexity  = oldPhrase.Complexity % 5,
            };

            newPhrase.UpdateAuthor(TestAuthor);
            _packService.EditPhrase(Id, oldPhrase, newPhrase, TestAuthor);

            var pack = _packService.GetPackById(Id);

            Assert.That(pack.Phrases.Any(p => p.Phrase == newPhrase.Phrase && p.Description == newPhrase.Description));
            Assert.That(pack.Phrases.Select(p => p.Description), Is.Not.Contains(oldPhrase.Description));

            _packService.DeletePhrase(Id, newPhrase.Phrase, TestAuthor);
        }