Пример #1
0
        public void Init()
        {
            this.carAdsRepoMock         = new Mock <IEfRepostory <CarAd> >();
            this.carBrandsRepoMock      = new Mock <IEfRepostory <CarBrand> >().Object;
            this.carModelsRepoMock      = new Mock <IEfRepostory <CarModel> >().Object;
            this.carFeatureServicesMock = new Mock <ICarFeatureServices>().Object;
            this.unitOfWorkMocked       = new Mock <IEfUnitOfWork>().Object;

            this.carAds = new List <CarAd>
            {
                new CarAd {
                    Title = "Awesome car!"
                },
                new CarAd {
                    Title = "Wohoo. Can be yours"
                },
                new CarAd {
                    Title = "Be fast!"
                },
            };

            this.expectedCarAd = new CarAd
            {
                Title = "Wohooo"
            };

            carAds.Add(expectedCarAd);

            var carAdsQuarable = this.carAds.AsQueryable();

            this.carAdsRepoMock.Setup(x => x.All).Returns(carAdsQuarable);
        }
 public void Init()
 {
     this.carAdsRepoMock         = new Mock <IEfRepostory <CarAd> >().Object;
     this.carBrandsRepoMock      = new Mock <IEfRepostory <CarBrand> >().Object;
     this.carModelsRepoMock      = new Mock <IEfRepostory <CarModel> >().Object;
     this.carFeatureServicesMock = new Mock <ICarFeatureServices>().Object;
     this.unitOfWorkMocked       = new Mock <IEfUnitOfWork>().Object;
 }
Пример #3
0
        public BookService(IEfRepostory <Book> bookRepository, IEfRepostory <Genre> genresRepository, IEfRepostory <Author> authorRepository)
        {
            Guard.WhenArgument(bookRepository, "Book Repository").IsNull().Throw();
            Guard.WhenArgument(genresRepository, "Genre Repository").IsNull().Throw();
            Guard.WhenArgument(authorRepository, "Author Repository").IsNull().Throw();

            this.bookRepository   = bookRepository;
            this.genresRepository = genresRepository;
            this.authorRepository = authorRepository;
        }
Пример #4
0
        public UserServices(IEfRepostory <User> usersRepo, ICarAdServices carAdServices, IEfUnitOfWork unitOfWork)
        {
            Guard.WhenArgument(usersRepo, "usersRepo").IsNull().Throw();
            Guard.WhenArgument(carAdServices, "carAdServices").IsNull().Throw();
            Guard.WhenArgument(unitOfWork, "unitOfWork").IsNull().Throw();

            this.usersRepo     = usersRepo;
            this.carAdServices = carAdServices;
            this.unitOfWork    = unitOfWork;
        }
Пример #5
0
        public CarAdServices(
            IEfRepostory <CarAd> carAdsRepo,
            IEfRepostory <CarBrand> carBrandsRepo,
            IEfRepostory <CarModel> carModelsRepo,
            ICarFeatureServices carFeatureServices,
            IEfUnitOfWork unitOfWork)
        {
            Guard.WhenArgument(carAdsRepo, "carAdsRepo").IsNull().Throw();
            Guard.WhenArgument(carBrandsRepo, "carBrandsRepo").IsNull().Throw();
            Guard.WhenArgument(carModelsRepo, "carModelsRepo").IsNull().Throw();
            Guard.WhenArgument(carFeatureServices, "carFeatureServices").IsNull().Throw();
            Guard.WhenArgument(unitOfWork, "unitOfWork").IsNull().Throw();

            this.carsAdsRepo        = carAdsRepo;
            this.carBrandsRepo      = carBrandsRepo;
            this.carModelsRepo      = carModelsRepo;
            this.carFeatureServices = carFeatureServices;
            this.unitOfWork         = unitOfWork;
        }
        public void Init()
        {
            this.carAdsRepoMock         = new Mock <IEfRepostory <CarAd> >();
            this.carBrandsRepoMock      = new Mock <IEfRepostory <CarBrand> >().Object;
            this.carModelsRepoMock      = new Mock <IEfRepostory <CarModel> >().Object;
            this.carFeatureServicesMock = new Mock <ICarFeatureServices>();
            this.unitOfWorkMocked       = new Mock <IEfUnitOfWork>();

            this.carAds = new List <CarAd>
            {
                new CarAd {
                    Title = "Awesome car!"
                },
                new CarAd {
                    Title = "Wohoo. Can be yours"
                },
                new CarAd {
                    Title = "Be fast!"
                },
            }.AsQueryable();
        }
Пример #7
0
        public RatingService(IEfRepostory <Rating> ratingRepository)
        {
            Guard.WhenArgument(ratingRepository, "Rating Repository").IsNull().Throw();

            this.ratingRepository = ratingRepository;
        }
