public void BatchActionDiscoveryTest_actionDescription_DiscoveringAllMethod() { //arrange var assemblyName = typeof(BatchActionDiscoveryTest).GetTypeInfo().Assembly.GetName().Name; //act var response = BatchActionDiscovery.discoveryBatchDescription(assemblyName); //assert Assert.NotNull(response); Assert.NotEmpty(response); }
private static IApplicationBatchManager getBatchAction(IServiceCollection service) { var hostingService = (IHostingEnvironment)service.FirstOrDefault(t => t.ServiceType == typeof(IHostingEnvironment))?.ImplementationInstance; var manager = (IApplicationBatchManager)service.FirstOrDefault(t => t.ServiceType == typeof(IApplicationBatchManager))?.ImplementationInstance; if (manager == null) { manager = new ApplicationBatchManager(); } var batchDescriptors = BatchActionDiscovery.discoveryBatchDescription(hostingService.ApplicationName); foreach (var item in batchDescriptors) { manager.BatchActions.Add(item); } return(manager); }