Beispiel #1
0
        public void Verify_Get_ByKey_Should_ReturnTheCorrectOriginProfile()
        {
            // Arrange
            Mock <IDbSet <OriginProfile> > mockSetOriginProfiles;
            var mockContext = OriginProfilesMockingSetup.DoMockingSetupForContext(true, out mockSetOriginProfiles);
            var repository  = new OriginProfilesRepository(mockContext.Object);
            // Act
            var originProfiles = repository.Get("KING-STEPHEN");

            // Assert
            Assert.Equal("/TEST/KING-STEPHEN", originProfiles.ApiDetailUrl);
        }
 public void Verify_Deactivate_Should_SetTheActivePropertyToFalseOnTheEntity()
 {
     // Arrange
     Mock<IDbSet<OriginProfile>> mockSetOriginProfiles;
     var mockContext = OriginProfilesMockingSetup.DoMockingSetupForContext(true, out mockSetOriginProfiles);
     var repository = new OriginProfilesRepository(mockContext.Object);
     var originProfiles = repository.Get(1);
     // Act
     repository.Deactivate(originProfiles);
     // Assert
     Assert.Equal(false, originProfiles.Active);
 }
Beispiel #3
0
        public void Verify_Deactivate_Should_SetTheActivePropertyToFalseOnTheEntity()
        {
            // Arrange
            Mock <IDbSet <OriginProfile> > mockSetOriginProfiles;
            var mockContext    = OriginProfilesMockingSetup.DoMockingSetupForContext(true, out mockSetOriginProfiles);
            var repository     = new OriginProfilesRepository(mockContext.Object);
            var originProfiles = repository.Get(1);

            // Act
            repository.Deactivate(originProfiles);
            // Assert
            Assert.Equal(false, originProfiles.Active);
        }
Beispiel #4
0
        public void Verify_Remove_Should_RemoveTheEntityFromTheContext()
        {
            // Arrange
            Mock <IDbSet <OriginProfile> > mockSetOriginProfiles;
            var mockContext    = OriginProfilesMockingSetup.DoMockingSetupForContext(true, out mockSetOriginProfiles);
            var repository     = new OriginProfilesRepository(mockContext.Object);
            var originProfiles = repository.Get(1);

            // Act
            repository.Remove(originProfiles);
            // Assert
            mockSetOriginProfiles.Verify(x => x.Remove((OriginProfile)originProfiles), Times.Once);
        }
Beispiel #5
0
        public void Verify_Update_Should_SetTheEntityStateToModified()
        {
            // Arrange
            Mock <IDbSet <OriginProfile> > mockSetOriginProfiles;
            var mockContext    = OriginProfilesMockingSetup.DoMockingSetupForContext(true, out mockSetOriginProfiles);
            var repository     = new OriginProfilesRepository(mockContext.Object);
            var originProfiles = repository.Get(1);

            originProfiles.ApiDetailUrl = "/TEST";
            // Act
            repository.Update(originProfiles);
            // Assert
            mockContext.Verify(x => x.SetModified(It.IsAny <object>()), Times.Once);
        }
 public void Verify_Get_ByID_Should_ReturnTheCorrectOriginProfile()
 {
     // Arrange
     Mock<IDbSet<OriginProfile>> mockSetOriginProfiles;
     var mockContext = OriginProfilesMockingSetup.DoMockingSetupForContext(true, out mockSetOriginProfiles);
     var repository = new OriginProfilesRepository(mockContext.Object);
     // Act
     var originProfiles = repository.Get(1);
     // Assert
                 Assert.Equal("/TEST/KING-STEPHEN", originProfiles.ApiDetailUrl);
 }
 public void Verify_Update_Should_SetTheEntityStateToModified()
 {
     // Arrange
     Mock<IDbSet<OriginProfile>> mockSetOriginProfiles;
     var mockContext = OriginProfilesMockingSetup.DoMockingSetupForContext(true, out mockSetOriginProfiles);
     var repository = new OriginProfilesRepository(mockContext.Object);
     var originProfiles = repository.Get(1);
     originProfiles.ApiDetailUrl = "/TEST";
     // Act
     repository.Update(originProfiles);
     // Assert
     mockContext.Verify(x => x.SetModified(It.IsAny<object>()), Times.Once);
 }
 public void Verify_Remove_Should_RemoveTheEntityFromTheContext()
 {
     // Arrange
     Mock<IDbSet<OriginProfile>> mockSetOriginProfiles;
     var mockContext = OriginProfilesMockingSetup.DoMockingSetupForContext(true, out mockSetOriginProfiles);
     var repository = new OriginProfilesRepository(mockContext.Object);
     var originProfiles = repository.Get(1);
     // Act
     repository.Remove(originProfiles);
     // Assert
     mockSetOriginProfiles.Verify(x => x.Remove((OriginProfile)originProfiles), Times.Once);
 }