public void Verify_Get_ByKey_Should_ReturnTheCorrectMovieLocation()
        {
            // Arrange
            Mock <IDbSet <MovieLocation> > mockSetMovieLocations;
            var mockContext = MovieLocationsMockingSetup.DoMockingSetupForContext(true, out mockSetMovieLocations);
            var repository  = new MovieLocationsRepository(mockContext.Object);
            // Act
            var movieLocations = repository.Get("KING-STEPHEN");

            // Assert
            Assert.Equal("/TEST/KING-STEPHEN", movieLocations.ApiDetailUrl);
        }
 public void Verify_Deactivate_Should_SetTheActivePropertyToFalseOnTheEntity()
 {
     // Arrange
     Mock<IDbSet<MovieLocation>> mockSetMovieLocations;
     var mockContext = MovieLocationsMockingSetup.DoMockingSetupForContext(true, out mockSetMovieLocations);
     var repository = new MovieLocationsRepository(mockContext.Object);
     var movieLocations = repository.Get(1);
     // Act
     repository.Deactivate(movieLocations);
     // Assert
     Assert.Equal(false, movieLocations.Active);
 }
        public void Verify_Deactivate_Should_SetTheActivePropertyToFalseOnTheEntity()
        {
            // Arrange
            Mock <IDbSet <MovieLocation> > mockSetMovieLocations;
            var mockContext    = MovieLocationsMockingSetup.DoMockingSetupForContext(true, out mockSetMovieLocations);
            var repository     = new MovieLocationsRepository(mockContext.Object);
            var movieLocations = repository.Get(1);

            // Act
            repository.Deactivate(movieLocations);
            // Assert
            Assert.Equal(false, movieLocations.Active);
        }
        public void Verify_Remove_Should_RemoveTheEntityFromTheContext()
        {
            // Arrange
            Mock <IDbSet <MovieLocation> > mockSetMovieLocations;
            var mockContext    = MovieLocationsMockingSetup.DoMockingSetupForContext(true, out mockSetMovieLocations);
            var repository     = new MovieLocationsRepository(mockContext.Object);
            var movieLocations = repository.Get(1);

            // Act
            repository.Remove(movieLocations);
            // Assert
            mockSetMovieLocations.Verify(x => x.Remove((MovieLocation)movieLocations), Times.Once);
        }
        public void Verify_Update_Should_SetTheEntityStateToModified()
        {
            // Arrange
            Mock <IDbSet <MovieLocation> > mockSetMovieLocations;
            var mockContext    = MovieLocationsMockingSetup.DoMockingSetupForContext(true, out mockSetMovieLocations);
            var repository     = new MovieLocationsRepository(mockContext.Object);
            var movieLocations = repository.Get(1);

            movieLocations.ApiDetailUrl = "/TEST";
            // Act
            repository.Update(movieLocations);
            // Assert
            mockContext.Verify(x => x.SetModified(It.IsAny <object>()), Times.Once);
        }
 public void Verify_Get_ByID_Should_ReturnTheCorrectMovieLocation()
 {
     // Arrange
     Mock<IDbSet<MovieLocation>> mockSetMovieLocations;
     var mockContext = MovieLocationsMockingSetup.DoMockingSetupForContext(true, out mockSetMovieLocations);
     var repository = new MovieLocationsRepository(mockContext.Object);
     // Act
     var movieLocations = repository.Get(1);
     // Assert
                 Assert.Equal("/TEST/KING-STEPHEN", movieLocations.ApiDetailUrl);
 }
 public void Verify_Update_Should_SetTheEntityStateToModified()
 {
     // Arrange
     Mock<IDbSet<MovieLocation>> mockSetMovieLocations;
     var mockContext = MovieLocationsMockingSetup.DoMockingSetupForContext(true, out mockSetMovieLocations);
     var repository = new MovieLocationsRepository(mockContext.Object);
     var movieLocations = repository.Get(1);
     movieLocations.ApiDetailUrl = "/TEST";
     // Act
     repository.Update(movieLocations);
     // Assert
     mockContext.Verify(x => x.SetModified(It.IsAny<object>()), Times.Once);
 }
 public void Verify_Remove_Should_RemoveTheEntityFromTheContext()
 {
     // Arrange
     Mock<IDbSet<MovieLocation>> mockSetMovieLocations;
     var mockContext = MovieLocationsMockingSetup.DoMockingSetupForContext(true, out mockSetMovieLocations);
     var repository = new MovieLocationsRepository(mockContext.Object);
     var movieLocations = repository.Get(1);
     // Act
     repository.Remove(movieLocations);
     // Assert
     mockSetMovieLocations.Verify(x => x.Remove((MovieLocation)movieLocations), Times.Once);
 }