public void Verify_Remove_ANonExistingEntity_Should_ReturnTrue()
        {
            // Arrange
            var mockEpisodeTeamsRepository = EpisodeTeamsMockingSetup.DoMockingSetupForRepository();

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

            // Assert
            Assert.Equal(true, result);
        }
        public void Verify_Remove_ByKey_Should_DeactivateTheObjectAndReturnTrue()
        {
            // Arrange
            var mockEpisodeTeamsRepository = EpisodeTeamsMockingSetup.DoMockingSetupForRepository();
            var mockEpisodeTeamsMapper     = new Mock <IEpisodeTeamMapper>();

            mockEpisodeTeamsMapper.Setup(m => m.AreEqual(It.IsAny <IEpisodeTeamModel>(), It.IsAny <IEpisodeTeam>())).Returns(() => true);
            var businessWorkflow = new EpisodeTeamsBusinessWorkflow(mockEpisodeTeamsRepository.Object, mockEpisodeTeamsMapper.Object);

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

            // Assert
            mockEpisodeTeamsRepository.Verify(m => m.Remove(It.IsAny <IEpisodeTeam>()), Times.Once);
            Assert.Equal(true, result);
        }
 public void Verify_Remove_ByKey_Should_DeactivateTheObjectAndReturnTrue()
 {
     // Arrange
     var mockEpisodeTeamsRepository = EpisodeTeamsMockingSetup.DoMockingSetupForRepository();
     var mockEpisodeTeamsMapper = new Mock<IEpisodeTeamMapper>();
     mockEpisodeTeamsMapper.Setup(m => m.AreEqual(It.IsAny<IEpisodeTeamModel>(), It.IsAny<IEpisodeTeam>())).Returns(() => true);
     var businessWorkflow = new EpisodeTeamsBusinessWorkflow(mockEpisodeTeamsRepository.Object, mockEpisodeTeamsMapper.Object);
     mockEpisodeTeamsRepository.Setup(m => m.Get(It.IsAny<string>())).Returns(() => new Mock<IEpisodeTeam>().Object);
     mockEpisodeTeamsRepository.Setup(m => m.SaveChanges()).Returns(() => true);
     // Act
     var result = businessWorkflow.Remove("KING-STEPHEN");
     // Assert
     mockEpisodeTeamsRepository.Verify(m => m.Remove(It.IsAny<IEpisodeTeam>()), Times.Once);
     Assert.Equal(true, result);
 }
 public void Verify_Remove_ANonExistingEntity_Should_ReturnTrue()
 {
     // Arrange
     var mockEpisodeTeamsRepository = EpisodeTeamsMockingSetup.DoMockingSetupForRepository();
     mockEpisodeTeamsRepository.Setup(m => m.Get(It.IsAny<string>())).Returns(() => null);
     var businessWorkflow = new EpisodeTeamsBusinessWorkflow(mockEpisodeTeamsRepository.Object, new EpisodeTeamMapper());
     // Act
     var result = businessWorkflow.Remove("DOESNT-EXIST");
     // Assert
     Assert.Equal(true, result);
 }