예제 #1
0
 public VotesController(
     IVotesService votesService,
     IIssuesService issuesService)
 {
     this.votesService  = votesService;
     this.issuesService = issuesService;
 }
예제 #2
0
 public VotesController(
     UserManager <ApplicationUser> userManager,
     IVotesService voteServices)
 {
     this.userManager  = userManager;
     this.voteServices = voteServices;
 }
예제 #3
0
 public VotesController(
     IVotesService votesService,
     UserManager <ApplicationUser> userManager)
 {
     this.votesService = votesService;
     this.userManager  = userManager;
 }
예제 #4
0
 public VotesController(
     IVotesService votesService,
     IUsersService usersService)
 {
     this.votesService = votesService;
     this.usersService = usersService;
 }
예제 #5
0
 public HomeController(IUsersService usersService, IPostsService postsService, IVotesService votesService, IVotesForCommentsService votesForCommentsService)
 {
     this.usersService            = usersService;
     this.postsService            = postsService;
     this.votesService            = votesService;
     this.votesForCommentsService = votesForCommentsService;
 }
예제 #6
0
 public AccountController(UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, IVotesService votesService, IVotesForCommentsService votesForCommentsService, IUsersService usersService)
 {
     this.userManager             = userManager;
     this.votesService            = votesService;
     this.votesForCommentsService = votesForCommentsService;
     this.usersService            = usersService;
     this.signInManager           = signInManager;
 }
예제 #7
0
 public UsersController(IUsersService usersService, IPostsService postsService, IVotesService votesService, IVotesForCommentsService votesForCommentsService, UserManager <ApplicationUser> userManager)
 {
     this.usersService            = usersService;
     this.postsService            = postsService;
     this.votesService            = votesService;
     this.votesForCommentsService = votesForCommentsService;
     this.userManager             = userManager;
 }
예제 #8
0
 public HomeController(IUserAccService userAccService,
                       IUserInfo userInfoService,
                       IVotesService votesService)
 {
     this.userAccService  = userAccService;
     this.userInfoService = userInfoService;
     this.votesService    = votesService;
 }
예제 #9
0
 public VotesController(
     UserManager <ApplicationUser> userManager,
     IVotesService votesService,
     IImagesService imagesService)
 {
     this.UserManager   = userManager;
     this.VotesService  = votesService;
     this.ImagesService = imagesService;
 }
예제 #10
0
 public VotesController(
     IPostsService postsService,
     IVotesService votesService,
     ICommentsService commentsService)
 {
     this.postsService    = postsService;
     this.votesService    = votesService;
     this.commentsService = commentsService;
 }
 public CategoriesService(
     IDeletableEntityRepository <Category> categoriesRepository,
     IDeletableEntityRepository <Recipe> recipesRepository,
     IVotesService votesService)
 {
     this.categoriesRepository = categoriesRepository;
     this.recipesRepository    = recipesRepository;
     this.votesService         = votesService;
 }
 public SellersController(
     IUsersService usersService,
     IRolesService rolesService,
     IUserRolesService<ApplicationUserRole> userRolesService,
     ICommentsService commentsService,
     IVotesService votesService,
     IProductsService productsService) 
     : base(usersService, rolesService, userRolesService, commentsService, votesService, productsService)
 {
 }
 public ProductsController(
     IProductsService productsService,
     IIdentifierProvider identifierProvider,
     IVotesService votesService,
     IMappingService mappingService)
 {
     this.productsService = productsService;
     this.votesService = votesService;
     this.identifierProvider = identifierProvider;
     this.mappingService = mappingService;
 }
예제 #14
0
 public AbstractVotesController(
     ApiSettings settings,
     ILogger <AbstractVotesController> logger,
     ITransactionCoordinator transactionCoordinator,
     IVotesService votesService,
     IApiVotesModelMapper votesModelMapper
     )
     : base(settings, logger, transactionCoordinator)
 {
     this.VotesService     = votesService;
     this.VotesModelMapper = votesModelMapper;
 }
예제 #15
0
        public VotesServiceTests()
        {
            this.votes = new List <Vote>();

            var surveysRepository = new EfDeletableEntityRepository <Survey>(this.DbContext);

            var votesRepository = new EfRepository <Vote>(this.DbContext);

            this.service = new VotesService(votesRepository);

            this.InitializeRepositoriesData();
        }
예제 #16
0
 public RecipesController(
     ICategoriesService categoriesService,
     IRecipesService recipesService,
     UserManager <ApplicationUser> userManager,
     IVotesService votesService,
     ICommentsService commentsService)
 {
     this.categoriesService = categoriesService;
     this.recipesService    = recipesService;
     this.userManager       = userManager;
     this.votesService      = votesService;
     this.commentsService   = commentsService;
 }
예제 #17
0
        public async Task SetUp()
        {
            var options = new DbContextOptionsBuilder <ApplicationDbContext>()
                          .UseInMemoryDatabase(databaseName: "votesTestDb").Options;

            this.dbContext = new ApplicationDbContext(options);
            await this.dbContext.Database.EnsureDeletedAsync();

            var postVoteRepository = new EfDeletableEntityRepository <UserPostVote>(this.dbContext);
            var postRepository     = new EfDeletableEntityRepository <Post>(this.dbContext);

            this.votesService = new VotesService(postVoteRepository, postRepository);
        }
