public void Verify_Remove_ANonExistingEntity_Should_ReturnTrue()
 {
     // Arrange
     var mockObjectsRepository = ObjectsMockingSetup.DoMockingSetupForRepository();
     mockObjectsRepository.Setup(m => m.Get(It.IsAny<string>())).Returns(() => null);
     var businessWorkflow = new ObjectsBusinessWorkflow(mockObjectsRepository.Object, new ObjectMapper());
     // Act
     var result = businessWorkflow.Remove("DOESNT-EXIST");
     // Assert
     Assert.Equal(true, result);
 }
 public void Verify_Remove_ByKey_Should_DeactivateTheObjectAndReturnTrue()
 {
     // Arrange
     var mockObjectsRepository = ObjectsMockingSetup.DoMockingSetupForRepository();
     var mockObjectsMapper = new Mock<IObjectMapper>();
     mockObjectsMapper.Setup(m => m.AreEqual(It.IsAny<IObjectModel>(), It.IsAny<IObject>())).Returns(() => true);
     var businessWorkflow = new ObjectsBusinessWorkflow(mockObjectsRepository.Object, mockObjectsMapper.Object);
     mockObjectsRepository.Setup(m => m.Get(It.IsAny<string>())).Returns(() => new Mock<IObject>().Object);
     mockObjectsRepository.Setup(m => m.SaveChanges()).Returns(() => true);
     // Act
     var result = businessWorkflow.Remove("KING-STEPHEN");
     // Assert
     mockObjectsRepository.Verify(m => m.Remove(It.IsAny<IObject>()), Times.Once);
     Assert.Equal(true, result);
 }
 public void Verify_Remove_ByKey_Should_DeactivateTheObjectAndReturnTrue()
 {
     // Arrange
     var mockObjectsRepository = ObjectsMockingSetup.DoMockingSetupForRepository();
     var mockObjectsMapper = new Mock<IObjectMapper>();
     mockObjectsMapper.Setup(m => m.AreEqual(It.IsAny<IObjectModel>(), It.IsAny<IObject>())).Returns(() => true);
     var businessWorkflow = new ObjectsBusinessWorkflow(mockObjectsRepository.Object, mockObjectsMapper.Object);
     mockObjectsRepository.Setup(m => m.Get(It.IsAny<string>())).Returns(() => new Mock<IObject>().Object);
     mockObjectsRepository.Setup(m => m.SaveChanges()).Returns(() => true);
     // Act
     var result = businessWorkflow.Remove("KING-STEPHEN");
     // Assert
     mockObjectsRepository.Verify(m => m.Remove(It.IsAny<IObject>()), Times.Once);
     Assert.Equal(true, result);
 }
 public void Verify_Remove_ANonExistingEntity_Should_ReturnTrue()
 {
     // Arrange
     var mockObjectsRepository = ObjectsMockingSetup.DoMockingSetupForRepository();
     mockObjectsRepository.Setup(m => m.Get(It.IsAny<string>())).Returns(() => null);
     var businessWorkflow = new ObjectsBusinessWorkflow(mockObjectsRepository.Object, new ObjectMapper());
     // Act
     var result = businessWorkflow.Remove("DOESNT-EXIST");
     // Assert
     Assert.Equal(true, result);
 }