예제 #1
0
        public void Verify_Remove_Should_RemoveTheEntityFromTheContext()
        {
            // Arrange
            Mock <IDbSet <PowerAlias> > mockSetPowerAliases;
            var mockContext  = PowerAliasesMockingSetup.DoMockingSetupForContext(true, out mockSetPowerAliases);
            var repository   = new PowerAliasesRepository(mockContext.Object);
            var powerAliases = repository.Get(1);

            // Act
            repository.Remove(powerAliases);
            // Assert
            mockSetPowerAliases.Verify(x => x.Remove((PowerAlias)powerAliases), Times.Once);
        }
 public void Verify_Remove_Should_RemoveTheEntityFromTheContext()
 {
     // Arrange
     Mock<IDbSet<PowerAlias>> mockSetPowerAliases;
     var mockContext = PowerAliasesMockingSetup.DoMockingSetupForContext(true, out mockSetPowerAliases);
     var repository = new PowerAliasesRepository(mockContext.Object);
     var powerAliases = repository.Get(1);
     // Act
     repository.Remove(powerAliases);
     // Assert
     mockSetPowerAliases.Verify(x => x.Remove((PowerAlias)powerAliases), Times.Once);
 }