public void Verify_Remove_ANonExistingEntity_Should_ReturnTrue()
        {
            // Arrange
            var mockTeamDisbandedInIssuesRepository = TeamDisbandedInIssuesMockingSetup.DoMockingSetupForRepository();

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

            // Assert
            Assert.Equal(true, result);
        }
        public void Verify_Remove_ByKey_Should_DeactivateTheObjectAndReturnTrue()
        {
            // Arrange
            var mockTeamDisbandedInIssuesRepository = TeamDisbandedInIssuesMockingSetup.DoMockingSetupForRepository();
            var mockTeamDisbandedInIssuesMapper     = new Mock <ITeamDisbandedInIssueMapper>();

            mockTeamDisbandedInIssuesMapper.Setup(m => m.AreEqual(It.IsAny <ITeamDisbandedInIssueModel>(), It.IsAny <ITeamDisbandedInIssue>())).Returns(() => true);
            var businessWorkflow = new TeamDisbandedInIssuesBusinessWorkflow(mockTeamDisbandedInIssuesRepository.Object, mockTeamDisbandedInIssuesMapper.Object);

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

            // Assert
            mockTeamDisbandedInIssuesRepository.Verify(m => m.Remove(It.IsAny <ITeamDisbandedInIssue>()), Times.Once);
            Assert.Equal(true, result);
        }
 public void Verify_Remove_ByKey_Should_DeactivateTheObjectAndReturnTrue()
 {
     // Arrange
     var mockTeamDisbandedInIssuesRepository = TeamDisbandedInIssuesMockingSetup.DoMockingSetupForRepository();
     var mockTeamDisbandedInIssuesMapper = new Mock<ITeamDisbandedInIssueMapper>();
     mockTeamDisbandedInIssuesMapper.Setup(m => m.AreEqual(It.IsAny<ITeamDisbandedInIssueModel>(), It.IsAny<ITeamDisbandedInIssue>())).Returns(() => true);
     var businessWorkflow = new TeamDisbandedInIssuesBusinessWorkflow(mockTeamDisbandedInIssuesRepository.Object, mockTeamDisbandedInIssuesMapper.Object);
     mockTeamDisbandedInIssuesRepository.Setup(m => m.Get(It.IsAny<string>())).Returns(() => new Mock<ITeamDisbandedInIssue>().Object);
     mockTeamDisbandedInIssuesRepository.Setup(m => m.SaveChanges()).Returns(() => true);
     // Act
     var result = businessWorkflow.Remove("KING-STEPHEN");
     // Assert
     mockTeamDisbandedInIssuesRepository.Verify(m => m.Remove(It.IsAny<ITeamDisbandedInIssue>()), Times.Once);
     Assert.Equal(true, result);
 }
 public void Verify_Remove_ANonExistingEntity_Should_ReturnTrue()
 {
     // Arrange
     var mockTeamDisbandedInIssuesRepository = TeamDisbandedInIssuesMockingSetup.DoMockingSetupForRepository();
     mockTeamDisbandedInIssuesRepository.Setup(m => m.Get(It.IsAny<string>())).Returns(() => null);
     var businessWorkflow = new TeamDisbandedInIssuesBusinessWorkflow(mockTeamDisbandedInIssuesRepository.Object, new TeamDisbandedInIssueMapper());
     // Act
     var result = businessWorkflow.Remove("DOESNT-EXIST");
     // Assert
     Assert.Equal(true, result);
 }