예제 #1
0
 public SupportAssetV1Controller(IAssetServices assetRepository, IControllerUtilities controllerUtilities, ILogger logger, ISupportAssetServices supportAssetServices)
 {
     _controllerUtilities = controllerUtilities;
     _assetRepository     = assetRepository;
     _logger = logger;
     _supportAssetServices = supportAssetServices;
 }
예제 #2
0
 public SupportAssetTests()
 {
     _logger = Substitute.For <ILogger>();
     _supportAssetServices = Substitute.For <ISupportAssetServices>();
     _controllerUtilities  = Substitute.For <IControllerUtilities>();
     _assetRepository      = Substitute.For <IAssetServices>();
     _controller           = new SupportAssetV1Controller(_assetRepository, _controllerUtilities, _logger, _supportAssetServices);  //_supportAssetServices, _assetRepository, _controllerUtilities, _logger);
 }
예제 #3
0
 public AssetV1Controller(IAssetServices assetServices, IControllerUtilities controllerUtilities, IConfiguration configuration, ILogger logger, ISearchAndFilter searchAndFilterClient)
 {
     _controllerUtilities   = controllerUtilities;
     _assetService          = assetServices;
     _searchAndFilterClient = searchAndFilterClient;
     _configuration         = configuration;
     _logger = logger;
     kiewitAMPCustomerUID = Guid.TryParse(_configuration["KiewitAMPCustomerUID"], out var guid) ? guid : Guid.Empty;
 }
예제 #4
0
 public AssetRepositoryTests()
 {
     _configuration = Substitute.For <IConfiguration>();
     _logger        = Substitute.For <ILogger>();
     _transaction   = Substitute.For <ITransactions>();
     _configuration["AssetTopicNames"] = "VSS.Interfaces.Events.MasterData.IAssetEvent-Alpha,VSS.Interfaces.Events.MasterData.IAssetEvent.V1-Alpha";
     _assetServices = new AssetServices(_transaction, _configuration, _logger);
     string[] topics = _configuration["AssetTopicNames"].Split(',');
 }
예제 #5
0
        public AssetEcmInfoTest()
        {
            _logger = Substitute.For <ILogger>();
            _assetECMInfoService = Substitute.For <IAssetECMInfoServices>();
            _assetServices       = Substitute.For <IAssetServices>();
            _builder             = new ContainerBuilder();
            var container = _builder.Build();

            _builder.Register(config => new AssetEcmInfoController(_assetECMInfoService, _assetServices, _logger)).As <AssetEcmInfoController>();
            _controller = CreateControllerWithHeader(container, new ControllerContext(), _assetECMInfoService, _assetServices, _logger);
        }
예제 #6
0
 public DeviceService(ILogger logger, IConfiguration configuration, ITransactions transactions, IAssetServices assetServices, IMapper mapper, IDeviceTypeService deviceTypeService)
 {
     this.logger        = logger;
     this.configuration = configuration;
     this.transactions  = transactions;
     this.assetServices = assetServices;
     this.mapper        = mapper;
     topicSuffix        = this.configuration["topicSuffix"];
     kafkaTopicNames    = configuration["KafkaTopicNames"].Split(',').Select(x => x = x + topicSuffix).ToList();
     kafkaTopicNamesV2  = configuration["KafkaTopicNamesV2"].Split(',').Select(x => x = x + topicSuffix).ToList();
     deviceTypesCache   = deviceTypeService.GetDeviceType();
 }
예제 #7
0
        public AssetTest()
        {
            _logger                = Substitute.For <ILogger>();
            _assetServices         = Substitute.For <IAssetServices>();
            _controllerUtilities   = Substitute.For <IControllerUtilities>();
            _searchAndFilterClient = Substitute.For <ISearchAndFilter>();
            string currentDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            _configuration = new ConfigurationBuilder().SetBasePath(currentDirectory)
                             .AddXmlFile("app.config.xml", true)
                             .AddJsonFile("appsettings.json", true)
                             .AddEnvironmentVariables()
                             .Build();
            _builder = new ContainerBuilder();
            var container = _builder.Build();

            _builder.Register(config => new AssetV1Controller(_assetServices, _controllerUtilities, _configuration, _logger, _searchAndFilterClient)).As <AssetOwnerDetailsV1Controller>();
            _controller = CreateControllerWithHeader(container, new ControllerContext(), _assetServices, _controllerUtilities, _configuration, _logger, _searchAndFilterClient);
        }
예제 #8
0
        private static AssetEcmInfoController CreateControllerWithHeader(IContainer container, ControllerContext mockHttpContext, IAssetECMInfoServices _assetECMInfoService, IAssetServices _assetServices, ILogger _logger)
        {
            var controller = new AssetEcmInfoController(_assetECMInfoService, _assetServices, _logger);

            controller.ControllerContext             = mockHttpContext;
            controller.ControllerContext.HttpContext = new DefaultHttpContext();
            controller.ControllerContext.HttpContext.Request.Headers["X-JWT-Assertion"] = HeaderTokenJwt;

            return(controller);
        }
예제 #9
0
 public AssetEcmInfoController(IAssetECMInfoServices assetECMInfoRepository, IAssetServices assetServices, ILogger logger)
 {
     _assetECMInfoRepository = assetECMInfoRepository;
     _assetServices          = assetServices;
     _logger = logger;
 }
예제 #10
0
        private static AssetV1Controller CreateControllerWithHeader(IContainer container, ControllerContext mockHttpContext, IAssetServices _assetServices, IControllerUtilities _controllerUtilities, IConfiguration _configuration, ILogger _logger, ISearchAndFilter _searchAndFilterClient)
        {
            var controller = new AssetV1Controller(_assetServices, _controllerUtilities, _configuration, _logger, _searchAndFilterClient);

            controller.ControllerContext             = mockHttpContext;
            controller.ControllerContext.HttpContext = new DefaultHttpContext();
            controller.ControllerContext.HttpContext.Request.Headers["X-JWT-Assertion"] = HeaderTokenJwt;
            return(controller);
        }
 public AssetsController(IAssetServices assetServices, ICoreOrderService orderService, IPurchaseOrderService purchaseOrderService, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices, IProductServices productServices, IProductLookupService productLookupService) : base(orderService, propertyService, accountServices, lookupServices)
 {
     _assetServices = assetServices;
 }
예제 #12
0
 public AssetOwnerDetailsV1Controller(IAssetOwnerServices assetOwnerRepository, IAssetServices assetServices, ILogger logger)
 {
     _assetOwnerRepository = assetOwnerRepository;
     _assetServices        = assetServices;
     _logger = logger;
 }