Пример #8
0
        public CarModelServices(IEfRepostory <CarModel> carModelsRepo)
        {
            Guard.WhenArgument(carModelsRepo, "carModelsRepo").IsNull().Throw();

            this.carModelsRepo = carModelsRepo;
        }
Пример #9
0
 public void Init()
 {
     this.userRepoMock        = new Mock <IEfRepostory <User> >().Object;
     this.carAdServicesMocked = new Mock <ICarAdServices>().Object;
     this.unitOfWorkMocked    = new Mock <IEfUnitOfWork>().Object;
 }
Пример #10
0
 public PostsService(IEfRepostory <Post> postsRepo, ISaveContext saveContext)
 {
     this.postsRepostory = postsRepo;
     this.saveContext    = saveContext;
 }
Пример #11
0
 public DailyWorkoutService(IEfRepostory <DailyWorkout> dailyWorkoutRepo, IUnitOfWork unitOfWork)
 {
     this.dailyWorkoutRepo = dailyWorkoutRepo ?? throw new ArgumentException("DailyWorkoutRepo Cannot be Null");
     this.unitOfWork       = unitOfWork ?? throw new ArgumentException("UnitOfWork Cannot be Null");
 }
        public CarFeaturesServices(IEfRepostory <CarFeature> carFeaturesRepo)
        {
            Guard.WhenArgument(carFeaturesRepo, "carFeaturesRepo").IsNull().Throw();

            this.carFeaturesRepo = carFeaturesRepo;
        }
Пример #13
0
        public TownServices(IEfRepostory <Town> townsRepo)
        {
            Guard.WhenArgument(townsRepo, "townsRepo").IsNull().Throw();

            this.townsRepo = townsRepo;
        }
Пример #14
0
 public void Init()
 {
     this.townRepoMocked = new Mock <IEfRepostory <Town> >().Object;
 }
Пример #15
0
 public PendingWorkoutService(IEfRepostory <PendingWorkout> pendingWorkoutsRepo, IUnitOfWork unitOfWork)
 {
     this.pendingWorkoutsRepo = pendingWorkoutsRepo ?? throw new ArgumentException("PendingWorkout repo cannot be null");
     this.unitOfWork          = unitOfWork ?? throw new ArgumentException("Unit of work cannot be null");
 }
Пример #16
0
 public WorkoutService(IEfRepostory <Workout> workoutsRepo, IUnitOfWork unitOfWork)
 {
     this.workoutsRepo = workoutsRepo ?? throw new ArgumentException("Workouts repo cannot be null");
     this.unitOfWork   = unitOfWork ?? throw new ArgumentException("Unit fo work cannot be null");
 }
Пример #17
0
 public void Init()
 {
     this.carModelRepo = new Mock <IEfRepostory <CarModel> >().Object;
 }
Пример #18
0
 public void Init()
 {
     this.carBranRepo = new Mock <IEfRepostory <CarBrand> >().Object;
 }
Пример #19
0
 public void Init()
 {
     this.carFeatureRepo = new Mock <IEfRepostory <CarFeature> >().Object;
 }
Пример #20
0
 public MemberService(IEfRepostory <Member> membersRepo, IUnitOfWork unitOfWork)
 {
     this.membersRepo = membersRepo ?? throw new ArgumentException("Members repo cannot be null");
     this.unitOfWork  = unitOfWork ?? throw new ArgumentException("Unit of work cannot be null");
 }
Пример #21
0
 public WeekScheduleService(IEfRepostory <WeekSchedule> weekScheduleRepo, IUnitOfWork unitOfWork, IDatetimeProvider datetimeProvider)
 {
     this.weekScheduleRepo = weekScheduleRepo ?? throw new ArgumentException("WeekSchedule repo cannot be null");
     this.unitOfWork       = unitOfWork ?? throw new ArgumentException("UnitOfWork cannot be null");
     this.datetimeProvider = datetimeProvider ?? throw new ArgumentException("DateTime provider cannot be null");
 }
Пример #22
0
 public ExerciseService(IEfRepostory <Exercise> exercisesRepo, IUnitOfWork unitOfWork)
 {
     this.exercisesRepo = exercisesRepo ?? throw new ArgumentException("Exercise Repo cannot be null");
     this.unitOfWork    = unitOfWork ?? throw new ArgumentException("UnitOfWork cannot be null");
 }
Пример #23
0
 public WorkoutInformationService(IEfRepostory <WorkoutInformation> workoutInformationRepo, IUnitOfWork unitOfWork)
 {
     this.workoutInformationRepo = workoutInformationRepo ?? throw new ArgumentException("WorkoutInformation repo cannot be null");
     this.unitOfWork             = unitOfWork ?? throw new ArgumentException("Unit of work cannot be null");
 }
Пример #24
0
 public UserService(IEfRepostory <User> userRepository)
 {
     Guard.WhenArgument(userRepository, "User Repository").IsNull().Throw();
     this.userRepository = userRepository;
 }