Exemplo n.º 1
0
 //------------ Constructors -------------
 public PetService(PetStoreDbContext context, IBreedService breedService, ICategoryService categoryService, IUserService userService)
 {
     this.context         = context;
     this.breedService    = breedService;
     this.categoryService = categoryService;
     this.userService     = userService;
 }
Exemplo n.º 2
0
 public PetService(PetStoreDbContext data, IBreedService breedService, ICategoryService categoryService, IUserService userService)
 {
     this.data            = data;
     this.breedService    = breedService;
     this.categoryService = categoryService;
     this.userService     = userService;
 }
Exemplo n.º 3
0
        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();
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 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;
 }
Exemplo n.º 7
0
 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;
 }
Exemplo n.º 9
0
 public BreedResultsViewViewModel(IBreedResultsView view, IDogShowService dogShowService, IBreedService breedService, IBreedGroupService breedGroupService, IBreedChallengeResultsService breedChallengeResultsService)
     : base(view)
 {
     _dogShowService               = dogShowService;
     _breedGroupService            = breedGroupService;
     _breedService                 = breedService;
     _breedChallengeResultsService = breedChallengeResultsService;
 }
Exemplo n.º 10
0
 public AbstractBreedController(
     ApiSettings settings,
     ILogger <AbstractBreedController> logger,
     ITransactionCoordinator transactionCoordinator,
     IBreedService breedService,
     IApiBreedModelMapper breedModelMapper
     )
     : base(settings, logger, transactionCoordinator)
 {
     this.BreedService     = breedService;
     this.BreedModelMapper = breedModelMapper;
 }
Exemplo n.º 11
0
 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;
 }
Exemplo n.º 12
0
 public PetsController(IPetService pets, IBreedService breeds, ICategoryService categories)
 {
     this.pets       = pets;
     this.breeds     = breeds;
     this.categories = categories;
 }
Exemplo n.º 13
0
 public BreedController(IBreedService breedService)
 {
     this.breedService = breedService;
 }
Exemplo n.º 14
0
 public EditDogViewViewModel(IEditDogView view, IGenderService genderService, IBreedService breedService)
     : base(view)
 {
     _genderService = genderService;
     _breedService  = breedService;
 }
Exemplo n.º 15
0
 public EditHandlerViewViewModel(IEditHandlerView view, ISexService sexService, IBreedService breedService)
     : base(view)
 {
     _sexService = sexService;
 }
Exemplo n.º 16
0
 public BreedApiController(IBreedService BreedService)
 {
     _breedService = BreedService;
 }
Exemplo n.º 17
0
 public BreedsController(IBreedService breedService, AppFdmcDbContext context)
 {
     this.breedService = breedService;
     this.context      = context;
 }
Exemplo n.º 18
0
 public BreedController(IBreedService breedService, IMapper mapper)
 {
     this.breedService = breedService;
     this.mapper       = mapper;
 }
Exemplo n.º 19
0
 public BreedController(IBreedService breedService, IMapper mapper, ILoggingService loggingService)
 {
     this._breedService   = breedService;
     this._mapper         = mapper;
     this._loggingService = loggingService;
 }
Exemplo n.º 20
0
 public ValuesController(IBreedService BreedService)
 {
     _BreedService = BreedService;
 }
 public BreedsAdministrationController(IBreedService breeds)
 {
     this.breeds = breeds;
 }
Exemplo n.º 22
0
 public BreedsController(IBreedService breeds)
 {
     this.breeds = breeds;
 }