public void GetPersonByNameNotInDatabase() { var subject = CreatePersonService(null); var person = subject.GetPersonByNameForMovies("name"); person.Should().NotBeNull(); person.Id.Should().Be(_basePerson.Id); person.Name.Should().Be(_basePerson.Name); person.Primary.Should().Be(_basePerson.Primary); person.MovieCount.Should().Be(10); person.BirthDate.Should().Be(_basePerson.BirthDate); person.Etag.Should().Be(_basePerson.Etag); person.IMDB.Should().Be(_basePerson.IMDB); person.TMDB.Should().Be(_basePerson.TMDB); person.OverView.Should().Be(_basePerson.OverView); //TODO Re-enable show count //person.ShowCount.Should().Be(2); person.SortName.Should().Be(_basePerson.SortName); PersonRepositoryMock.Verify(x => x.GetPersonByName(It.IsAny <string>()), Times.Once); EmbyClientMock.Verify(x => x.GetPersonByName(It.IsAny <string>()), Times.Once); }
public void GetPersonByNameInDatabase() { var databasePerson = new Person { Id = _basePerson.Id, Name = "name", Primary = "", BirthDate = new DateTime(2000, 1, 1), Etag = "etag", HomePageUrl = "localhost.be", IMDB = "12345", TMDB = "12345", OverView = "Lots of text", SortName = "name" }; var subject = CreatePersonService(databasePerson); var person = subject.GetPersonByNameForMovies(databasePerson.Id); person.Should().NotBeNull(); person.Id.Should().Be(databasePerson.Id); person.Name.Should().Be(databasePerson.Name); person.Primary.Should().Be(databasePerson.Primary); person.MovieCount.Should().Be(databasePerson.MovieCount); person.BirthDate.Should().Be(databasePerson.BirthDate); person.Etag.Should().Be(databasePerson.Etag); person.IMDB.Should().Be(databasePerson.IMDB); person.TMDB.Should().Be(databasePerson.TMDB); person.OverView.Should().Be(databasePerson.OverView); person.ShowCount.Should().Be(databasePerson.ShowCount); person.SortName.Should().Be(databasePerson.SortName); PersonRepositoryMock.Verify(x => x.GetPersonByName(It.IsAny <string>()), Times.Once); EmbyClientMock.Verify(x => x.GetPersonByName(It.IsAny <string>()), Times.Never); }