Ejemplo n.º 1
0
 public VotesController(
     IVotesService votesService,
     IIssuesService issuesService)
 {
     this.votesService  = votesService;
     this.issuesService = issuesService;
 }
Ejemplo n.º 2
0
 public VotesController(
     UserManager <ApplicationUser> userManager,
     IVotesService voteServices)
 {
     this.userManager  = userManager;
     this.voteServices = voteServices;
 }
Ejemplo n.º 3
0
 public VotesController(
     IVotesService votesService,
     UserManager <ApplicationUser> userManager)
 {
     this.votesService = votesService;
     this.userManager  = userManager;
 }
Ejemplo n.º 4
0
 public VotesController(
     IVotesService votesService,
     IUsersService usersService)
 {
     this.votesService = votesService;
     this.usersService = usersService;
 }
Ejemplo n.º 5
0
 public HomeController(IUsersService usersService, IPostsService postsService, IVotesService votesService, IVotesForCommentsService votesForCommentsService)
 {
     this.usersService            = usersService;
     this.postsService            = postsService;
     this.votesService            = votesService;
     this.votesForCommentsService = votesForCommentsService;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 8
0
 public HomeController(IUserAccService userAccService,
                       IUserInfo userInfoService,
                       IVotesService votesService)
 {
     this.userAccService  = userAccService;
     this.userInfoService = userInfoService;
     this.votesService    = votesService;
 }
Ejemplo n.º 9
0
 public VotesController(
     UserManager <ApplicationUser> userManager,
     IVotesService votesService,
     IImagesService imagesService)
 {
     this.UserManager   = userManager;
     this.VotesService  = votesService;
     this.ImagesService = imagesService;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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();
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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.");
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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));
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 25
0
 public VotesController(IVotesService votes)
 {
     _votes = votes;
 }
Ejemplo n.º 26
0
 public VotesController(IVotesService votesService)
 {
     this.votesService = votesService;
 }
 public CandidatesController(IVotesService votesService, ICandidatesService candidatesService)
 {
     _votesService      = votesService;
     _candidatesService = candidatesService;
 }
Ejemplo n.º 28
0
 public VotesController(IVotesService votes, IIdeasService ideas)
 {
     this.votes = votes;
     this.ideas = ideas;
 }
Ejemplo n.º 29
0
 public VotesController(IVotesService votesService, IRepository <Vote> votesRepository)
 {
     this.votesService    = votesService;
     this.votesRepository = votesRepository;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 32
0
 public VotesController(IVotesService service, UserManager <ApplicationUser> manager)
 {
     this.service = service;
     this.manager = manager;
 }
Ejemplo n.º 33
0
 public VoteController(IVotesService _voteService)
 {
     this._voteService = _voteService;
 }
Ejemplo n.º 34
0
 public VotesController(IVotesService votesService, IForumVotesService forumVotesService)
 {
     this.votesService      = votesService;
     this.forumVotesService = forumVotesService;
 }