Beispiel #1
0
        public async Task GetBuIdAsync_ShouldReturnNoAction()
        {
            using (var db = new ATMContext(TestOptions.TestDbContextOptions <ATMContext>()))
            {
                // Arrange
                await db.AddRangeAsync(ACTION_RESULTS);

                await db.SaveChangesAsync();

                UserActionResult expectedDbAction = null;
                int actionId = db.ActionResults.OrderBy(x => x.Id).Last().Id + 1;
                IRepository <UserActionResult> repository = new DBUserActionResultRepository(db);

                // Act
                var result = await repository.GetByIdAsync(actionId);

                // Assert
                Assert.Equal(expectedDbAction, result);
            }
        }
Beispiel #2
0
        public async Task GetBuIdAsync_ShouldReturnAAction()
        {
            using (var db = new ATMContext(TestOptions.TestDbContextOptions <ATMContext>()))
            {
                // Arrange
                var expectedAction = ACTION_RESULTS.First();
                await db.AddRangeAsync(ACTION_RESULTS);

                await db.SaveChangesAsync();

                var expectedDbAction = ACTION_RESULTS.First();
                int actionId         = expectedDbAction.Id;
                IRepository <UserActionResult> repository = new DBUserActionResultRepository(db);

                // Act
                var result = await repository.GetByIdAsync(actionId);

                // Assert
                Assert.Equal(expectedDbAction, result);
            }
        }