public DogService(IDogRepository repository, IColorRepository colorRepository, IMapper mapper, IImageService imgService) { _repository = repository; _colorRepository = colorRepository; _mapper = mapper; _imgService = imgService; }
public WalksController(IWalksRepository walksRepository, IWalkerRepository walkerRepository, IDogRepository dogRepository, IOwnerRepository ownerRepository) { _walkerRepository = walkerRepository; _walksRepository = walksRepository; _dogRepository = dogRepository; _ownerRepository = ownerRepository; }
public CompetitionsController(ApplicationDbContext db, IDogRepository dogRepository, ICompRepository compRepository, UserManager <IdentityUser> userManager) { _db = db; _dogRepository = dogRepository; _compRepository = compRepository; _userManager = userManager; }
public MatchesService(IDogRepository dogRepository, IDogProfileService dogProfileService, IMapper mapper, ITemperamentRepository temperamentRepository) { _dogRepository = dogRepository; _dogProfileService = dogProfileService; _temperamentRepository = temperamentRepository; _mapper = mapper; }
public void GetDogById() { //Arrange IDogRepository sut = GetInMemoryDogRepository(); Dog dog1 = new Dog() { Id = 3, DogName = "Jo", Breed = "Terrier x", DOB = DateTime.Parse("2012-07-26"), Image = "jo.jpg", ApplicationUserId = "d4eb7d23-d641-4c2d-8cd3-a036e08a3c65" }; Dog dog2 = new Dog() { Id = 4, DogName = "Maddie", Breed = "Irish Terrier", DOB = DateTime.Parse("2013-09-17"), Image = "maddie.jpg", ApplicationUserId = "20f95e44-8f29-42d8-b3f9-ff4c3e683ce5" }; //Act Dog savedDog1 = sut.CreateDog(dog1); Dog savedDog2 = sut.CreateDog(dog2); //Assert var foundDogById = sut.GetDogById(4); Assert.Equal("Maddie", foundDogById.DogName); }
public DogsController( IOwnerRepository ownerRepository, IDogRepository dogRepository) { _ownerRepository = ownerRepository; _dogRepository = dogRepository; }
public DogsController(ApplicationDbContext db, IWebHostEnvironment webHostEnvironment, IDogRepository dogRepository, UserManager <IdentityUser> userManager) { _db = db; _webHostEnvironment = webHostEnvironment; _dogRepository = dogRepository; _userManager = userManager; }
public WalkersController(IWalkerRepository walkerRepo, IWalksRepository walksRepo, IOwnerRepository ownerRepo, IDogRepository dogRepo) { _walkerRepo = walkerRepo; _walksRepo = walksRepo; _ownerRepo = ownerRepo; _dogRepo = dogRepo; }
public OwnersController(IOwnerRepository ownerRepository, IDogRepository dogRepository, IWalkerRepository walkerRepository, INeighborhoodRepository neighborhoodRepository) { _ownerRepo = ownerRepository; _dogRepo = dogRepository; _walkerRepo = walkerRepository; _neighborhoodRepo = neighborhoodRepository; }
// The constructor accepts an IConfiguration object as a parameter. This class comes from the ASP.NET framework and is useful for retrieving things out of the appsettings.json file like connection strings. public OwnersController(IConfiguration config) { _OwnerRepo = new OwnerRepository(config); _dogRepo = new DogRepository(config); _walkerRepo = new WalkerRepository(config); _neighborhoodRepo = new NeighborhoodRepository(config); }
public ReservationsController(IDogRepository dogRepository, IMapper mapper, IClientRepository clientRepository, IReservationRepository reservationRepository) { _dogRepository = dogRepository ?? throw new ArgumentNullException(nameof(dogRepository)); _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); _clientRepository = clientRepository ?? throw new ArgumentNullException(nameof(clientRepository)); _reservationRepository = reservationRepository ?? throw new ArgumentNullException(nameof(reservationRepository)); }
public DogService(IFileUtil fileUtil, IDogRepository dogRepository, IOptions <PaginationOption> paginationOption, IOptions <PathOption> pathOption) { this.fileUtil = fileUtil; this.pathOption = pathOption.Value; this.dogRepository = dogRepository; this.paginationOption = paginationOption.Value; }
public void Index_Dogs() { //Arrange IDogRepository sut = GetInMemoryDogRepository(); Dog dog = new Dog() { Id = 3, DogName = "Jo", Breed = "Terrier x", DOB = DateTime.Parse("2012-07-26"), Image = "jo.jpg", ApplicationUserId = "d4eb7d23-d641-4c2d-8cd3-a036e08a3c65" }; //Act Dog savedDog = sut.CreateDog(dog); //Assert Assert.Single(sut.Dogs); Assert.Equal(3, savedDog.Id); Assert.Equal("Jo", savedDog.DogName); Assert.Equal("Terrier x", savedDog.Breed); Assert.Equal("jo.jpg", savedDog.Image); Assert.Equal(DateTime.Parse("2012-07-26"), savedDog.DOB); Assert.Equal("d4eb7d23-d641-4c2d-8cd3-a036e08a3c65", savedDog.ApplicationUserId); }
public void Index_Update_Dog_Name() { //Arrange IDogRepository sut = GetInMemoryDogRepository(); Dog dog1 = new Dog() { Id = 3, DogName = "Jo", Breed = "Terrier x", DOB = DateTime.Parse("2012-07-26"), Image = "jo.jpg", ApplicationUserId = "d4eb7d23-d641-4c2d-8cd3-a036e08a3c65" }; Dog dog2 = new Dog() { Id = 3, DogName = "Josephine", Breed = "Terrier x", DOB = DateTime.Parse("2012-07-26"), Image = "jo.jpg", ApplicationUserId = "d4eb7d23-d641-4c2d-8cd3-a036e08a3c65" }; //Act Dog savedDog = sut.CreateDog(dog1); Dog savedDog1 = sut.UpdateDog(dog2); //Assert Assert.Single(sut.Dogs); Assert.Equal("Josephine", dog2.DogName); }
public DogService(IUnitOfWork _unitOfWork, IDogRepository _dogRepo, IDogPhotoRepository _dogPhotoRepo, IMainMessageBoardRepository _mainDashboardRepo) { unitOfWork = _unitOfWork; dogRepo = _dogRepo; dogPhotoRepo = _dogPhotoRepo; mainDashboardRepo = _mainDashboardRepo; }
public WalksController(IWalksRepository walksRepository, IDogRepository dogRepository, IWalkerRepository walkerRepository) { _walksRepo = walksRepository; _dogRepo = dogRepository; _walkerRepo = walkerRepository; }
public ImageService(IDogImagesRepository repository, IDogRepository dogRepository, IConfiguration config, IMapper mapper, ILogger <ImageService> logger) { _repository = repository; _dogRepository = dogRepository; _config = config; _mapper = mapper; _logger = logger; }
public AccountController(UserManager <ApplicationUser> userManager, IDogRepository dogRepository, IWebHostEnvironment webHostEnvironment, SignInManager <ApplicationUser> signInManager, ILogger <AccountController> logger) { _userManager = userManager; _dogRepository = dogRepository; _webHostEnvironment = webHostEnvironment; _signInManager = signInManager; _logger = logger; }
public DogManagerController(IDogRepository dogRepo, IBreedRepository breedRepo, ILogger <DogManagerController> logger, IHostingEnvironment hostEnv) { _dogRepo = dogRepo; _breedRepo = breedRepo; _logger = logger; _hostEnv = hostEnv; }
public DogsController(IDogRepository dogRepository, IMapper mapper, IPropertyMappingService propertyMappingService, IPropertyCheckerService propertyCheckerService) { _dogRepository = dogRepository; _mapper = mapper; _propertyMappingService = propertyMappingService; _propertyCheckerService = propertyCheckerService; }
public ClubService( IClubRepository clubRepository, IPersonRepository personRepository, IDogRepository dogRepository ) { _clubRepository = clubRepository; _personRepository = personRepository; _dogRepository = dogRepository; }
public PersonalDashboardService(IUnitOfWork _unitOfWork, IDogRepository _dogRepo, IPrivateMessageBoardRepository _privateMessageBoardRepo, IRequestMessageRepository _requestMessageRepo, IDogPhotoRepository _dogPhotoRepo) { unitOfWork = _unitOfWork; dogRepo = _dogRepo; privateMessageBoardRepo = _privateMessageBoardRepo; requestMessageRepo = _requestMessageRepo; dogPhotoRepo = _dogPhotoRepo; }
public RecommendationController(ILogger <RecommendationController> logger, IQuizRepository quizRepository, IDogRepository dogRepository, UserManager <User> userManager) { this.logger = logger; this.quizRepository = quizRepository; this.dogRepository = dogRepository; this.userManager = userManager; }
public DogsForOwnerController(IOwnerRepository ownerRepository, IDogRepository dogRepository, IMapper mapper, IPropertyCheckerService propertyCheckerService) { _ownerRepository = ownerRepository; _dogRepository = dogRepository; _mapper = mapper; _propertyCheckerService = propertyCheckerService; }
public OwnersController( IOwnerRepository ownerRepository, IDogRepository dogRepository, IWalkerRepository walkerRepository, IWalkRepository walkRepository) { _ownerRepo = ownerRepository; _dogRepo = dogRepository; _walkerRepo = walkerRepository; _walkRepo = walkRepository; }
// ASP.NET will give us an instance of our Walker Repository. This is called "Dependency Injection" public OwnersController( IOwnerRepository ownerRepository, // ownerRepository is a value type IDogRepository dogRepository, IWalkerRepository walkerRepository, INeighborhoodRepository neighborhoodRepository) { //giving the variable the value of the instantiated repo _ownerRepo = ownerRepository; _dogRepo = dogRepository; _walkerRepo = walkerRepository; _neighborhoodRepo = neighborhoodRepository; }
// ASP.NET will give us an instance of our Walker Repository. This is called "Dependency Injection" public OwnerController( //_ownerRepo is receipe box IOwnerRepository ownerRepository, IDogRepository dogRepository, IWalkerRepository walkerRepository, INeighborhoodRepository neighborhoodRepository) { _ownerRepo = ownerRepository; _dogRepo = dogRepository; _walkerRepo = walkerRepository; _neighborhoodRepo = neighborhoodRepository; }
//Bring in Repositories for Owner (and supporting tables for ProfileViewModel, or where ever wanted to use on own views) public OwnersController( IOwnerRepository ownerRepository, IDogRepository dogRepository, IWalkerRepository walkerRepository, INeighborhoodRepository neighborhoodRepository) { //set private fieds equal to the properties by the repository constructor (which is the configuration / db address) _ownerRepo = ownerRepository; _dogRepo = dogRepository; _walkerRepo = walkerRepository; _neighborhoodRepo = neighborhoodRepository; }
// ASP.NET will give us an instance of our Walker Repository. This is called "Dependency Injection" public WalkersController( IWalkerRepository walkerRepository, IWalkRepository walkRepository, IDogRepository dogRepository, INeighborhoodRepository neighborRepository) //IOwnerRepository ownerRepository { _walkerRepo = walkerRepository; _walkRepo = walkRepository; _dogRepo = dogRepository; _neighborRepo = neighborRepository; //_ownerRepo = ownerRepository; }
public void Controller_GetAll_ReturnValidList() { // Arrange dogRepositoryMock = new Mock <IDogRepository>(); IDogRepository petRepository = dogRepositoryMock.Object; dogRepositoryMock.Setup(call => call.GetAll()) .Returns(new List <Dog> { new Dog(2, "PhiPhi", "smile") }); var controller = new HomeController(dogRepositoryMock.Object); // Act var response = controller.GetAll(); var result = response.Result as OkObjectResult; var dogs = result.Value as IEnumerable <Dog>; // Assert Assert.AreEqual(4, dogs.Count()); }
public DogsController() { this.dogRepository = new DogRepository(new DogContext()); this.dogModifier = new DogModifier(); }