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

            powerAliases.ApiDetailUrl = "/TEST";
            // Act
            repository.Update(powerAliases);
            // Assert
            mockContext.Verify(x => x.SetModified(It.IsAny <object>()), Times.Once);
        }
コード例 #2
0
 public void Verify_Update_Should_SetTheEntityStateToModified()
 {
     // Arrange
     Mock<IDbSet<PowerAlias>> mockSetPowerAliases;
     var mockContext = PowerAliasesMockingSetup.DoMockingSetupForContext(true, out mockSetPowerAliases);
     var repository = new PowerAliasesRepository(mockContext.Object);
     var powerAliases = repository.Get(1);
     powerAliases.ApiDetailUrl = "/TEST";
     // Act
     repository.Update(powerAliases);
     // Assert
     mockContext.Verify(x => x.SetModified(It.IsAny<object>()), Times.Once);
 }