예제 #18
0
        public async Task GetVotes_WithDummyData_ShouldReturnCorrectResult()
        {
            var errorMessagePrefix = "VotesService GetVotesAsync() method does not work properly.";

            var dbContext = ApplicationDbContextInMemoryFactory.InitializeContext();

            await this.SeedData(dbContext);

            this.votesService = new VotesService(dbContext);

            var expectedResult = dbContext.Votes.First().ServiceId;
            var actualResult   = await this.votesService.GetVotesAsync <VotesServiceModel>(expectedResult);

            Assert.True(expectedResult == actualResult.Id, errorMessagePrefix + " " + "Id is not return properly.");
        }
예제 #19
0
 public RecipesService(
     Cloudinary cloudinary,
     IDeletableEntityRepository <Image> imagesRepository,
     IDeletableEntityRepository <Recipe> recipesRepository,
     IRepository <UserRecipe> userRecipes,
     IDeletableEntityRepository <Vote> votesRepository,
     IVotesService votesService)
 {
     this.cloudinary            = cloudinary;
     this.imagesRepository      = imagesRepository;
     this.recipesRepository     = recipesRepository;
     this.userRecipesRepository = userRecipes;
     this.votesRepository       = votesRepository;
     this.votesService          = votesService;
 }
 public AnimalService(
     IRepository <AnimalImage> animalImagesRepository,
     IDeletableEntityRepository <Animal> animalsRepository,
     UserManager <ApplicationUser> userManager,
     Cloudinary cloudinary,
     ICloudinaryService cloudinaryService,
     IVotesService votesService)
 {
     this.animalImagesRepository = animalImagesRepository;
     this.animalsRepository      = animalsRepository;
     this.userManager            = userManager;
     this.cloudinary             = cloudinary;
     this.cloudinaryService      = cloudinaryService;
     this.votesService           = votesService;
 }
예제 #21
0
 public SuggestionsController(
     ISuggestionsService suggestionsService,
     UserManager <ApplicationUser> userManager,
     ICloudinaryHelper cloudinaryHelper,
     Cloudinary cloudinary,
     IVotesService votesService,
     IGamesService gamesService)
 {
     this.suggestionsService = suggestionsService;
     this.userManager        = userManager;
     this.cloudinaryHelper   = cloudinaryHelper;
     this.cloudinary         = cloudinary;
     this.votesService       = votesService;
     this.gamesService       = gamesService;
 }
예제 #22
0
        public async Task Create_WithNoVotes_ShouldThrowArgumentNullException()
        {
            var dbContext = ApplicationDbContextInMemoryFactory.InitializeContext();

            this.votesService = new VotesService(dbContext);

            var testVotesService = new VotesServiceModel
            {
                Type      = VoteType.UpVote,
                ServiceId = 1,
                UserId    = Guid.NewGuid().ToString(),
            };

            await Assert.ThrowsAsync <ArgumentNullException>(async() =>
                                                             await this.votesService.CreateVoteAsync(testVotesService));
        }
예제 #23
0
 public VotesController(
     ApiSettings settings,
     ILogger <VotesController> logger,
     ITransactionCoordinator transactionCoordinator,
     IVotesService votesService,
     IApiVotesModelMapper votesModelMapper
     )
     : base(settings,
            logger,
            transactionCoordinator,
            votesService,
            votesModelMapper)
 {
     this.BulkInsertLimit = 250;
     this.MaxLimit        = 1000;
     this.DefaultLimit    = 250;
 }
예제 #24
0
        public async Task Create_WithDummyData_ShouldReturnCorrectResult()
        {
            var dbContext = ApplicationDbContextInMemoryFactory.InitializeContext();

            await this.SeedData(dbContext);

            this.votesService = new VotesService(dbContext);

            var testVotesService = new VotesServiceModel
            {
                Type      = VoteType.UpVote,
                ServiceId = 1,
                UserId    = Guid.NewGuid().ToString(),
            };

            var expectedResult = 3;
            var actualResult   = await this.votesService.CreateVoteAsync(testVotesService);

            Assert.Equal(expectedResult, actualResult);
        }
예제 #25
0
 public VotesController(IVotesService votes)
 {
     _votes = votes;
 }
예제 #26
0
 public VotesController(IVotesService votesService)
 {
     this.votesService = votesService;
 }
 public CandidatesController(IVotesService votesService, ICandidatesService candidatesService)
 {
     _votesService      = votesService;
     _candidatesService = candidatesService;
 }
예제 #28
0
 public VotesController(IVotesService votes, IIdeasService ideas)
 {
     this.votes = votes;
     this.ideas = ideas;
 }
예제 #29
0
 public VotesController(IVotesService votesService, IRepository <Vote> votesRepository)
 {
     this.votesService    = votesService;
     this.votesRepository = votesRepository;
 }
예제 #30
0
 public VotesController(IArticlesService articles, IIdentifierProvider identifierProvider, IVotesService votes)
 {
     this.articles = articles;
     this.identifierProvider = identifierProvider;
     this.votes = votes;
 }
 public VotesController(IVotesService votes)
 {
     this.votes = votes;
 }
예제 #32
0
 public VotesController(IVotesService service, UserManager <ApplicationUser> manager)
 {
     this.service = service;
     this.manager = manager;
 }
예제 #33
0
 public VoteController(IVotesService _voteService)
 {
     this._voteService = _voteService;
 }
예제 #34
0
 public VotesController(IVotesService votesService, IForumVotesService forumVotesService)
 {
     this.votesService      = votesService;
     this.forumVotesService = forumVotesService;
 }