public void UpdateTranslate_should_update_translate()
        {
            var dto        = TranslateFakeData.GetFakedUpdatedTranslate();
            var translate  = Substitute.For <Translator>();
            var repository = Substitute.For <ITranslationRepository>();

            repository.GetById(dto.Id).Returns(translate);

            var sut = new TranslationService(repository);

            sut.ModifyTranslate(dto);

            var language     = new LanguageBuilder().WithAbbrevation(dto.LanguageAbbr).Build();
            var phraseType   = new PhraseTypeBuilder().WithName(dto.PhraseType).Build();
            var phrase       = new PhraseBuilder().WithId(dto.PhraseId).WithPhraseType(phraseType).Build();
            var translations = new List <Domain.Entities.Translation>()
            {
                new Domain.Entities.Translation(language, dto.Translation)
            };
            var expectedTranslate = new TranslateBuilder()
                                    .WithId(dto.Id)
                                    .WithPhrase(phrase)
                                    .WithTranslations(translations).Build();

            translate.Received().Update(phrase, translations);
        }
        public void CreateTranslate_should_save_translate()
        {
            var dto        = TranslateFakeData.GetFakedCreatedTranslate();
            var repository = Substitute.For <ITranslationRepository>();
            var sut        = new TranslationService(repository);

            sut.CreateTranslate(dto);

            var language     = new LanguageBuilder().WithAbbrevation(dto.LanguageAbbr).Build();
            var translations = new List <Domain.Entities.Translation>()
            {
                new Domain.Entities.Translation(language, dto.Translation)
            };

            var phraseType        = new PhraseTypeBuilder().WithName(dto.PhraseType).Build();
            var phrase            = new PhraseBuilder().WithId(dto.PhraseId).WithPhraseType(phraseType).Build();
            var expectedTranslate = new TranslateBuilder()
                                    .WithPhrase(phrase)
                                    .WithTranslations(translations).Build();

            repository.Received(1).Save(ArgExt.Compare(expectedTranslate, new TranslatorEqualityComparer()));
        }