public void Verify_Get_ByKey_Should_ReturnTheCorrectLocationAlias()
        {
            // Arrange
            Mock <IDbSet <LocationAlias> > mockSetLocationAliases;
            var mockContext = LocationAliasesMockingSetup.DoMockingSetupForContext(true, out mockSetLocationAliases);
            var repository  = new LocationAliasesRepository(mockContext.Object);
            // Act
            var locationAliases = repository.Get("KING-STEPHEN");

            // Assert
            Assert.Equal("/TEST/KING-STEPHEN", locationAliases.ApiDetailUrl);
        }
 public void Verify_Deactivate_Should_SetTheActivePropertyToFalseOnTheEntity()
 {
     // Arrange
     Mock<IDbSet<LocationAlias>> mockSetLocationAliases;
     var mockContext = LocationAliasesMockingSetup.DoMockingSetupForContext(true, out mockSetLocationAliases);
     var repository = new LocationAliasesRepository(mockContext.Object);
     var locationAliases = repository.Get(1);
     // Act
     repository.Deactivate(locationAliases);
     // Assert
     Assert.Equal(false, locationAliases.Active);
 }
        public void Verify_Deactivate_Should_SetTheActivePropertyToFalseOnTheEntity()
        {
            // Arrange
            Mock <IDbSet <LocationAlias> > mockSetLocationAliases;
            var mockContext     = LocationAliasesMockingSetup.DoMockingSetupForContext(true, out mockSetLocationAliases);
            var repository      = new LocationAliasesRepository(mockContext.Object);
            var locationAliases = repository.Get(1);

            // Act
            repository.Deactivate(locationAliases);
            // Assert
            Assert.Equal(false, locationAliases.Active);
        }
        public void Verify_Remove_Should_RemoveTheEntityFromTheContext()
        {
            // Arrange
            Mock <IDbSet <LocationAlias> > mockSetLocationAliases;
            var mockContext     = LocationAliasesMockingSetup.DoMockingSetupForContext(true, out mockSetLocationAliases);
            var repository      = new LocationAliasesRepository(mockContext.Object);
            var locationAliases = repository.Get(1);

            // Act
            repository.Remove(locationAliases);
            // Assert
            mockSetLocationAliases.Verify(x => x.Remove((LocationAlias)locationAliases), Times.Once);
        }
        public void Verify_Update_Should_SetTheEntityStateToModified()
        {
            // Arrange
            Mock <IDbSet <LocationAlias> > mockSetLocationAliases;
            var mockContext     = LocationAliasesMockingSetup.DoMockingSetupForContext(true, out mockSetLocationAliases);
            var repository      = new LocationAliasesRepository(mockContext.Object);
            var locationAliases = repository.Get(1);

            locationAliases.ApiDetailUrl = "/TEST";
            // Act
            repository.Update(locationAliases);
            // Assert
            mockContext.Verify(x => x.SetModified(It.IsAny <object>()), Times.Once);
        }
 public void Verify_Get_ByID_Should_ReturnTheCorrectLocationAlias()
 {
     // Arrange
     Mock<IDbSet<LocationAlias>> mockSetLocationAliases;
     var mockContext = LocationAliasesMockingSetup.DoMockingSetupForContext(true, out mockSetLocationAliases);
     var repository = new LocationAliasesRepository(mockContext.Object);
     // Act
     var locationAliases = repository.Get(1);
     // Assert
                 Assert.Equal("/TEST/KING-STEPHEN", locationAliases.ApiDetailUrl);
 }
 public void Verify_Update_Should_SetTheEntityStateToModified()
 {
     // Arrange
     Mock<IDbSet<LocationAlias>> mockSetLocationAliases;
     var mockContext = LocationAliasesMockingSetup.DoMockingSetupForContext(true, out mockSetLocationAliases);
     var repository = new LocationAliasesRepository(mockContext.Object);
     var locationAliases = repository.Get(1);
     locationAliases.ApiDetailUrl = "/TEST";
     // Act
     repository.Update(locationAliases);
     // Assert
     mockContext.Verify(x => x.SetModified(It.IsAny<object>()), Times.Once);
 }
 public void Verify_Remove_Should_RemoveTheEntityFromTheContext()
 {
     // Arrange
     Mock<IDbSet<LocationAlias>> mockSetLocationAliases;
     var mockContext = LocationAliasesMockingSetup.DoMockingSetupForContext(true, out mockSetLocationAliases);
     var repository = new LocationAliasesRepository(mockContext.Object);
     var locationAliases = repository.Get(1);
     // Act
     repository.Remove(locationAliases);
     // Assert
     mockSetLocationAliases.Verify(x => x.Remove((LocationAlias)locationAliases), Times.Once);
 }