コード例 #1
0
        public void Verify_Get_ByKey_Should_ReturnTheCorrectEpisodeConceptFirstAppearance()
        {
            // Arrange
            Mock <IDbSet <EpisodeConceptFirstAppearance> > mockSetEpisodeConceptFirstAppearances;
            var mockContext = EpisodeConceptFirstAppearancesMockingSetup.DoMockingSetupForContext(true, out mockSetEpisodeConceptFirstAppearances);
            var repository  = new EpisodeConceptFirstAppearancesRepository(mockContext.Object);
            // Act
            var episodeConceptFirstAppearances = repository.Get("KING-STEPHEN");

            // Assert
            Assert.Equal("/TEST/KING-STEPHEN", episodeConceptFirstAppearances.ApiDetailUrl);
        }
 public void Verify_Deactivate_Should_SetTheActivePropertyToFalseOnTheEntity()
 {
     // Arrange
     Mock<IDbSet<EpisodeConceptFirstAppearance>> mockSetEpisodeConceptFirstAppearances;
     var mockContext = EpisodeConceptFirstAppearancesMockingSetup.DoMockingSetupForContext(true, out mockSetEpisodeConceptFirstAppearances);
     var repository = new EpisodeConceptFirstAppearancesRepository(mockContext.Object);
     var episodeConceptFirstAppearances = repository.Get(1);
     // Act
     repository.Deactivate(episodeConceptFirstAppearances);
     // Assert
     Assert.Equal(false, episodeConceptFirstAppearances.Active);
 }
コード例 #3
0
        public void Verify_Deactivate_Should_SetTheActivePropertyToFalseOnTheEntity()
        {
            // Arrange
            Mock <IDbSet <EpisodeConceptFirstAppearance> > mockSetEpisodeConceptFirstAppearances;
            var mockContext = EpisodeConceptFirstAppearancesMockingSetup.DoMockingSetupForContext(true, out mockSetEpisodeConceptFirstAppearances);
            var repository  = new EpisodeConceptFirstAppearancesRepository(mockContext.Object);
            var episodeConceptFirstAppearances = repository.Get(1);

            // Act
            repository.Deactivate(episodeConceptFirstAppearances);
            // Assert
            Assert.Equal(false, episodeConceptFirstAppearances.Active);
        }
コード例 #4
0
        public void Verify_Remove_Should_RemoveTheEntityFromTheContext()
        {
            // Arrange
            Mock <IDbSet <EpisodeConceptFirstAppearance> > mockSetEpisodeConceptFirstAppearances;
            var mockContext = EpisodeConceptFirstAppearancesMockingSetup.DoMockingSetupForContext(true, out mockSetEpisodeConceptFirstAppearances);
            var repository  = new EpisodeConceptFirstAppearancesRepository(mockContext.Object);
            var episodeConceptFirstAppearances = repository.Get(1);

            // Act
            repository.Remove(episodeConceptFirstAppearances);
            // Assert
            mockSetEpisodeConceptFirstAppearances.Verify(x => x.Remove((EpisodeConceptFirstAppearance)episodeConceptFirstAppearances), Times.Once);
        }
コード例 #5
0
        public void Verify_Update_Should_SetTheEntityStateToModified()
        {
            // Arrange
            Mock <IDbSet <EpisodeConceptFirstAppearance> > mockSetEpisodeConceptFirstAppearances;
            var mockContext = EpisodeConceptFirstAppearancesMockingSetup.DoMockingSetupForContext(true, out mockSetEpisodeConceptFirstAppearances);
            var repository  = new EpisodeConceptFirstAppearancesRepository(mockContext.Object);
            var episodeConceptFirstAppearances = repository.Get(1);

            episodeConceptFirstAppearances.ApiDetailUrl = "/TEST";
            // Act
            repository.Update(episodeConceptFirstAppearances);
            // Assert
            mockContext.Verify(x => x.SetModified(It.IsAny <object>()), Times.Once);
        }
 public void Verify_Get_ByID_Should_ReturnTheCorrectEpisodeConceptFirstAppearance()
 {
     // Arrange
     Mock<IDbSet<EpisodeConceptFirstAppearance>> mockSetEpisodeConceptFirstAppearances;
     var mockContext = EpisodeConceptFirstAppearancesMockingSetup.DoMockingSetupForContext(true, out mockSetEpisodeConceptFirstAppearances);
     var repository = new EpisodeConceptFirstAppearancesRepository(mockContext.Object);
     // Act
     var episodeConceptFirstAppearances = repository.Get(1);
     // Assert
                 Assert.Equal("/TEST/KING-STEPHEN", episodeConceptFirstAppearances.ApiDetailUrl);
 }
 public void Verify_Update_Should_SetTheEntityStateToModified()
 {
     // Arrange
     Mock<IDbSet<EpisodeConceptFirstAppearance>> mockSetEpisodeConceptFirstAppearances;
     var mockContext = EpisodeConceptFirstAppearancesMockingSetup.DoMockingSetupForContext(true, out mockSetEpisodeConceptFirstAppearances);
     var repository = new EpisodeConceptFirstAppearancesRepository(mockContext.Object);
     var episodeConceptFirstAppearances = repository.Get(1);
     episodeConceptFirstAppearances.ApiDetailUrl = "/TEST";
     // Act
     repository.Update(episodeConceptFirstAppearances);
     // Assert
     mockContext.Verify(x => x.SetModified(It.IsAny<object>()), Times.Once);
 }
 public void Verify_Remove_Should_RemoveTheEntityFromTheContext()
 {
     // Arrange
     Mock<IDbSet<EpisodeConceptFirstAppearance>> mockSetEpisodeConceptFirstAppearances;
     var mockContext = EpisodeConceptFirstAppearancesMockingSetup.DoMockingSetupForContext(true, out mockSetEpisodeConceptFirstAppearances);
     var repository = new EpisodeConceptFirstAppearancesRepository(mockContext.Object);
     var episodeConceptFirstAppearances = repository.Get(1);
     // Act
     repository.Remove(episodeConceptFirstAppearances);
     // Assert
     mockSetEpisodeConceptFirstAppearances.Verify(x => x.Remove((EpisodeConceptFirstAppearance)episodeConceptFirstAppearances), Times.Once);
 }