/// <summary>
        /// Get the <see cref="InfluxDB.Client.Api.Domain.Check" /> client.
        /// </summary>
        /// <returns>the new client instance for Checks API</returns>
        public ChecksApi GetChecksApi()
        {
            var service = new ChecksService((Configuration)_apiClient.Configuration)
            {
                ExceptionFactory = _exceptionFactory
            };

            return(new ChecksApi(service));
        }
Exemplo n.º 2
0
        public async Task CheckInspectionLifts_WithValidInput_ShouldBeReturnCorrectDate()
        {
            MapperInitializer.InitializeMapper();
            var context      = InitializeContext.CreateContextForInMemory();
            var repository   = new EfDeletableEntityRepository <Lift>(context);
            var checkService = new ChecksService(repository);

            var lift = new Lift
            {
                Id = "1",
                ApplicationUserId  = "A1",
                LiftType           = (LiftType)Enum.Parse(typeof(LiftType), "Пътнически"),
                NumberOfStops      = 6,
                Capacity           = 630,
                DoorType           = (DoorType)Enum.Parse(typeof(DoorType), "АВ"),
                RegistrationNumber = "123",
                ManufacturerId     = "M1",
                ProductionNumber   = "P123",
                Address            = "Address",
                Inspects           = new List <Inspect>()
                {
                    new Inspect
                    {
                        ApplicationUserId = "A1",
                        InspectTypeId     = "Периодичен",
                        LiftId            = "1",
                        SupportCompanyId  = "S1",
                        Notes             = "Test",
                        Prescriptions     = "Test",
                        CreatedOn         = DateTime.UtcNow.AddDays(-10),
                    },
                },
            };

            await context.Lifts.AddAsync(lift);

            await context.SaveChangesAsync();

            var findLift = context.Inspects.FirstOrDefault();

            Assert.NotNull(findLift);

            var date = await checkService.GetValidInspect("123");

            Assert.NotNull(date);
            Assert.True(DateTime.UtcNow > date);
        }
Exemplo n.º 3
0
        protected internal ChecksApi(ChecksService service)
        {
            Arguments.CheckNotNull(service, nameof(service));

            _service = service;
        }