Example #1
0
 public DocumentController(IAsbestosService asbestosService, ILoggerAdapter <DocumentController> logger,
                           ILoggerAdapter <AsbestosActions> loggerActions)
 {
     _asbestosService = asbestosService;
     _logger          = logger;
     _loggerActions   = loggerActions;
 }
Example #2
0
 public ControllerSetup(IAsbestosService asbestosService, ILoggerAdapter <DataController> logger,
                        ILoggerAdapter <AsbestosActions> loggerActions) : base
 {
     _asbestosService = asbestosService;
     _logger          = logger;
     _loggerActions   = loggerActions;
 }
        public async Task can_access_inspection_data_from_response()
        {
            IEnumerable <Inspection> responseData;

            var fakeRepository         = new Mock <IPsi2000Api>();
            var fakeInspectionResponse = new InspectionResponse()
            {
                Data = new List <Inspection>()
            };

            fakeInspectionResponse.Data.Add(new Inspection()
            {
                Id = fakeId,
                LocationDescription = fakeDescription
            });

            fakeRepository
            .Setup(m => m.GetInspections(It.IsAny <string>()))
            .Returns(Task.FromResult(fakeInspectionResponse));

            asbestosService = new AsbestosService(fakeRepository.Object, fakeLogger.Object);
            responseData    = await asbestosService.GetInspection(fakeId.ToString());

            Assert.Equal(fakeId, responseData.ElementAt(0).Id);
            Assert.Equal(fakeDescription, responseData.ElementAt(0).LocationDescription);
        }
        public async Task can_access_room_data_from_response()
        {
            Room responseData;
            var  fakeRepository   = new Mock <IPsi2000Api>();
            var  fakeRoomResponse = new RoomResponse()
            {
                Data = new Room()
                {
                    Id          = fakeId,
                    Description = fakeDescription
                }
            };

            fakeRepository
            .Setup(m => m.GetRoom(It.IsAny <string>()))
            .Returns(Task.FromResult(fakeRoomResponse));

            asbestosService = new AsbestosService(fakeRepository.Object, fakeLogger.Object);
            responseData    = await asbestosService.GetRoom(fakeId.ToString());

            Assert.Equal(fakeId, responseData.Id);
            Assert.Equal(fakeDescription, responseData.Description);
        }
 public AsbestosActions(IAsbestosService asbestosService, ILoggerAdapter <AsbestosActions> logger)
 {
     _asbestosService = asbestosService;
     _logger          = logger;
 }