public void TestGetTicketsByUsername()
        {
            // db is empty
            using (var context = new ProTickDatabaseContext(dbOptions))
            {
                var dbm       = new DatabaseQueryManager(context);
                var converter = new ResourceDTOConverter(dbm);


                var expectedUsername = "******";
                var expectedRole     = "Admin";

                var controller = new TicketController(context, converter, dbm);
                var user       = new ClaimsPrincipal(new ClaimsIdentity(
                                                         new List <Claim>()
                {
                    new Claim(ClaimTypes.NameIdentifier, expectedUsername),
                    new Claim(ClaimTypes.Role, expectedRole)
                }));
                controller.ControllerContext = new ControllerContext()
                {
                    HttpContext = new DefaultHttpContext()
                    {
                        User = user
                    }
                };


                Assert.Throws <DatabaseEntryNotFoundException>(() => controller.GetTicketsByUsername(expectedUsername));
            }

            // seeding DB
            using (var context = new ProTickDatabaseContext(dbOptions))
            {
                DbContextSeeder.SeedFull(context);
            }

            // db is Test-Ready
            using (var context = new ProTickDatabaseContext(dbOptions))
            {
                var dbm       = new DatabaseQueryManager(context);
                var converter = new ResourceDTOConverter(dbm);

                var expectedUsername = "******";
                var expectedRole     = "Admin";

                var controller = new TicketController(context, converter, dbm);
                var user       = new ClaimsPrincipal(new ClaimsIdentity(
                                                         new List <Claim>()
                {
                    new Claim(ClaimTypes.NameIdentifier, expectedUsername),
                    new Claim(ClaimTypes.Role, expectedRole)
                }));
                controller.ControllerContext = new ControllerContext()
                {
                    HttpContext = new DefaultHttpContext()
                    {
                        User = user
                    }
                };

                // admin
                var actualAdmin = controller.GetTicketsByUsername(expectedUsername).ToList();

                var expectedAdmin = DbContextSeeder.GetSeededTicketDTOs(
                    3,
                    DbContextSeeder.GetSeededStateDTOs(3),
                    DbContextSeeder.GetSeededSubprocessDTOs(
                        3,
                        DbContextSeeder.GetSeededProcessDTOs(3),
                        DbContextSeeder.GetSeededTeamDTOs(3))
                    )
                                    .Where(x => x.TicketID == 2)
                                    .ToList();

                Assert.Equal(expectedAdmin.Count, actualAdmin.Count);

                expectedAdmin.Should().BeEquivalentTo(actualAdmin);

                // employee
                expectedUsername = "******";
                expectedRole     = "Employee";
                var user2 = new ClaimsPrincipal(new ClaimsIdentity(
                                                    new List <Claim>()
                {
                    new Claim(ClaimTypes.NameIdentifier, expectedUsername),
                    new Claim(ClaimTypes.Role, expectedRole)
                }));
                controller.ControllerContext = new ControllerContext()
                {
                    HttpContext = new DefaultHttpContext()
                    {
                        User = user2
                    }
                };

                var actualEmployee   = controller.GetTicketsByUsername(expectedUsername).ToList();
                var expectedEmployee = DbContextSeeder.GetSeededTicketDTOs(
                    1,
                    DbContextSeeder.GetSeededStateDTOs(1),
                    DbContextSeeder.GetSeededSubprocessDTOs(
                        1,
                        DbContextSeeder.GetSeededProcessDTOs(1),
                        DbContextSeeder.GetSeededTeamDTOs(1))
                    )
                                       .ToList();

                Assert.Equal(actualEmployee.Count, expectedEmployee.Count);

                actualEmployee.Should().BeEquivalentTo(expectedEmployee);
            }
        }