public void Verify_Get_ByKey_Should_ReturnTheCorrectVolumeWriter()
        {
            // Arrange
            Mock <IDbSet <VolumeWriter> > mockSetVolumeWriters;
            var mockContext = VolumeWritersMockingSetup.DoMockingSetupForContext(true, out mockSetVolumeWriters);
            var repository  = new VolumeWritersRepository(mockContext.Object);
            // Act
            var volumeWriters = repository.Get("KING-STEPHEN");

            // Assert
            Assert.Equal("/TEST/KING-STEPHEN", volumeWriters.ApiDetailUrl);
        }
 public void Verify_Deactivate_Should_SetTheActivePropertyToFalseOnTheEntity()
 {
     // Arrange
     Mock<IDbSet<VolumeWriter>> mockSetVolumeWriters;
     var mockContext = VolumeWritersMockingSetup.DoMockingSetupForContext(true, out mockSetVolumeWriters);
     var repository = new VolumeWritersRepository(mockContext.Object);
     var volumeWriters = repository.Get(1);
     // Act
     repository.Deactivate(volumeWriters);
     // Assert
     Assert.Equal(false, volumeWriters.Active);
 }
        public void Verify_Deactivate_Should_SetTheActivePropertyToFalseOnTheEntity()
        {
            // Arrange
            Mock <IDbSet <VolumeWriter> > mockSetVolumeWriters;
            var mockContext   = VolumeWritersMockingSetup.DoMockingSetupForContext(true, out mockSetVolumeWriters);
            var repository    = new VolumeWritersRepository(mockContext.Object);
            var volumeWriters = repository.Get(1);

            // Act
            repository.Deactivate(volumeWriters);
            // Assert
            Assert.Equal(false, volumeWriters.Active);
        }
        public void Verify_Remove_Should_RemoveTheEntityFromTheContext()
        {
            // Arrange
            Mock <IDbSet <VolumeWriter> > mockSetVolumeWriters;
            var mockContext   = VolumeWritersMockingSetup.DoMockingSetupForContext(true, out mockSetVolumeWriters);
            var repository    = new VolumeWritersRepository(mockContext.Object);
            var volumeWriters = repository.Get(1);

            // Act
            repository.Remove(volumeWriters);
            // Assert
            mockSetVolumeWriters.Verify(x => x.Remove((VolumeWriter)volumeWriters), Times.Once);
        }
        public void Verify_Update_Should_SetTheEntityStateToModified()
        {
            // Arrange
            Mock <IDbSet <VolumeWriter> > mockSetVolumeWriters;
            var mockContext   = VolumeWritersMockingSetup.DoMockingSetupForContext(true, out mockSetVolumeWriters);
            var repository    = new VolumeWritersRepository(mockContext.Object);
            var volumeWriters = repository.Get(1);

            volumeWriters.ApiDetailUrl = "/TEST";
            // Act
            repository.Update(volumeWriters);
            // Assert
            mockContext.Verify(x => x.SetModified(It.IsAny <object>()), Times.Once);
        }
 public void Verify_Get_ByID_Should_ReturnTheCorrectVolumeWriter()
 {
     // Arrange
     Mock<IDbSet<VolumeWriter>> mockSetVolumeWriters;
     var mockContext = VolumeWritersMockingSetup.DoMockingSetupForContext(true, out mockSetVolumeWriters);
     var repository = new VolumeWritersRepository(mockContext.Object);
     // Act
     var volumeWriters = repository.Get(1);
     // Assert
                 Assert.Equal("/TEST/KING-STEPHEN", volumeWriters.ApiDetailUrl);
 }
 public void Verify_Update_Should_SetTheEntityStateToModified()
 {
     // Arrange
     Mock<IDbSet<VolumeWriter>> mockSetVolumeWriters;
     var mockContext = VolumeWritersMockingSetup.DoMockingSetupForContext(true, out mockSetVolumeWriters);
     var repository = new VolumeWritersRepository(mockContext.Object);
     var volumeWriters = repository.Get(1);
     volumeWriters.ApiDetailUrl = "/TEST";
     // Act
     repository.Update(volumeWriters);
     // Assert
     mockContext.Verify(x => x.SetModified(It.IsAny<object>()), Times.Once);
 }
 public void Verify_Remove_Should_RemoveTheEntityFromTheContext()
 {
     // Arrange
     Mock<IDbSet<VolumeWriter>> mockSetVolumeWriters;
     var mockContext = VolumeWritersMockingSetup.DoMockingSetupForContext(true, out mockSetVolumeWriters);
     var repository = new VolumeWritersRepository(mockContext.Object);
     var volumeWriters = repository.Get(1);
     // Act
     repository.Remove(volumeWriters);
     // Assert
     mockSetVolumeWriters.Verify(x => x.Remove((VolumeWriter)volumeWriters), Times.Once);
 }