示例#1
0
        public void AddPublisherTranslate_ShouldCallPublisherRepositoryOnceWhenPublishers()
        {
            // Arrange
            _publisherRepository.Setup(a => a.GetMany(It.IsAny <int>(), It.IsAny <int>(), null, null,
                                                      It.IsAny <SortDirection>(), It.IsAny <Expression <Func <Publisher, object> > >())).Returns(new List <Publisher> {
                _publisher
            });

            // Act
            _publisherService.AddPublisherTranslate(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), "ru",
                                                    It.IsAny <Guid>());

            // Assert
            _translationRepository.Verify(pl => pl.AddTranslate(It.IsAny <PublisherTranslation>(), It.IsAny <string>()), Times.Once);
        }