コード例 #1
0
        public void GetGigWithArtistGenreById_GigIsWithIdAndIncludesArtistGenre_ShouldBeReturned()
        {
            var gigsTmp = new[]
            {
                new Gig()
                {
                    Id = 1, Artist = new ApplicationUser()
                    {
                        Id = "1", Name = "Nero"
                    }, Genre = new Genre()
                    {
                        Id = 1, Name = "Jazz"
                    }
                },
                new Gig()
                {
                    Id = 2, Artist = new ApplicationUser()
                    {
                        Id = "2", Name = "Duper"
                    }, Genre = new Genre()
                    {
                        Id = 2, Name = "Blues"
                    }
                }
            };

            _mockGigs.SetSource(gigsTmp);

            var gig = _gigRepository.GetGigById(1);

            gig.Should().Be(gigsTmp[0]);
            gig.Id.Should().Be(1);
            gig.Artist.Id.Should().Be("1");
            gig.Artist.Name.Should().Be("Nero");
            gig.Genre.Id.Should().Be(1);
            gig.Genre.Name.Should().Be("Jazz");
        }