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", }, }; }
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(); }
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(); }