//------------ Constructors ------------- public PetService(PetStoreDbContext context, IBreedService breedService, ICategoryService categoryService, IUserService userService) { this.context = context; this.breedService = breedService; this.categoryService = categoryService; this.userService = userService; }
public PetService(PetStoreDbContext data, IBreedService breedService, ICategoryService categoryService, IUserService userService) { this.data = data; this.breedService = breedService; this.categoryService = categoryService; this.userService = userService; }
public virtual async void TestDelete() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext; IBreedService service = testServer.Host.Services.GetService(typeof(IBreedService)) as IBreedService; var model = new ApiBreedServerRequestModel(); model.SetProperties("B", 1); CreateResponse <ApiBreedServerResponseModel> createdResponse = await service.Create(model); createdResponse.Success.Should().BeTrue(); ActionResponse deleteResult = await client.BreedDeleteAsync(2); deleteResult.Success.Should().BeTrue(); ApiBreedServerResponseModel verifyResponse = await service.Get(2); verifyResponse.Should().BeNull(); }
public virtual async void TestUpdate() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); var mapper = new ApiBreedServerModelMapper(); ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext; IBreedService service = testServer.Host.Services.GetService(typeof(IBreedService)) as IBreedService; ApiBreedServerResponseModel model = await service.Get(1); ApiBreedClientRequestModel request = mapper.MapServerResponseToClientRequest(model); request.SetProperties("B", 1); UpdateResponse <ApiBreedClientResponseModel> updateResponse = await client.BreedUpdateAsync(model.Id, request); context.Entry(context.Set <Breed>().ToList()[0]).Reload(); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); updateResponse.Record.Id.Should().Be(1); context.Set <Breed>().ToList()[0].Name.Should().Be("B"); context.Set <Breed>().ToList()[0].SpeciesId.Should().Be(1); updateResponse.Record.Id.Should().Be(1); updateResponse.Record.Name.Should().Be("B"); updateResponse.Record.SpeciesId.Should().Be(1); }
public AnimalService(IRepository <Animal> repository, IMapper mapper, IKeepingService keepingService, IAttitudeToService attitudesToService, IDefectService defectService, IProcessingService processingService, INeedsService needsService, IVaccinationService vaccinationService, IIsNewService isNewService, IUriService uriService, IAnimalLocationHistoryService locationHistoryService, IStatisticService <Animal> statisticService, IAnimalViewLocationService locationService, IFilterService <Animal, AnimalQuery> animalFilterService, IDescriptionService descriptionService, IBreedService breedService) { _repository = repository; _mapper = mapper; _keepingService = keepingService; _attitudesToService = attitudesToService; _defectService = defectService; _processingService = processingService; _needsService = needsService; _isNewService = isNewService; _vaccinationService = vaccinationService; _uriService = uriService; _locationHistoryService = locationHistoryService; _statisticService = statisticService; _descriptionService = descriptionService; _breedService = breedService; _locationService = locationService; _animalFilterService = animalFilterService; }
public CaptureNewDogViewViewModel(ICaptureNewDogView view, IGenderService genderService, IBreedService breedService, IGlobalContextService globalContextService) : base(view) { _genderService = genderService; _breedService = breedService; _globalContextService = globalContextService; }
public BreedEntryResultsViewViewModel(IBreedEntryResultsView view, IDogShowService dogShowService, IBreedService breedService, IBreedGroupService breedGroupService, IBreedEntryService breedEntryService) : base(view) { _dogShowService = dogShowService; _breedGroupService = breedGroupService; _breedService = breedService; _breedEntryService = breedEntryService; }
public PetsAdministrationController(IPetService pets, IPetStatusService petStatuses, IUserService users, ILocationService locations, IBreedService breeds) { this.pets = pets; this.petStatuses = petStatuses; this.users = users; this.locations = locations; this.breeds = breeds; }
public BreedResultsViewViewModel(IBreedResultsView view, IDogShowService dogShowService, IBreedService breedService, IBreedGroupService breedGroupService, IBreedChallengeResultsService breedChallengeResultsService) : base(view) { _dogShowService = dogShowService; _breedGroupService = breedGroupService; _breedService = breedService; _breedChallengeResultsService = breedChallengeResultsService; }
public AbstractBreedController( ApiSettings settings, ILogger <AbstractBreedController> logger, ITransactionCoordinator transactionCoordinator, IBreedService breedService, IApiBreedModelMapper breedModelMapper ) : base(settings, logger, transactionCoordinator) { this.BreedService = breedService; this.BreedModelMapper = breedModelMapper; }
public BreedController( ApiSettings settings, ILogger <BreedController> logger, ITransactionCoordinator transactionCoordinator, IBreedService breedService, IApiBreedServerModelMapper breedModelMapper ) : base(settings, logger, transactionCoordinator) { this.BreedService = breedService; this.BreedModelMapper = breedModelMapper; this.BulkInsertLimit = 250; this.MaxLimit = 1000; this.DefaultLimit = 250; }
public PetsController(IPetService pets, IBreedService breeds, ICategoryService categories) { this.pets = pets; this.breeds = breeds; this.categories = categories; }
public BreedController(IBreedService breedService) { this.breedService = breedService; }
public EditDogViewViewModel(IEditDogView view, IGenderService genderService, IBreedService breedService) : base(view) { _genderService = genderService; _breedService = breedService; }
public EditHandlerViewViewModel(IEditHandlerView view, ISexService sexService, IBreedService breedService) : base(view) { _sexService = sexService; }
public BreedApiController(IBreedService BreedService) { _breedService = BreedService; }
public BreedsController(IBreedService breedService, AppFdmcDbContext context) { this.breedService = breedService; this.context = context; }
public BreedController(IBreedService breedService, IMapper mapper) { this.breedService = breedService; this.mapper = mapper; }
public BreedController(IBreedService breedService, IMapper mapper, ILoggingService loggingService) { this._breedService = breedService; this._mapper = mapper; this._loggingService = loggingService; }
public ValuesController(IBreedService BreedService) { _BreedService = BreedService; }
public BreedsAdministrationController(IBreedService breeds) { this.breeds = breeds; }
public BreedsController(IBreedService breeds) { this.breeds = breeds; }