public void Verify_Get_ByKey_Should_ReturnTheCorrectCharacterCreator()
        {
            // Arrange
            Mock <IDbSet <CharacterCreator> > mockSetCharacterCreators;
            var mockContext = CharacterCreatorsMockingSetup.DoMockingSetupForContext(true, out mockSetCharacterCreators);
            var repository  = new CharacterCreatorsRepository(mockContext.Object);
            // Act
            var characterCreators = repository.Get("KING-STEPHEN");

            // Assert
            Assert.Equal("/TEST/KING-STEPHEN", characterCreators.ApiDetailUrl);
        }
 public void Verify_Deactivate_Should_SetTheActivePropertyToFalseOnTheEntity()
 {
     // Arrange
     Mock<IDbSet<CharacterCreator>> mockSetCharacterCreators;
     var mockContext = CharacterCreatorsMockingSetup.DoMockingSetupForContext(true, out mockSetCharacterCreators);
     var repository = new CharacterCreatorsRepository(mockContext.Object);
     var characterCreators = repository.Get(1);
     // Act
     repository.Deactivate(characterCreators);
     // Assert
     Assert.Equal(false, characterCreators.Active);
 }
        public void Verify_Deactivate_Should_SetTheActivePropertyToFalseOnTheEntity()
        {
            // Arrange
            Mock <IDbSet <CharacterCreator> > mockSetCharacterCreators;
            var mockContext       = CharacterCreatorsMockingSetup.DoMockingSetupForContext(true, out mockSetCharacterCreators);
            var repository        = new CharacterCreatorsRepository(mockContext.Object);
            var characterCreators = repository.Get(1);

            // Act
            repository.Deactivate(characterCreators);
            // Assert
            Assert.Equal(false, characterCreators.Active);
        }
        public void Verify_Remove_Should_RemoveTheEntityFromTheContext()
        {
            // Arrange
            Mock <IDbSet <CharacterCreator> > mockSetCharacterCreators;
            var mockContext       = CharacterCreatorsMockingSetup.DoMockingSetupForContext(true, out mockSetCharacterCreators);
            var repository        = new CharacterCreatorsRepository(mockContext.Object);
            var characterCreators = repository.Get(1);

            // Act
            repository.Remove(characterCreators);
            // Assert
            mockSetCharacterCreators.Verify(x => x.Remove((CharacterCreator)characterCreators), Times.Once);
        }
        public void Verify_Update_Should_SetTheEntityStateToModified()
        {
            // Arrange
            Mock <IDbSet <CharacterCreator> > mockSetCharacterCreators;
            var mockContext       = CharacterCreatorsMockingSetup.DoMockingSetupForContext(true, out mockSetCharacterCreators);
            var repository        = new CharacterCreatorsRepository(mockContext.Object);
            var characterCreators = repository.Get(1);

            characterCreators.ApiDetailUrl = "/TEST";
            // Act
            repository.Update(characterCreators);
            // Assert
            mockContext.Verify(x => x.SetModified(It.IsAny <object>()), Times.Once);
        }
 public void Verify_Get_ByID_Should_ReturnTheCorrectCharacterCreator()
 {
     // Arrange
     Mock<IDbSet<CharacterCreator>> mockSetCharacterCreators;
     var mockContext = CharacterCreatorsMockingSetup.DoMockingSetupForContext(true, out mockSetCharacterCreators);
     var repository = new CharacterCreatorsRepository(mockContext.Object);
     // Act
     var characterCreators = repository.Get(1);
     // Assert
                 Assert.Equal("/TEST/KING-STEPHEN", characterCreators.ApiDetailUrl);
 }
 public void Verify_Update_Should_SetTheEntityStateToModified()
 {
     // Arrange
     Mock<IDbSet<CharacterCreator>> mockSetCharacterCreators;
     var mockContext = CharacterCreatorsMockingSetup.DoMockingSetupForContext(true, out mockSetCharacterCreators);
     var repository = new CharacterCreatorsRepository(mockContext.Object);
     var characterCreators = repository.Get(1);
     characterCreators.ApiDetailUrl = "/TEST";
     // Act
     repository.Update(characterCreators);
     // Assert
     mockContext.Verify(x => x.SetModified(It.IsAny<object>()), Times.Once);
 }
 public void Verify_Remove_Should_RemoveTheEntityFromTheContext()
 {
     // Arrange
     Mock<IDbSet<CharacterCreator>> mockSetCharacterCreators;
     var mockContext = CharacterCreatorsMockingSetup.DoMockingSetupForContext(true, out mockSetCharacterCreators);
     var repository = new CharacterCreatorsRepository(mockContext.Object);
     var characterCreators = repository.Get(1);
     // Act
     repository.Remove(characterCreators);
     // Assert
     mockSetCharacterCreators.Verify(x => x.Remove((CharacterCreator)characterCreators), Times.Once);
 }