public void ServiceGetByIdTest()
        {
            // Arrange
            _Repository.FindById(Arg.Any <int>()).Returns(_List[0]);
            // Act
            var result = _Service.FindById(dummyId);

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.IntNumber == dummyId);
        }
Beispiel #2
0
 public async Task DeleteAsync(TId entityId)
 {
     TEntity entity = repository.FindById(entityId);
     await repository.DeleteAsync(entity);
 }
Beispiel #3
0
 /// <summary>
 /// Deletes the asynchronous.
 /// </summary>
 /// <param name="entityId">The entity identifier.</param>
 public virtual async Task DeleteAsync(dynamic entityId)
 {
     TEntity entity = repository.FindById(entityId);
     await repository.DeleteAsync(entity).ConfigureAwait(false);
 }