public void Verify_Get_ByKey_Should_ReturnTheCorrectLocationAppearedInIssue()
        {
            // Arrange
            Mock <IDbSet <LocationAppearedInIssue> > mockSetLocationAppearedInIssues;
            var mockContext = LocationAppearedInIssuesMockingSetup.DoMockingSetupForContext(true, out mockSetLocationAppearedInIssues);
            var repository  = new LocationAppearedInIssuesRepository(mockContext.Object);
            // Act
            var locationAppearedInIssues = repository.Get("KING-STEPHEN");

            // Assert
            Assert.Equal("/TEST/KING-STEPHEN", locationAppearedInIssues.ApiDetailUrl);
        }
 public void Verify_Deactivate_Should_SetTheActivePropertyToFalseOnTheEntity()
 {
     // Arrange
     Mock<IDbSet<LocationAppearedInIssue>> mockSetLocationAppearedInIssues;
     var mockContext = LocationAppearedInIssuesMockingSetup.DoMockingSetupForContext(true, out mockSetLocationAppearedInIssues);
     var repository = new LocationAppearedInIssuesRepository(mockContext.Object);
     var locationAppearedInIssues = repository.Get(1);
     // Act
     repository.Deactivate(locationAppearedInIssues);
     // Assert
     Assert.Equal(false, locationAppearedInIssues.Active);
 }
        public void Verify_Deactivate_Should_SetTheActivePropertyToFalseOnTheEntity()
        {
            // Arrange
            Mock <IDbSet <LocationAppearedInIssue> > mockSetLocationAppearedInIssues;
            var mockContext = LocationAppearedInIssuesMockingSetup.DoMockingSetupForContext(true, out mockSetLocationAppearedInIssues);
            var repository  = new LocationAppearedInIssuesRepository(mockContext.Object);
            var locationAppearedInIssues = repository.Get(1);

            // Act
            repository.Deactivate(locationAppearedInIssues);
            // Assert
            Assert.Equal(false, locationAppearedInIssues.Active);
        }
        public void Verify_Remove_Should_RemoveTheEntityFromTheContext()
        {
            // Arrange
            Mock <IDbSet <LocationAppearedInIssue> > mockSetLocationAppearedInIssues;
            var mockContext = LocationAppearedInIssuesMockingSetup.DoMockingSetupForContext(true, out mockSetLocationAppearedInIssues);
            var repository  = new LocationAppearedInIssuesRepository(mockContext.Object);
            var locationAppearedInIssues = repository.Get(1);

            // Act
            repository.Remove(locationAppearedInIssues);
            // Assert
            mockSetLocationAppearedInIssues.Verify(x => x.Remove((LocationAppearedInIssue)locationAppearedInIssues), Times.Once);
        }
        public void Verify_Update_Should_SetTheEntityStateToModified()
        {
            // Arrange
            Mock <IDbSet <LocationAppearedInIssue> > mockSetLocationAppearedInIssues;
            var mockContext = LocationAppearedInIssuesMockingSetup.DoMockingSetupForContext(true, out mockSetLocationAppearedInIssues);
            var repository  = new LocationAppearedInIssuesRepository(mockContext.Object);
            var locationAppearedInIssues = repository.Get(1);

            locationAppearedInIssues.ApiDetailUrl = "/TEST";
            // Act
            repository.Update(locationAppearedInIssues);
            // Assert
            mockContext.Verify(x => x.SetModified(It.IsAny <object>()), Times.Once);
        }
 public void Verify_Get_ByID_Should_ReturnTheCorrectLocationAppearedInIssue()
 {
     // Arrange
     Mock<IDbSet<LocationAppearedInIssue>> mockSetLocationAppearedInIssues;
     var mockContext = LocationAppearedInIssuesMockingSetup.DoMockingSetupForContext(true, out mockSetLocationAppearedInIssues);
     var repository = new LocationAppearedInIssuesRepository(mockContext.Object);
     // Act
     var locationAppearedInIssues = repository.Get(1);
     // Assert
                 Assert.Equal("/TEST/KING-STEPHEN", locationAppearedInIssues.ApiDetailUrl);
 }
 public void Verify_Update_Should_SetTheEntityStateToModified()
 {
     // Arrange
     Mock<IDbSet<LocationAppearedInIssue>> mockSetLocationAppearedInIssues;
     var mockContext = LocationAppearedInIssuesMockingSetup.DoMockingSetupForContext(true, out mockSetLocationAppearedInIssues);
     var repository = new LocationAppearedInIssuesRepository(mockContext.Object);
     var locationAppearedInIssues = repository.Get(1);
     locationAppearedInIssues.ApiDetailUrl = "/TEST";
     // Act
     repository.Update(locationAppearedInIssues);
     // Assert
     mockContext.Verify(x => x.SetModified(It.IsAny<object>()), Times.Once);
 }
 public void Verify_Remove_Should_RemoveTheEntityFromTheContext()
 {
     // Arrange
     Mock<IDbSet<LocationAppearedInIssue>> mockSetLocationAppearedInIssues;
     var mockContext = LocationAppearedInIssuesMockingSetup.DoMockingSetupForContext(true, out mockSetLocationAppearedInIssues);
     var repository = new LocationAppearedInIssuesRepository(mockContext.Object);
     var locationAppearedInIssues = repository.Get(1);
     // Act
     repository.Remove(locationAppearedInIssues);
     // Assert
     mockSetLocationAppearedInIssues.Verify(x => x.Remove((LocationAppearedInIssue)locationAppearedInIssues), Times.Once);
 }