public void Verify_Remove_ANonExistingEntity_Should_ReturnTrue()
        {
            // Arrange
            var mockMovieConceptsRepository = MovieConceptsMockingSetup.DoMockingSetupForRepository();

            mockMovieConceptsRepository.Setup(m => m.Get(It.IsAny <string>())).Returns(() => null);
            var businessWorkflow = new MovieConceptsBusinessWorkflow(mockMovieConceptsRepository.Object, new MovieConceptMapper());
            // Act
            var result = businessWorkflow.Remove("DOESNT-EXIST");

            // Assert
            Assert.Equal(true, result);
        }
        public void Verify_Remove_ByKey_Should_DeactivateTheObjectAndReturnTrue()
        {
            // Arrange
            var mockMovieConceptsRepository = MovieConceptsMockingSetup.DoMockingSetupForRepository();
            var mockMovieConceptsMapper     = new Mock <IMovieConceptMapper>();

            mockMovieConceptsMapper.Setup(m => m.AreEqual(It.IsAny <IMovieConceptModel>(), It.IsAny <IMovieConcept>())).Returns(() => true);
            var businessWorkflow = new MovieConceptsBusinessWorkflow(mockMovieConceptsRepository.Object, mockMovieConceptsMapper.Object);

            mockMovieConceptsRepository.Setup(m => m.Get(It.IsAny <string>())).Returns(() => new Mock <IMovieConcept>().Object);
            mockMovieConceptsRepository.Setup(m => m.SaveChanges()).Returns(() => true);
            // Act
            var result = businessWorkflow.Remove("KING-STEPHEN");

            // Assert
            mockMovieConceptsRepository.Verify(m => m.Remove(It.IsAny <IMovieConcept>()), Times.Once);
            Assert.Equal(true, result);
        }
 public void Verify_Remove_ByKey_Should_DeactivateTheObjectAndReturnTrue()
 {
     // Arrange
     var mockMovieConceptsRepository = MovieConceptsMockingSetup.DoMockingSetupForRepository();
     var mockMovieConceptsMapper = new Mock<IMovieConceptMapper>();
     mockMovieConceptsMapper.Setup(m => m.AreEqual(It.IsAny<IMovieConceptModel>(), It.IsAny<IMovieConcept>())).Returns(() => true);
     var businessWorkflow = new MovieConceptsBusinessWorkflow(mockMovieConceptsRepository.Object, mockMovieConceptsMapper.Object);
     mockMovieConceptsRepository.Setup(m => m.Get(It.IsAny<string>())).Returns(() => new Mock<IMovieConcept>().Object);
     mockMovieConceptsRepository.Setup(m => m.SaveChanges()).Returns(() => true);
     // Act
     var result = businessWorkflow.Remove("KING-STEPHEN");
     // Assert
     mockMovieConceptsRepository.Verify(m => m.Remove(It.IsAny<IMovieConcept>()), Times.Once);
     Assert.Equal(true, result);
 }
 public void Verify_Remove_ANonExistingEntity_Should_ReturnTrue()
 {
     // Arrange
     var mockMovieConceptsRepository = MovieConceptsMockingSetup.DoMockingSetupForRepository();
     mockMovieConceptsRepository.Setup(m => m.Get(It.IsAny<string>())).Returns(() => null);
     var businessWorkflow = new MovieConceptsBusinessWorkflow(mockMovieConceptsRepository.Object, new MovieConceptMapper());
     // Act
     var result = businessWorkflow.Remove("DOESNT-EXIST");
     // Assert
     Assert.Equal(true, result);
 }