public CategoriesServiceTests()
        {
            var options = new DbContextOptionsBuilder <ApplicationDbContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString()).Options;
            var db = new ApplicationDbContext(options);

            this.repo    = new EfDeletableEntityRepository <Category>(db);
            this.service = new CategoryService(this.repo);

            _ = new MapperInitializationProfile();

            this.data = new Category[]
            {
                new()
                {
                    Name        = "Street Fitness",
                    Title       = "Street Fitness",
                    Description = "Street Fitness",
                    ImageUrl    = "workout.jpg",
                },
                new()
                {
                    Name        = "Calisthenics",
                    Title       = "Calisthenics",
                    Description = "Calisthenics",
                    ImageUrl    = "workout.jpg",
                },
            };
        }
Esempio n. 2
0
        public UserSavedPostsServiceTests()
        {
            var options = new DbContextOptionsBuilder <ApplicationDbContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString()).Options;
            var db = new ApplicationDbContext(options);

            this.repo    = new EfDeletableEntityRepository <UserSavedPost>(db);
            this.service = new UserSavedPostsService(this.repo);

            _ = new MapperInitializationProfile();
        }
Esempio n. 3
0
        public FollowsServiceTests()
        {
            var options = new DbContextOptionsBuilder <ApplicationDbContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString()).Options;
            var db = new ApplicationDbContext(options);

            this.repo = new EfRepository <UserFollow>(db);
            var userRepo = new EfRepository <ApplicationUser>(db);

            this.service = new FollowService(this.repo, userRepo);

            _ = new MapperInitializationProfile();
        }
        public ProfilesServiceTests()
        {
            var options = new DbContextOptionsBuilder <ApplicationDbContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString()).Options;
            var db = new ApplicationDbContext(options);

            this.userRepo = new EfDeletableEntityRepository <ApplicationUser>(db);

            var userFollow = new EfRepository <UserFollow>(db);
            var followRepo = new FollowService(userFollow, this.userRepo);

            this.service = new ProfileService(this.userRepo, followRepo);

            var map = new MapperInitializationProfile();
        }
 public PostsServiceTests()
 {
     _ = new MapperInitializationProfile();
 }