public async Task c() { HostingEnvironment hostEnvironment = new HostingEnvironment(); hostEnvironment.ContentRootPath = "C:\\Users\\LENOVO\\Documents\\Repositories\\lms-gateway\\src\\Presentation\\LmsGateway.Web"; hostEnvironment.ContentRootFileProvider = new PhysicalFileProvider(hostEnvironment.ContentRootPath); hostEnvironment.EnvironmentName = "Development"; Startup startup = new Web.Startup(hostEnvironment); IServiceCollection services = new ServiceCollection(); startup.ConfigureServices(services); AccountController accountController = new AccountController(_userManager.Object, _signInManager.Object); IActionResult response = await accountController.Subscription(); //var result = (IActionResult)response; //Assert.NotNull(result); Assert.NotNull(response); //Assert.Equal(7, Core.UI.Widget.Value); //Assert.IsType<ViewViewComponentResult>(response); //Assert.IsType<PaymentInfoModel>(result.ViewData.Model); //Assert.True((result.ViewData.Model as PaymentInfoModel).IconUrl != null); }
public async Task CanGenerateTransactionReference() { HostingEnvironment hostEnvironment = new HostingEnvironment(); hostEnvironment.ContentRootPath = "C:\\Users\\LENOVO\\Documents\\Repositories\\lms-gateway\\src\\Presentation\\LmsGateway.Web"; hostEnvironment.ContentRootFileProvider = new PhysicalFileProvider(hostEnvironment.ContentRootPath); hostEnvironment.EnvironmentName = "Development"; Startup startup = new Web.Startup(hostEnvironment); ServiceCollection sc = new ServiceCollection(); startup.ConfigureServices(sc); IServiceProvider serviceProvider = sc.BuildServiceProvider(); ITransactionLogService transactionLogService = serviceProvider.GetService <ITransactionLogService>(); IGatewayLuncher gatewayLuncher = serviceProvider.GetService <IGatewayLuncher>(); ISettingService settingService = serviceProvider.GetService <ISettingService>(); IWidgetProvider widgetProvider = serviceProvider.GetService <IWidgetProvider>(); var transactionRef = new TransactionReference(transactionLogService, gatewayLuncher, settingService, widgetProvider); var response = await transactionRef.InvokeAsync(); var result = (ViewViewComponentResult)response; //Assert.NotNull(result); //Assert.NotNull(response); //Assert.IsType<ViewViewComponentResult>(response); //Assert.IsType<string>(result.ViewData.Model); }
public async Task c() { HostingEnvironment hostEnvironment = new HostingEnvironment(); hostEnvironment.ContentRootPath = "C:\\Users\\LENOVO\\Documents\\Repositories\\lms-gateway\\src\\Presentation\\LmsGateway.Web"; hostEnvironment.ContentRootFileProvider = new PhysicalFileProvider(hostEnvironment.ContentRootPath); hostEnvironment.EnvironmentName = "Development"; Startup startup = new Web.Startup(hostEnvironment); IServiceCollection sc = new ServiceCollection(); startup.ConfigureServices(sc); IServiceProvider serviceProvider = sc.BuildServiceProvider(); ISupportedCurrencyService supportedCurrencyService = serviceProvider.GetService <ISupportedCurrencyService>(); IGatewayLuncher gatewayLuncher = serviceProvider.GetService <IGatewayLuncher>(); ITransactionLogService transactionLogService = serviceProvider.GetService <ITransactionLogService>(); ITransactionStatusService transactionStatusService = serviceProvider.GetService <ITransactionStatusService>(); ISettingService settingService = serviceProvider.GetService <ISettingService>(); //PaystackController paystackController = new PaystackController(transactionStatusService // , supportedCurrencyService // , hostEnvironment // , gatewayLuncher // , transactionLogService // , settingService); //var response = await paystackController.InvokeAsync(); //var result = (ViewViewComponentResult)response; //Assert.NotNull(result); //Assert.NotNull(response); //Assert.IsType<ViewViewComponentResult>(response); //Assert.IsType<PaymentInfoModel>(result.ViewData.Model); //Assert.True((result.ViewData.Model as PaymentInfoModel).IconUrl != null); }