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