Beispiel #1
0
        public async Task GetAsyncSucceeds()
        {
            // Arrange
            var options = GetTestDbContextOptions("Get_ScrapeJob_Database");

            var testEntity = GenerateTestEntity();

            using (var context = new WaasDbContext(options))
            {
                await context.AddAsync(testEntity);

                await context.SaveChangesAsync();
            }

            // Act
            using (var context = new WaasDbContext(options))
            {
                var testRepository = new BaseDomainService <ScrapeJob, long>(context);
                var result         = await testRepository.GetAsync(testEntity.Id);

                // Assert
                Assert.Equal(testEntity, result);
            }
        }
        public virtual async Task <IActionResult> Get(long id)
        {
            var data = await Service.GetAsync(id);

            return(Successful(data));
        }