Example #1
0
        public RelationsServiceTests()
        {
            var options = new DbContextOptionsBuilder <OurTraceDbContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString())
                          .Options;

            this.dbContext = new OurTraceDbContext(options);

            this.automapper       = MapperInitializer.CreateMapper();
            this.relationsService = new RelationsService(dbContext, automapper);
        }
Example #2
0
        public PostServiceTests()
        {
            var options = new DbContextOptionsBuilder<OurTraceDbContext>()
               .UseInMemoryDatabase(Guid.NewGuid().ToString())
               .Options;
            this.dbContext = new OurTraceDbContext(options);

            this.automapper = MapperInitializer.CreateMapper();
            var groupService = new GroupService(dbContext, automapper);
            var relationsService = new RelationsService(dbContext, automapper);
            FileService fileService = null; // mocked - not used
            this.postService = new PostService(dbContext, relationsService, groupService, fileService, automapper);
        }
Example #3
0
        public HomeServiceTests()
        {
            var options = new DbContextOptionsBuilder <OurTraceDbContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString())
                          .Options;

            this.dbContext = new OurTraceDbContext(options);

            this.automapper = MapperInitializer.CreateMapper();
            var advertService    = new AdvertService(dbContext, automapper);
            var relationsService = new RelationsService(dbContext, automapper);
            var groupService     = new GroupService(dbContext, automapper);

            this.homeService = new HomeService(dbContext, automapper, advertService, relationsService, groupService);
        }