public ParticipantScoresDataService( IEfGenericRepository <ParticipantScore> participantScores, IParticipantsDataService participantsData) { this.participantScores = participantScores; this.participantsData = participantsData; }
public UsersForTest(IEfGenericRepository <Movies> movies, IEfGenericRepository <Genres> genresRepo, IEfGenericRepository <Comments> commentsRepo, IEfGenericRepository <Users> userRepo, IEfGenericRepository <Likes> likesRepo, IEfGenericRepository <Dislikes> dislikesRepo, IUoW saver) : base(movies, genresRepo, commentsRepo, userRepo, likesRepo, dislikesRepo, saver) { this.SaveChangesCalled = 0; }
public InventoryService(IEfUnitOfWork unitOfWork, IMappingProvider mapper, IEfGenericRepository <Inventory> inventories) { Guard.WhenArgument(unitOfWork, "unitOfWork").IsNull().Throw(); Guard.WhenArgument(mapper, "mapper").IsNull().Throw(); Guard.WhenArgument(inventories, "inventories").IsNull().Throw(); this.inventories = inventories; }
public AllFeedbacksController(IFeedbacksService feedbacks, IEfGenericRepository <ApplicationUser> repoUser) : base(repoUser) { Guard.WhenArgument(feedbacks, "feedbacks").IsNull().Throw(); this.feedbacks = feedbacks; }
public QuestionService(IEfGenericRepository <Question> questionRepo, IMappingProvider mapper, ISaver saver, IRandomProvider random, IAnswerService answerService) : base(mapper, saver, random) { Guard.WhenArgument(questionRepo, "questionRepo").IsNull().Throw(); Guard.WhenArgument(answerService, "answerService").IsNull().Throw(); this.questionRepo = questionRepo; this.answerService = answerService; }
public UserService(IEfGenericRepository <User> userRepository, IUnitOfWork unitOfWork) { Guard.WhenArgument(userRepository, "userRepository").IsNull().Throw(); Guard.WhenArgument(unitOfWork, "unitOfWork").IsNull().Throw(); this.userRepository = userRepository; this.unitOfWork = unitOfWork; }
public ArticleService(IEfGenericRepository <Article> articleRepository, IUnitOfWork unitOfWork) { Guard.WhenArgument(articleRepository, "articleRepository").IsNull().Throw(); Guard.WhenArgument(unitOfWork, "unitOfWork").IsNull().Throw(); this.articleRepository = articleRepository; this.unitOfWork = unitOfWork; }
public PlaceService(IEfGenericRepository <Place> placeRepository, IUnitOfWork unitOfWork) { Guard.WhenArgument(placeRepository, "placeRepository").IsNull().Throw(); Guard.WhenArgument(unitOfWork, "unitOfWork").IsNull().Throw(); this.placeRepository = placeRepository; this.unitOfWork = unitOfWork; }
public void ThrowArgumentNullException_WhenPassedRepositoryIsNull() { // Arrange IEfGenericRepository <User> mockedRepository = null; // Act & Assert Assert.Throws <ArgumentException>(() => new UsersService(mockedRepository)); }
public VoteServiceTest(IEfGenericRepository <Movies> movies, IEfGenericRepository <Genres> genresRepo, IEfGenericRepository <Comments> commentsRepo, IEfGenericRepository <Users> userRepo, IEfGenericRepository <Likes> likesRepo, IEfGenericRepository <Dislikes> dislikesRepo, IUoW saver) : base(movies, genresRepo, commentsRepo, userRepo, likesRepo, dislikesRepo, saver) { this.GetCurrentUserCalled = 0; this.SaveChangesCalled = 0; this.GetMovieCount = 0; }
public CarsService(IEfGenericRepository <Car> carRepo) { if (carRepo == null) { throw new ArgumentException("The car repo should not be null!"); } this.carRepo = carRepo; }
public UsersService(IEfGenericRepository <User> userRepo) { if (userRepo == null) { throw new ArgumentException("The user repo shold not be null!"); } this.userRepo = userRepo; }
public ProductService(IEfUnitOfWork unitOfWork, IEfGenericRepository <Product> products, IMappingProvider mapper) { Guard.WhenArgument(unitOfWork, "unitofwork").IsNull().Throw(); Guard.WhenArgument(products, "GenRepo").IsNull().Throw(); Guard.WhenArgument(mapper, "mapper").IsNull().Throw(); this.unitOfWork = unitOfWork; this.products = products; this.mapper = mapper; }
public OrderService(IEfUnitOfWork unitOfWork, IMappingProvider mapper, IEfGenericRepository <Order> orders) { Guard.WhenArgument(unitOfWork, "unitOfWork").IsNull().Throw(); Guard.WhenArgument(mapper, "mapper").IsNull().Throw(); Guard.WhenArgument(orders, "orders").IsNull().Throw(); this.unitOfWork = unitOfWork; this.mapper = mapper; this.orders = orders; }
public CountryService( IEfGenericRepository <Country> countryRepository, IUnitOfWork unitOfWork) { Guard.WhenArgument(countryRepository, "countryRepository").IsNull().Throw(); Guard.WhenArgument(unitOfWork, "unitOfWork").IsNull().Throw(); this.countryRepository = countryRepository; this.unitOfWork = unitOfWork; }
public TestService(IEfGenericRepository <Test> testRepo, IEfGenericRepository <Category> categoryRepo, IMappingProvider mapper, ISaver saver, IRandomProvider random, IQuestionService questionService) : base(mapper, saver, random) { Guard.WhenArgument(testRepo, "testRepo").IsNull().Throw(); Guard.WhenArgument(categoryRepo, "categoryRepo").IsNull().Throw(); Guard.WhenArgument(questionService, "questionService").IsNull().Throw(); this.testRepo = testRepo; this.categoryRepo = categoryRepo; this.questionService = questionService; }
public AddressService(IEfUnitOfWork unitOfWork, IMappingProvider mapper, IUserService userService, IEfGenericRepository <Address> addresses) { Guard.WhenArgument(unitOfWork, "unitOfWork").IsNull().Throw(); Guard.WhenArgument(mapper, "mapper").IsNull().Throw(); Guard.WhenArgument(userService, "userService").IsNull().Throw(); Guard.WhenArgument(addresses, "addresses").IsNull().Throw(); this.unitOfWork = unitOfWork; this.mapper = mapper; this.userService = userService; this.addresses = addresses; }
public void ThrowArgumentNullExceptionWithExpectedMessage_WhenPassedRepositoryIsNull() { // Arrange IEfGenericRepository <User> mockedRepository = null; // Act var expectedMessage = Assert.Throws <ArgumentException>(() => new UsersService(mockedRepository)); // Assert Assert.IsTrue(expectedMessage.Message.Contains("null")); }
public BankCardService(IEfUnitOfWork unitOfWork, IMappingProvider mapper, IUserService userService, IEfGenericRepository <BankCard> bankCards) { Guard.WhenArgument(unitOfWork, "unitOfWork").IsNull().Throw(); Guard.WhenArgument(mapper, "mapper").IsNull().Throw(); Guard.WhenArgument(userService, "userService").IsNull().Throw(); Guard.WhenArgument(bankCards, "bankCards").IsNull().Throw(); this.unitOfWork = unitOfWork; this.mapper = mapper; this.userService = userService; this.bankCards = bankCards; }
public UserService(IMappingProvider mapper, IHashingPassword hashing, IEfUnitOfWork unitOfWork, IEfGenericRepository <User> users) { Guard.WhenArgument(mapper, "mapper").IsNull().Throw(); Guard.WhenArgument(hashing, "hashing").IsNull().Throw(); Guard.WhenArgument(unitOfWork, "unitOfWork").IsNull().Throw(); Guard.WhenArgument(users, "userRepo").IsNull().Throw(); this.hashing = hashing; this.unitOfWork = unitOfWork; this.mapper = mapper; this.users = users; }
public DataBaseService(IEfGenericRepository <Movies> movies, IEfGenericRepository <Genres> genresRepo, IEfGenericRepository <Comments> commentsRepo, IEfGenericRepository <Users> userRepo, IEfGenericRepository <Likes> likesRepo, IEfGenericRepository <Dislikes> dislikesRepo, IUoW saver) { this.moviesRepo = movies; this.genresRepo = genresRepo; this.commentsRepo = commentsRepo; this.userRepo = userRepo; this.likesRepo = likesRepo; this.dislikesRepo = dislikesRepo; this.saver = saver; }
public EfFancyData(IFancyDbContext context, IEfGenericRepository <Item> items, IEfGenericRepository <Order> orders, IEfGenericRepository <User> users) { Validator.ValidateNullArgument(context, "context"); Validator.ValidateNullArgument(items, "items"); Validator.ValidateNullArgument(orders, "orders"); Validator.ValidateNullArgument(users, "users"); this.context = context; this.items = items; this.orders = orders; this.users = users; }
public CustomerService(IEfGenericRepository <Customer> customerRepository, IEfGenericRepository <Order> orderRepository) { if (customerRepository == null) { throw new ArgumentException("The customer repository should not be null!"); } if (orderRepository == null) { throw new ArgumentException("The order repository should not be null!"); } this.customerRepository = customerRepository; this.orderRepository = orderRepository; }
public void TestInit() { kernel = DependencyInjectionConfig.CreateKernel(); context = kernel.Get <IMoviesContext>(); movies = new EfGenericRepository <Movies>(context); genresRepo = new EfGenericRepository <Genres>(context); commentsRepo = new EfGenericRepository <Comments>(context); userRepo = new EfGenericRepository <Users>(context); likesRepo = new EfGenericRepository <Likes>(context); dislikesRepo = new EfGenericRepository <Dislikes>(context); saver = new UoW(context); context.Genres.Add(genre); context.SaveChanges(); }
public UserService(IIdentity identity, IEfGenericRepository <ApplicationUser> usersRepo) { this.currentIdentity = identity; this.usersRepo = usersRepo; }
public TopicsService(IEfGenericRepository <Topic> topics) { Guard.WhenArgument(topics, "topics").IsNull().Throw(); this.topics = topics; }
public SubmissionTypesDataService(IEfGenericRepository <SubmissionType> submissionTypes) => this.submissionTypes = submissionTypes;
public ExamGroupsDataService(IEfGenericRepository <ExamGroup> examGroups) => this.examGroups = examGroups;
public SupplementsController(ISupplementsService supplements, IDropDownListPopulator populator, IEfGenericRepository <ApplicationUser> repoUser) : base(repoUser) { Guard.WhenArgument(supplements, "supplements").IsNull().Throw(); Guard.WhenArgument(populator, "populator").IsNull().Throw(); this.supplements = supplements; this.populator = populator; }
public AllCommentsController(ITopicsService topics, ICommentsService comments, IEfGenericRepository <ApplicationUser> repoUser) : base(repoUser) { Guard.WhenArgument(topics, "topics").IsNull().Throw(); Guard.WhenArgument(comments, "comments").IsNull().Throw(); this.topics = topics; this.comments = comments; }