Esempio n. 1
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);
        }
Esempio n. 2
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);
        }
Esempio n. 3
0
 public AssetECMServicesTests()
 {
     _configuration    = Substitute.For <IConfiguration>();
     _transaction      = Substitute.For <ITransactions>();
     _assetECMServices = new AssetECMServices(_transaction, _configuration);
 }
Esempio n. 4
0
 public AssetEcmInfoController(IAssetECMInfoServices assetECMInfoRepository, IAssetServices assetServices, ILogger logger)
 {
     _assetECMInfoRepository = assetECMInfoRepository;
     _assetServices          = assetServices;
     _logger = logger;
 }