public void Verify_Remove_ANonExistingEntity_Should_ReturnTrue()
        {
            // Arrange
            var mockObjectStoryArcsRepository = ObjectStoryArcsMockingSetup.DoMockingSetupForRepository();

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

            // Assert
            Assert.Equal(true, result);
        }
        public void Verify_Remove_ByKey_Should_DeactivateTheObjectAndReturnTrue()
        {
            // Arrange
            var mockObjectStoryArcsRepository = ObjectStoryArcsMockingSetup.DoMockingSetupForRepository();
            var mockObjectStoryArcsMapper     = new Mock <IObjectStoryArcMapper>();

            mockObjectStoryArcsMapper.Setup(m => m.AreEqual(It.IsAny <IObjectStoryArcModel>(), It.IsAny <IObjectStoryArc>())).Returns(() => true);
            var businessWorkflow = new ObjectStoryArcsBusinessWorkflow(mockObjectStoryArcsRepository.Object, mockObjectStoryArcsMapper.Object);

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

            // Assert
            mockObjectStoryArcsRepository.Verify(m => m.Remove(It.IsAny <IObjectStoryArc>()), Times.Once);
            Assert.Equal(true, result);
        }
 public void Verify_Remove_ByKey_Should_DeactivateTheObjectAndReturnTrue()
 {
     // Arrange
     var mockObjectStoryArcsRepository = ObjectStoryArcsMockingSetup.DoMockingSetupForRepository();
     var mockObjectStoryArcsMapper = new Mock<IObjectStoryArcMapper>();
     mockObjectStoryArcsMapper.Setup(m => m.AreEqual(It.IsAny<IObjectStoryArcModel>(), It.IsAny<IObjectStoryArc>())).Returns(() => true);
     var businessWorkflow = new ObjectStoryArcsBusinessWorkflow(mockObjectStoryArcsRepository.Object, mockObjectStoryArcsMapper.Object);
     mockObjectStoryArcsRepository.Setup(m => m.Get(It.IsAny<string>())).Returns(() => new Mock<IObjectStoryArc>().Object);
     mockObjectStoryArcsRepository.Setup(m => m.SaveChanges()).Returns(() => true);
     // Act
     var result = businessWorkflow.Remove("KING-STEPHEN");
     // Assert
     mockObjectStoryArcsRepository.Verify(m => m.Remove(It.IsAny<IObjectStoryArc>()), Times.Once);
     Assert.Equal(true, result);
 }
 public void Verify_Remove_ANonExistingEntity_Should_ReturnTrue()
 {
     // Arrange
     var mockObjectStoryArcsRepository = ObjectStoryArcsMockingSetup.DoMockingSetupForRepository();
     mockObjectStoryArcsRepository.Setup(m => m.Get(It.IsAny<string>())).Returns(() => null);
     var businessWorkflow = new ObjectStoryArcsBusinessWorkflow(mockObjectStoryArcsRepository.Object, new ObjectStoryArcMapper());
     // Act
     var result = businessWorkflow.Remove("DOESNT-EXIST");
     // Assert
     Assert.Equal(true, result);
 }