Ejemplo n.º 1
0
        public async Task GetByIdIncludingUserAsync()
        {
            var user = await userDapper.AddAsync(userBuilder.CreateUser());

            var task = await taskToDoDapper.AddAsync(taskToDoBuilder.CreateTaskToDoWithUser(user.Id));

            var result = await taskToDoDapper.GetByIdIncludingUserAsync(task.Id);

            Assert.AreEqual(result.UserId, user.Id);
        }
Ejemplo n.º 2
0
        public async Task GetByIdIncludingUserAsync()
        {
            using (var scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
            {
                var conn = databaseOptions.GetDbConnection;
                userDapper     = new UserRepository(conn);
                taskToDoDapper = new TaskToDoRepository(conn);

                var user = await userDapper.AddAsync(userBuilder.CreateUser());

                var task = await taskToDoDapper.AddAsync(taskToDoBuilder.CreateTaskToDoWithUser(user.Id));

                var result = await taskToDoDapper.GetByIdIncludingUserAsync(task.Id);

                Assert.AreEqual(result.UserId, user.Id);
            }
        }