public void Verify_Get_ByKey_Should_ReturnTheCorrectSeriesLocation()
        {
            // Arrange
            Mock <IDbSet <SeriesLocation> > mockSetSeriesLocations;
            var mockContext = SeriesLocationsMockingSetup.DoMockingSetupForContext(true, out mockSetSeriesLocations);
            var repository  = new SeriesLocationsRepository(mockContext.Object);
            // Act
            var seriesLocations = repository.Get("KING-STEPHEN");

            // Assert
            Assert.Equal("/TEST/KING-STEPHEN", seriesLocations.ApiDetailUrl);
        }
 public void Verify_Deactivate_Should_SetTheActivePropertyToFalseOnTheEntity()
 {
     // Arrange
     Mock<IDbSet<SeriesLocation>> mockSetSeriesLocations;
     var mockContext = SeriesLocationsMockingSetup.DoMockingSetupForContext(true, out mockSetSeriesLocations);
     var repository = new SeriesLocationsRepository(mockContext.Object);
     var seriesLocations = repository.Get(1);
     // Act
     repository.Deactivate(seriesLocations);
     // Assert
     Assert.Equal(false, seriesLocations.Active);
 }
        public void Verify_Deactivate_Should_SetTheActivePropertyToFalseOnTheEntity()
        {
            // Arrange
            Mock <IDbSet <SeriesLocation> > mockSetSeriesLocations;
            var mockContext     = SeriesLocationsMockingSetup.DoMockingSetupForContext(true, out mockSetSeriesLocations);
            var repository      = new SeriesLocationsRepository(mockContext.Object);
            var seriesLocations = repository.Get(1);

            // Act
            repository.Deactivate(seriesLocations);
            // Assert
            Assert.Equal(false, seriesLocations.Active);
        }
        public void Verify_Remove_Should_RemoveTheEntityFromTheContext()
        {
            // Arrange
            Mock <IDbSet <SeriesLocation> > mockSetSeriesLocations;
            var mockContext     = SeriesLocationsMockingSetup.DoMockingSetupForContext(true, out mockSetSeriesLocations);
            var repository      = new SeriesLocationsRepository(mockContext.Object);
            var seriesLocations = repository.Get(1);

            // Act
            repository.Remove(seriesLocations);
            // Assert
            mockSetSeriesLocations.Verify(x => x.Remove((SeriesLocation)seriesLocations), Times.Once);
        }
        public void Verify_Update_Should_SetTheEntityStateToModified()
        {
            // Arrange
            Mock <IDbSet <SeriesLocation> > mockSetSeriesLocations;
            var mockContext     = SeriesLocationsMockingSetup.DoMockingSetupForContext(true, out mockSetSeriesLocations);
            var repository      = new SeriesLocationsRepository(mockContext.Object);
            var seriesLocations = repository.Get(1);

            seriesLocations.ApiDetailUrl = "/TEST";
            // Act
            repository.Update(seriesLocations);
            // Assert
            mockContext.Verify(x => x.SetModified(It.IsAny <object>()), Times.Once);
        }
 public void Verify_Get_ByID_Should_ReturnTheCorrectSeriesLocation()
 {
     // Arrange
     Mock<IDbSet<SeriesLocation>> mockSetSeriesLocations;
     var mockContext = SeriesLocationsMockingSetup.DoMockingSetupForContext(true, out mockSetSeriesLocations);
     var repository = new SeriesLocationsRepository(mockContext.Object);
     // Act
     var seriesLocations = repository.Get(1);
     // Assert
                 Assert.Equal("/TEST/KING-STEPHEN", seriesLocations.ApiDetailUrl);
 }
 public void Verify_Update_Should_SetTheEntityStateToModified()
 {
     // Arrange
     Mock<IDbSet<SeriesLocation>> mockSetSeriesLocations;
     var mockContext = SeriesLocationsMockingSetup.DoMockingSetupForContext(true, out mockSetSeriesLocations);
     var repository = new SeriesLocationsRepository(mockContext.Object);
     var seriesLocations = repository.Get(1);
     seriesLocations.ApiDetailUrl = "/TEST";
     // Act
     repository.Update(seriesLocations);
     // Assert
     mockContext.Verify(x => x.SetModified(It.IsAny<object>()), Times.Once);
 }
 public void Verify_Remove_Should_RemoveTheEntityFromTheContext()
 {
     // Arrange
     Mock<IDbSet<SeriesLocation>> mockSetSeriesLocations;
     var mockContext = SeriesLocationsMockingSetup.DoMockingSetupForContext(true, out mockSetSeriesLocations);
     var repository = new SeriesLocationsRepository(mockContext.Object);
     var seriesLocations = repository.Get(1);
     // Act
     repository.Remove(seriesLocations);
     // Assert
     mockSetSeriesLocations.Verify(x => x.Remove((SeriesLocation)seriesLocations), Times.Once);
 }