public async Task GetAllUsers_ShouldReturnCorrectResultWithFilterAndOrder()
        {
            // Arrange
            MovieCatalogDbContext context      = this.GetDbContext();
            IAdminService         adminService = new AdminService(context);

            User user1 = new User()
            {
                Id = "1", Email = "*****@*****.**", UserName = "******"
            };
            User user2 = new User()
            {
                Id = "2", Email = "*****@*****.**", UserName = "******"
            };
            User user3 = new User()
            {
                Id = "3", Email = "*****@*****.**", UserName = "******"
            };

            context.AddRange(user1, user2, user3);
            await context.SaveChangesAsync();

            // Act
            IEnumerable <UserBaseServiceModel> result = adminService.GetAllUsers(1, "first");

            // Assert
            result
            .Should().Match(r => r.First().Id == "1")
            .And
            .HaveCount(1);
        }
Exemple #2
0
 public MoviesController(MovieCatalogDbContext context, UserManager <IdentityUser> userManager, IMoviesService moviesService, IMapper mapper)
 {
     _context       = context;
     _userManager   = userManager;
     _moviesService = moviesService;
     _mapper        = mapper;
 }
 public GenericRepository(MovieCatalogDbContext context)
 {
     this.context = context;
     this.dbSet   = context.Set <TEntity>();
 }
Exemple #4
0
 public AdminService(MovieCatalogDbContext context)
 {
     this.context = context;
 }
Exemple #5
0
 public MoviesService(MovieCatalogDbContext context)
 {
     _context = context;
 }
 public MovieDbService(MovieCatalogDbContext context)
 {
     this.context = context;
 }