Ejemplo n.º 1
0
        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");
        }
Ejemplo n.º 3
0
        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");
        }