public void Verify_Get_ByKey_Should_ReturnTheCorrectVolumeTeam() { // Arrange Mock <IDbSet <VolumeTeam> > mockSetVolumeTeams; var mockContext = VolumeTeamsMockingSetup.DoMockingSetupForContext(true, out mockSetVolumeTeams); var repository = new VolumeTeamsRepository(mockContext.Object); // Act var volumeTeams = repository.Get("KING-STEPHEN"); // Assert Assert.Equal("/TEST/KING-STEPHEN", volumeTeams.ApiDetailUrl); }
public void Verify_Deactivate_Should_SetTheActivePropertyToFalseOnTheEntity() { // Arrange Mock<IDbSet<VolumeTeam>> mockSetVolumeTeams; var mockContext = VolumeTeamsMockingSetup.DoMockingSetupForContext(true, out mockSetVolumeTeams); var repository = new VolumeTeamsRepository(mockContext.Object); var volumeTeams = repository.Get(1); // Act repository.Deactivate(volumeTeams); // Assert Assert.Equal(false, volumeTeams.Active); }
public void Verify_Deactivate_Should_SetTheActivePropertyToFalseOnTheEntity() { // Arrange Mock <IDbSet <VolumeTeam> > mockSetVolumeTeams; var mockContext = VolumeTeamsMockingSetup.DoMockingSetupForContext(true, out mockSetVolumeTeams); var repository = new VolumeTeamsRepository(mockContext.Object); var volumeTeams = repository.Get(1); // Act repository.Deactivate(volumeTeams); // Assert Assert.Equal(false, volumeTeams.Active); }
public void Verify_Remove_Should_RemoveTheEntityFromTheContext() { // Arrange Mock <IDbSet <VolumeTeam> > mockSetVolumeTeams; var mockContext = VolumeTeamsMockingSetup.DoMockingSetupForContext(true, out mockSetVolumeTeams); var repository = new VolumeTeamsRepository(mockContext.Object); var volumeTeams = repository.Get(1); // Act repository.Remove(volumeTeams); // Assert mockSetVolumeTeams.Verify(x => x.Remove((VolumeTeam)volumeTeams), Times.Once); }
public void Verify_Update_Should_SetTheEntityStateToModified() { // Arrange Mock <IDbSet <VolumeTeam> > mockSetVolumeTeams; var mockContext = VolumeTeamsMockingSetup.DoMockingSetupForContext(true, out mockSetVolumeTeams); var repository = new VolumeTeamsRepository(mockContext.Object); var volumeTeams = repository.Get(1); volumeTeams.ApiDetailUrl = "/TEST"; // Act repository.Update(volumeTeams); // Assert mockContext.Verify(x => x.SetModified(It.IsAny <object>()), Times.Once); }
public void Verify_Get_ByID_Should_ReturnTheCorrectVolumeTeam() { // Arrange Mock<IDbSet<VolumeTeam>> mockSetVolumeTeams; var mockContext = VolumeTeamsMockingSetup.DoMockingSetupForContext(true, out mockSetVolumeTeams); var repository = new VolumeTeamsRepository(mockContext.Object); // Act var volumeTeams = repository.Get(1); // Assert Assert.Equal("/TEST/KING-STEPHEN", volumeTeams.ApiDetailUrl); }
public void Verify_Update_Should_SetTheEntityStateToModified() { // Arrange Mock<IDbSet<VolumeTeam>> mockSetVolumeTeams; var mockContext = VolumeTeamsMockingSetup.DoMockingSetupForContext(true, out mockSetVolumeTeams); var repository = new VolumeTeamsRepository(mockContext.Object); var volumeTeams = repository.Get(1); volumeTeams.ApiDetailUrl = "/TEST"; // Act repository.Update(volumeTeams); // Assert mockContext.Verify(x => x.SetModified(It.IsAny<object>()), Times.Once); }
public void Verify_Remove_Should_RemoveTheEntityFromTheContext() { // Arrange Mock<IDbSet<VolumeTeam>> mockSetVolumeTeams; var mockContext = VolumeTeamsMockingSetup.DoMockingSetupForContext(true, out mockSetVolumeTeams); var repository = new VolumeTeamsRepository(mockContext.Object); var volumeTeams = repository.Get(1); // Act repository.Remove(volumeTeams); // Assert mockSetVolumeTeams.Verify(x => x.Remove((VolumeTeam)volumeTeams), Times.Once); }