コード例 #1
0
 public void ChangeGenre
 (
     IGenreStrategy genreStrategy,
     Genre newGenre
 )
 {
     if (genreStrategy.CanChangeGenre(_genre, newGenre))
     {
         _genre   = newGenre;
         _genreId = newGenre.Id;
     }
 }
コード例 #2
0
        public void WhenTheCurrentGenreNameAndNewGenreNameMatchShouldReturnFalse()
        {
            // Arrange
            var name         = "GenreOne";
            var currentGenre = new Genre()
            {
                Id   = 1,
                Name = name
            };
            var newGenre = new Genre()
            {
                Id   = 2,
                Name = name
            };

            // Act
            var result = _strategyUnderTest.CanChangeGenre(currentGenre, newGenre);

            // Assert
            result.Should().BeFalse();
        }