Beispiel #1
0
        public void GetProjectsOfUser_ReturnsEmptyResIfUserHasntProjects()
        {
            var context = GetContext();

            try
            {
                ProjectUserRepository repo = new ProjectUserRepository(context);

                var res = repo.GetProjectsOfUser("no-user").Result;

                Assert.Empty(res);
            }
            finally
            {
                context.Database.EnsureDeleted();
                context.Dispose();
            }
        }
Beispiel #2
0
        public void GetProjectsOfUser_ReturnsListOfProjects()
        {
            var context = GetContext();

            try
            {
                ProjectUserRepository repo = new ProjectUserRepository(context);

                var res = repo.GetProjectsOfUser("2138b181-4cee-4b85-9f16-18df308f387d").Result;

                Assert.Equal(2, res.Count());
                Assert.True(res.Any(p => p.Id == 1) && res.Any(p => p.Id == 2));
            }
            finally
            {
                context.Database.EnsureDeleted();
                context.Dispose();
            }
        }