public void Verify_Get_ByKey_Should_ReturnTheCorrectCharacterPower()
        {
            // Arrange
            Mock <IDbSet <CharacterPower> > mockSetCharacterPowers;
            var mockContext = CharacterPowersMockingSetup.DoMockingSetupForContext(true, out mockSetCharacterPowers);
            var repository  = new CharacterPowersRepository(mockContext.Object);
            // Act
            var characterPowers = repository.Get("KING-STEPHEN");

            // Assert
            Assert.Equal("/TEST/KING-STEPHEN", characterPowers.ApiDetailUrl);
        }
 public void Verify_Deactivate_Should_SetTheActivePropertyToFalseOnTheEntity()
 {
     // Arrange
     Mock<IDbSet<CharacterPower>> mockSetCharacterPowers;
     var mockContext = CharacterPowersMockingSetup.DoMockingSetupForContext(true, out mockSetCharacterPowers);
     var repository = new CharacterPowersRepository(mockContext.Object);
     var characterPowers = repository.Get(1);
     // Act
     repository.Deactivate(characterPowers);
     // Assert
     Assert.Equal(false, characterPowers.Active);
 }
        public void Verify_Deactivate_Should_SetTheActivePropertyToFalseOnTheEntity()
        {
            // Arrange
            Mock <IDbSet <CharacterPower> > mockSetCharacterPowers;
            var mockContext     = CharacterPowersMockingSetup.DoMockingSetupForContext(true, out mockSetCharacterPowers);
            var repository      = new CharacterPowersRepository(mockContext.Object);
            var characterPowers = repository.Get(1);

            // Act
            repository.Deactivate(characterPowers);
            // Assert
            Assert.Equal(false, characterPowers.Active);
        }
        public void Verify_Remove_Should_RemoveTheEntityFromTheContext()
        {
            // Arrange
            Mock <IDbSet <CharacterPower> > mockSetCharacterPowers;
            var mockContext     = CharacterPowersMockingSetup.DoMockingSetupForContext(true, out mockSetCharacterPowers);
            var repository      = new CharacterPowersRepository(mockContext.Object);
            var characterPowers = repository.Get(1);

            // Act
            repository.Remove(characterPowers);
            // Assert
            mockSetCharacterPowers.Verify(x => x.Remove((CharacterPower)characterPowers), Times.Once);
        }
        public void Verify_Update_Should_SetTheEntityStateToModified()
        {
            // Arrange
            Mock <IDbSet <CharacterPower> > mockSetCharacterPowers;
            var mockContext     = CharacterPowersMockingSetup.DoMockingSetupForContext(true, out mockSetCharacterPowers);
            var repository      = new CharacterPowersRepository(mockContext.Object);
            var characterPowers = repository.Get(1);

            characterPowers.ApiDetailUrl = "/TEST";
            // Act
            repository.Update(characterPowers);
            // Assert
            mockContext.Verify(x => x.SetModified(It.IsAny <object>()), Times.Once);
        }
 public void Verify_Get_ByID_Should_ReturnTheCorrectCharacterPower()
 {
     // Arrange
     Mock<IDbSet<CharacterPower>> mockSetCharacterPowers;
     var mockContext = CharacterPowersMockingSetup.DoMockingSetupForContext(true, out mockSetCharacterPowers);
     var repository = new CharacterPowersRepository(mockContext.Object);
     // Act
     var characterPowers = repository.Get(1);
     // Assert
                 Assert.Equal("/TEST/KING-STEPHEN", characterPowers.ApiDetailUrl);
 }
 public void Verify_Update_Should_SetTheEntityStateToModified()
 {
     // Arrange
     Mock<IDbSet<CharacterPower>> mockSetCharacterPowers;
     var mockContext = CharacterPowersMockingSetup.DoMockingSetupForContext(true, out mockSetCharacterPowers);
     var repository = new CharacterPowersRepository(mockContext.Object);
     var characterPowers = repository.Get(1);
     characterPowers.ApiDetailUrl = "/TEST";
     // Act
     repository.Update(characterPowers);
     // Assert
     mockContext.Verify(x => x.SetModified(It.IsAny<object>()), Times.Once);
 }
 public void Verify_Remove_Should_RemoveTheEntityFromTheContext()
 {
     // Arrange
     Mock<IDbSet<CharacterPower>> mockSetCharacterPowers;
     var mockContext = CharacterPowersMockingSetup.DoMockingSetupForContext(true, out mockSetCharacterPowers);
     var repository = new CharacterPowersRepository(mockContext.Object);
     var characterPowers = repository.Get(1);
     // Act
     repository.Remove(characterPowers);
     // Assert
     mockSetCharacterPowers.Verify(x => x.Remove((CharacterPower)characterPowers), Times.Once);
 }