public virtual async void TestGetNotFound() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); ApiBankAccountClientResponseModel response = await client.BankAccountGetAsync(default(int)); response.Should().BeNull(); }
public void MapClientRequestToResponse() { var mapper = new ApiBankAccountModelMapper(); var model = new ApiBankAccountClientRequestModel(); model.SetProperties("A", 1, "A"); ApiBankAccountClientResponseModel response = mapper.MapClientRequestToResponse(1, model); response.Should().NotBeNull(); response.AccountNumber.Should().Be("A"); response.ArtistId.Should().Be(1); response.RoutingNumber.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; ApiBankAccountClientResponseModel response = await client.BankAccountGetAsync(1); response.Should().NotBeNull(); response.AccountNumber.Should().Be("A"); response.ArtistId.Should().Be(1); response.Id.Should().Be(1); response.RoutingNumber.Should().Be("A"); }