Beispiel #1
0
        public async Task ShouldDeleteProjectAndTickets()
        {
            var context = await ContextTestHelper.CreateTestDatabase(_workspace);

            var project = new Project("Project X", context);
            await context.AddNewProject(project);

            var feature = new Feature(context);

            feature.Sprint = project.Backlog;

            var tickets = new List <Ticket>()
            {
                ContextTestHelper.CreateTestTicket("Ticket 1", feature),
                ContextTestHelper.CreateTestTicket("Ticket 2", feature),
                ContextTestHelper.CreateTestTicket("Ticket 3", feature),
            };

            await context.SaveChangesAsync();

            await context.DeleteProject(project);

            var exists = context.Tickets.Any();

            Assert.IsFalse(exists);
        }
Beispiel #2
0
        private async Task SetupContext()
        {
            _context = await ContextTestHelper.CreateTestDatabase(_workspace);

            var project = new Project("Project X", _context);
            await _context.AddNewProject(project);

            var feature = new Feature("Feature 1", project.Backlog);

            _context.Features.Insert(feature);

            _ticket = ContextTestHelper.CreateTestTicket("Ticket A", feature);
            await _context.AddNewTicket(_ticket);
        }