public void Verify_Get_ByKey_Should_ReturnTheCorrectConceptIssue() { // Arrange Mock <IDbSet <ConceptIssue> > mockSetConceptIssues; var mockContext = ConceptIssuesMockingSetup.DoMockingSetupForContext(true, out mockSetConceptIssues); var repository = new ConceptIssuesRepository(mockContext.Object); // Act var conceptIssues = repository.Get("KING-STEPHEN"); // Assert Assert.Equal("/TEST/KING-STEPHEN", conceptIssues.ApiDetailUrl); }
public void Verify_Deactivate_Should_SetTheActivePropertyToFalseOnTheEntity() { // Arrange Mock<IDbSet<ConceptIssue>> mockSetConceptIssues; var mockContext = ConceptIssuesMockingSetup.DoMockingSetupForContext(true, out mockSetConceptIssues); var repository = new ConceptIssuesRepository(mockContext.Object); var conceptIssues = repository.Get(1); // Act repository.Deactivate(conceptIssues); // Assert Assert.Equal(false, conceptIssues.Active); }
public void Verify_Deactivate_Should_SetTheActivePropertyToFalseOnTheEntity() { // Arrange Mock <IDbSet <ConceptIssue> > mockSetConceptIssues; var mockContext = ConceptIssuesMockingSetup.DoMockingSetupForContext(true, out mockSetConceptIssues); var repository = new ConceptIssuesRepository(mockContext.Object); var conceptIssues = repository.Get(1); // Act repository.Deactivate(conceptIssues); // Assert Assert.Equal(false, conceptIssues.Active); }
public void Verify_Remove_Should_RemoveTheEntityFromTheContext() { // Arrange Mock <IDbSet <ConceptIssue> > mockSetConceptIssues; var mockContext = ConceptIssuesMockingSetup.DoMockingSetupForContext(true, out mockSetConceptIssues); var repository = new ConceptIssuesRepository(mockContext.Object); var conceptIssues = repository.Get(1); // Act repository.Remove(conceptIssues); // Assert mockSetConceptIssues.Verify(x => x.Remove((ConceptIssue)conceptIssues), Times.Once); }
public void Verify_Update_Should_SetTheEntityStateToModified() { // Arrange Mock <IDbSet <ConceptIssue> > mockSetConceptIssues; var mockContext = ConceptIssuesMockingSetup.DoMockingSetupForContext(true, out mockSetConceptIssues); var repository = new ConceptIssuesRepository(mockContext.Object); var conceptIssues = repository.Get(1); conceptIssues.ApiDetailUrl = "/TEST"; // Act repository.Update(conceptIssues); // Assert mockContext.Verify(x => x.SetModified(It.IsAny <object>()), Times.Once); }
public void Verify_Get_ByID_Should_ReturnTheCorrectConceptIssue() { // Arrange Mock<IDbSet<ConceptIssue>> mockSetConceptIssues; var mockContext = ConceptIssuesMockingSetup.DoMockingSetupForContext(true, out mockSetConceptIssues); var repository = new ConceptIssuesRepository(mockContext.Object); // Act var conceptIssues = repository.Get(1); // Assert Assert.Equal("/TEST/KING-STEPHEN", conceptIssues.ApiDetailUrl); }
public void Verify_Update_Should_SetTheEntityStateToModified() { // Arrange Mock<IDbSet<ConceptIssue>> mockSetConceptIssues; var mockContext = ConceptIssuesMockingSetup.DoMockingSetupForContext(true, out mockSetConceptIssues); var repository = new ConceptIssuesRepository(mockContext.Object); var conceptIssues = repository.Get(1); conceptIssues.ApiDetailUrl = "/TEST"; // Act repository.Update(conceptIssues); // Assert mockContext.Verify(x => x.SetModified(It.IsAny<object>()), Times.Once); }
public void Verify_Remove_Should_RemoveTheEntityFromTheContext() { // Arrange Mock<IDbSet<ConceptIssue>> mockSetConceptIssues; var mockContext = ConceptIssuesMockingSetup.DoMockingSetupForContext(true, out mockSetConceptIssues); var repository = new ConceptIssuesRepository(mockContext.Object); var conceptIssues = repository.Get(1); // Act repository.Remove(conceptIssues); // Assert mockSetConceptIssues.Verify(x => x.Remove((ConceptIssue)conceptIssues), Times.Once); }