public async Task CreateMerchant() { var request = MerchantControllerTests.GetMerchantRequest(); var merchantCreate = await MerchantClient.CreateMerchantAsync(request); Assert.AreEqual(1L, merchantCreate.Id); }
public async Task Setup() { Factory = new PaymentGatewayServiceFactory <Startup>(); HttpClient = Factory.CreateClient(); // Create merchant Merchant = MerchantControllerTests.GetMerchantRequest(); MerchantClient = new MerchantsClient(HttpClient.BaseAddress.ToString(), HttpClient); // Authenticate Merchant var merchantResponse = await MerchantClient.CreateMerchantAsync(Merchant); MerchantId = merchantResponse.Id; }
public async Task AuthenticateMerchant() { var expectedExpiryDate = DateTime.UtcNow.AddDays(7); var request = MerchantControllerTests.GetMerchantRequest(); await MerchantClient.CreateMerchantAsync(request); var jwtResponse = await MerchantClient.AuthenticateAsync(new AuthenticationRequest { Login = request.Login, Password = request.Password, }); Assert.IsTrue(jwtResponse.JwtToken.Length > 0); Assert.IsTrue(jwtResponse.Expires > expectedExpiryDate); }