Beispiel #1
0
        public void Verify_Get_ByKey_Should_ReturnTheCorrectStoryArcWriter()
        {
            // Arrange
            Mock <IDbSet <StoryArcWriter> > mockSetStoryArcWriters;
            var mockContext = StoryArcWritersMockingSetup.DoMockingSetupForContext(true, out mockSetStoryArcWriters);
            var repository  = new StoryArcWritersRepository(mockContext.Object);
            // Act
            var storyArcWriters = repository.Get("KING-STEPHEN");

            // Assert
            Assert.Equal("/TEST/KING-STEPHEN", storyArcWriters.ApiDetailUrl);
        }
 public void Verify_Deactivate_Should_SetTheActivePropertyToFalseOnTheEntity()
 {
     // Arrange
     Mock<IDbSet<StoryArcWriter>> mockSetStoryArcWriters;
     var mockContext = StoryArcWritersMockingSetup.DoMockingSetupForContext(true, out mockSetStoryArcWriters);
     var repository = new StoryArcWritersRepository(mockContext.Object);
     var storyArcWriters = repository.Get(1);
     // Act
     repository.Deactivate(storyArcWriters);
     // Assert
     Assert.Equal(false, storyArcWriters.Active);
 }
Beispiel #3
0
        public void Verify_Deactivate_Should_SetTheActivePropertyToFalseOnTheEntity()
        {
            // Arrange
            Mock <IDbSet <StoryArcWriter> > mockSetStoryArcWriters;
            var mockContext     = StoryArcWritersMockingSetup.DoMockingSetupForContext(true, out mockSetStoryArcWriters);
            var repository      = new StoryArcWritersRepository(mockContext.Object);
            var storyArcWriters = repository.Get(1);

            // Act
            repository.Deactivate(storyArcWriters);
            // Assert
            Assert.Equal(false, storyArcWriters.Active);
        }
Beispiel #4
0
        public void Verify_Remove_Should_RemoveTheEntityFromTheContext()
        {
            // Arrange
            Mock <IDbSet <StoryArcWriter> > mockSetStoryArcWriters;
            var mockContext     = StoryArcWritersMockingSetup.DoMockingSetupForContext(true, out mockSetStoryArcWriters);
            var repository      = new StoryArcWritersRepository(mockContext.Object);
            var storyArcWriters = repository.Get(1);

            // Act
            repository.Remove(storyArcWriters);
            // Assert
            mockSetStoryArcWriters.Verify(x => x.Remove((StoryArcWriter)storyArcWriters), Times.Once);
        }
Beispiel #5
0
        public void Verify_Update_Should_SetTheEntityStateToModified()
        {
            // Arrange
            Mock <IDbSet <StoryArcWriter> > mockSetStoryArcWriters;
            var mockContext     = StoryArcWritersMockingSetup.DoMockingSetupForContext(true, out mockSetStoryArcWriters);
            var repository      = new StoryArcWritersRepository(mockContext.Object);
            var storyArcWriters = repository.Get(1);

            storyArcWriters.ApiDetailUrl = "/TEST";
            // Act
            repository.Update(storyArcWriters);
            // Assert
            mockContext.Verify(x => x.SetModified(It.IsAny <object>()), Times.Once);
        }
 public void Verify_Get_ByID_Should_ReturnTheCorrectStoryArcWriter()
 {
     // Arrange
     Mock<IDbSet<StoryArcWriter>> mockSetStoryArcWriters;
     var mockContext = StoryArcWritersMockingSetup.DoMockingSetupForContext(true, out mockSetStoryArcWriters);
     var repository = new StoryArcWritersRepository(mockContext.Object);
     // Act
     var storyArcWriters = repository.Get(1);
     // Assert
                 Assert.Equal("/TEST/KING-STEPHEN", storyArcWriters.ApiDetailUrl);
 }
 public void Verify_Update_Should_SetTheEntityStateToModified()
 {
     // Arrange
     Mock<IDbSet<StoryArcWriter>> mockSetStoryArcWriters;
     var mockContext = StoryArcWritersMockingSetup.DoMockingSetupForContext(true, out mockSetStoryArcWriters);
     var repository = new StoryArcWritersRepository(mockContext.Object);
     var storyArcWriters = repository.Get(1);
     storyArcWriters.ApiDetailUrl = "/TEST";
     // Act
     repository.Update(storyArcWriters);
     // Assert
     mockContext.Verify(x => x.SetModified(It.IsAny<object>()), Times.Once);
 }
 public void Verify_Remove_Should_RemoveTheEntityFromTheContext()
 {
     // Arrange
     Mock<IDbSet<StoryArcWriter>> mockSetStoryArcWriters;
     var mockContext = StoryArcWritersMockingSetup.DoMockingSetupForContext(true, out mockSetStoryArcWriters);
     var repository = new StoryArcWritersRepository(mockContext.Object);
     var storyArcWriters = repository.Get(1);
     // Act
     repository.Remove(storyArcWriters);
     // Assert
     mockSetStoryArcWriters.Verify(x => x.Remove((StoryArcWriter)storyArcWriters), Times.Once);
 }