public virtual async void TestGetNotFound() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); ApiTransactionClientResponseModel response = await client.TransactionGetAsync(default(int)); response.Should().BeNull(); }
public void MapClientRequestToResponse() { var mapper = new ApiTransactionModelMapper(); var model = new ApiTransactionClientRequestModel(); model.SetProperties(1m, "A", 1); ApiTransactionClientResponseModel response = mapper.MapClientRequestToResponse(1, model); response.Should().NotBeNull(); response.Amount.Should().Be(1m); response.GatewayConfirmationNumber.Should().Be("A"); response.TransactionStatusId.Should().Be(1); }
public void MapClientRequestToResponse() { var mapper = new ApiTransactionModelMapper(); var model = new ApiTransactionClientRequestModel(); model.SetProperties(1m, 1, DateTime.Parse("1/1/1987 12:00:00 AM"), "A"); ApiTransactionClientResponseModel response = mapper.MapClientRequestToResponse(1, model); response.Should().NotBeNull(); response.Amount.Should().Be(1m); response.ArtistId.Should().Be(1); response.DateCreated.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.StripeTransactionId.Should().Be("A"); }
public virtual async void TestGetFound() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext; ApiTransactionClientResponseModel response = await client.TransactionGetAsync(1); response.Should().NotBeNull(); response.Amount.Should().Be(1m); response.ArtistId.Should().Be(1); response.DateCreated.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.Id.Should().Be(1); response.StripeTransactionId.Should().Be("A"); }
public virtual async void TestGetFound() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext; ApiTransactionClientResponseModel response = await client.TransactionGetAsync(1); response.Should().NotBeNull(); response.Amount.Should().Be(1m); response.GatewayConfirmationNumber.Should().Be("A"); response.Id.Should().Be(1); response.TransactionStatusId.Should().Be(1); }