public void Verify_Remove_ANonExistingEntity_Should_ReturnTrue()
        {
            // Arrange
            var mockLocationIssuesRepository = LocationIssuesMockingSetup.DoMockingSetupForRepository();

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

            // Assert
            Assert.Equal(true, result);
        }
        public void Verify_Remove_ByKey_Should_DeactivateTheObjectAndReturnTrue()
        {
            // Arrange
            var mockLocationIssuesRepository = LocationIssuesMockingSetup.DoMockingSetupForRepository();
            var mockLocationIssuesMapper     = new Mock <ILocationIssueMapper>();

            mockLocationIssuesMapper.Setup(m => m.AreEqual(It.IsAny <ILocationIssueModel>(), It.IsAny <ILocationIssue>())).Returns(() => true);
            var businessWorkflow = new LocationIssuesBusinessWorkflow(mockLocationIssuesRepository.Object, mockLocationIssuesMapper.Object);

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

            // Assert
            mockLocationIssuesRepository.Verify(m => m.Remove(It.IsAny <ILocationIssue>()), Times.Once);
            Assert.Equal(true, result);
        }
 public void Verify_Remove_ByKey_Should_DeactivateTheObjectAndReturnTrue()
 {
     // Arrange
     var mockLocationIssuesRepository = LocationIssuesMockingSetup.DoMockingSetupForRepository();
     var mockLocationIssuesMapper = new Mock<ILocationIssueMapper>();
     mockLocationIssuesMapper.Setup(m => m.AreEqual(It.IsAny<ILocationIssueModel>(), It.IsAny<ILocationIssue>())).Returns(() => true);
     var businessWorkflow = new LocationIssuesBusinessWorkflow(mockLocationIssuesRepository.Object, mockLocationIssuesMapper.Object);
     mockLocationIssuesRepository.Setup(m => m.Get(It.IsAny<string>())).Returns(() => new Mock<ILocationIssue>().Object);
     mockLocationIssuesRepository.Setup(m => m.SaveChanges()).Returns(() => true);
     // Act
     var result = businessWorkflow.Remove("KING-STEPHEN");
     // Assert
     mockLocationIssuesRepository.Verify(m => m.Remove(It.IsAny<ILocationIssue>()), Times.Once);
     Assert.Equal(true, result);
 }
 public void Verify_Remove_ANonExistingEntity_Should_ReturnTrue()
 {
     // Arrange
     var mockLocationIssuesRepository = LocationIssuesMockingSetup.DoMockingSetupForRepository();
     mockLocationIssuesRepository.Setup(m => m.Get(It.IsAny<string>())).Returns(() => null);
     var businessWorkflow = new LocationIssuesBusinessWorkflow(mockLocationIssuesRepository.Object, new LocationIssueMapper());
     // Act
     var result = businessWorkflow.Remove("DOESNT-EXIST");
     // Assert
     Assert.Equal(true, result);
 }