public VideosService(ChessDbContext db, IPicturesService picturesService, IMapper mapper, IUsersService usersService)
 {
     this.db = db;
     this.picturesService = picturesService;
     this.mapper          = mapper;
     this.usersService    = usersService;
 }
        public async Task GetPictureByLinkAsync_WithValidDAta_ShouldReturnCorrectPicture()
        {
            //Arrange
            var expectedPictureId   = 1;
            var expectedPictureName = "PictureName";
            var expectedPictureLink = "PictureLink";

            var option = new DbContextOptionsBuilder <ChessDbContext>()
                         .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString()).Options;
            var db = new ChessDbContext(option);

            this.picturesService = new PicturesService(db);

            var testingPicture = new Picture
            {
                Id   = 1,
                Name = "PictureName",
                Link = "PictureLink"
            };

            await db.Pictures.AddAsync(testingPicture);

            await db.SaveChangesAsync();

            //Act
            var actual = await this.picturesService.GetPictureByLinkAsync("PictureLink");

            //Assert
            Assert.Equal(expectedPictureId, actual.Id);
            Assert.Equal(expectedPictureName, actual.Name);
            Assert.Equal(expectedPictureLink, actual.Link);
        }
示例#3
0
 public ItemHelper(IHostingEnvironment hostingEnvironment, IPicturesService picturesService, IDocumentsService documentsService,
                   IConfiguration configuration)
 {
     this._hostingEnvironment = hostingEnvironment;
     this._picturesService    = picturesService;
     this._documentsService   = documentsService;
     this._configuration      = configuration;
 }
示例#4
0
 public HomeController(IVideosService videosService,
                       IPicturesService picturesService,
                       IPagesService pagesService,
                       IPostsService postsService)
 {
     this.videosService   = videosService;
     this.picturesService = picturesService;
     this.pagesService    = pagesService;
     this.postsService    = postsService;
 }
示例#5
0
        public PicturesController(
            IPicturesService picturesService,
            IPicturesCategoriesService picturesCategoriesService,
            IWebHostEnvironment environment)
        {
            this.picturesCategoriesService = picturesCategoriesService;
            this.picturesService           = picturesService;

            this.environment = environment;
        }
示例#6
0
 public AdministrationAreaController(IPagesService pageService,
                                     IUsersService usersService,
                                     ILogService logsService,
                                     IVideosService videosService,
                                     IPicturesService picturesService,
                                     IPostsService postsService,
                                     UserManager <User> userManger)
     : base(pageService, usersService, logsService, videosService, picturesService, postsService, userManger)
 {
 }
 public ItemController(IRoleManagerService roleManagerService, IUserManagerService userManagerService,
                       IItemsService itemsService, IHostingEnvironment hostingEnvironment, IPicturesService picturesService,
                       IDocumentsService documentsService, IItemHelper itemHelper)
 {
     this._roleManagerService = roleManagerService;
     this._userManagerService = userManagerService;
     this._itemsService       = itemsService;
     this._picturesService    = picturesService;
     this._documentsService   = documentsService;
     this._hostingEnvironment = hostingEnvironment;
     this._itemHelper         = itemHelper;
 }
示例#8
0
        public ModeratorController(IPagesService pageService,
                                   IUsersService usersService,
                                   ILogService logsService,
                                   IVideosService videosService,
                                   IPicturesService picturesService,
                                   IPostsService postsService,
                                   UserManager <User> userManager)
        {
            this.pageService     = pageService;
            this.usersService    = usersService;
            this.logsService     = logsService;
            this.videosService   = videosService;
            this.picturesService = picturesService;
            this.postsService    = postsService;

            this.userManager = userManager;
        }
示例#9
0
 public IssuesService(
     IDeletableEntityRepository <Issue> issuesRepo,
     IRepository <IssueAttachment> issueAttRepo,
     IDeletableEntityRepository <Attachment> attRepo,
     IDeletableEntityRepository <Citizen> citizenRepo,
     ICitizensService citizensService,
     IPicturesService picturesService,
     IAddressesService addressesService,
     IIssueTagsService issueTagsService)
 {
     this.issuesRepo       = issuesRepo;
     this.issueAttRepo     = issueAttRepo;
     this.attRepo          = attRepo;
     this.citizenRepo      = citizenRepo;
     this.citizensService  = citizensService;
     this.picturesService  = picturesService;
     this.addressesService = addressesService;
     this.issueTagsService = issueTagsService;
 }
        public async Task CreatePictureAsync_WithValidDAta_ShouldCreateCorrectPicture()
        {
            //Arrange
            var expectedPictureName = "PictureName";
            var expectedPictureLink = "PictureLink";

            var option = new DbContextOptionsBuilder <ChessDbContext>()
                         .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString()).Options;
            var db = new ChessDbContext(option);

            this.picturesService = new PicturesService(db);

            //Act
            await this.picturesService.CreatePictureAsync("PictureName", "PictureLink");

            var picture = await db.Pictures.FirstOrDefaultAsync(x => x.Link == expectedPictureLink);

            //Assert
            Assert.Equal(expectedPictureName, picture.Name);
            Assert.Equal(expectedPictureLink, picture.Link);
        }
示例#11
0
 public IndexModel(
     UserManager <ApplicationUser> userManager,
     SignInManager <ApplicationUser> signInManager,
     IWebHostEnvironment environment,
     ICitizensService citizensService,
     IInstitutionsService institutionsService,
     IPicturesService picService,
     IDeletableEntityRepository <Picture> picRepo,
     IDeletableEntityRepository <Citizen> citizenRepo,
     IDeletableEntityRepository <Institution> institutionRepo)
 {
     this._userManager        = userManager;
     this._signInManager      = signInManager;
     this.environment         = environment;
     this.citizensService     = citizensService;
     this.institutionsService = institutionsService;
     this.picService          = picService;
     this.picRepo             = picRepo;
     this.citizenRepo         = citizenRepo;
     this.institutionRepo     = institutionRepo;
 }
示例#12
0
 public PicturesController(IPicturesService picturesService,
                           IPicturesCategoriesService picturesCategoriesService)
 {
     this.picturesCategoriesService = picturesCategoriesService;
     this.picturesService           = picturesService;
 }
 public PictureController(IPicturesService service, IMapper mapper, ILogger <PictureController> logger)
 {
     _service = service;
     _mapper  = mapper;
     _logger  = logger;
 }
示例#14
0
 public PicturesController(IPicturesService picturesService)
 {
     this._picturesService = picturesService;
 }
示例#15
0
 public UsersController(IPicturesService picturesService)
 {
     this.picturesService = picturesService;
 }
示例#16
0
 public PicturesController(IPicturesService service)
 {
     _service = service;
 }
示例#17
0
 public PicturesController(IMapper mapper, IPicturesService servicePictures)
 {
     _servicePictures = servicePictures;
     _mapper          = mapper;
 }
 public AdsManagementController(IAdsService service, IPicturesService pictureService)
 {
     _service         = service;
     _picturesService = pictureService;
 }