public void MapClientRequestToResponse() { var mapper = new ApiIncludedColumnTestModelMapper(); var model = new ApiIncludedColumnTestClientRequestModel(); model.SetProperties("A", "A"); ApiIncludedColumnTestClientResponseModel response = mapper.MapClientRequestToResponse(1, model); response.Should().NotBeNull(); response.Name.Should().Be("A"); response.Name2.Should().Be("A"); }
public virtual async void TestGetNotFound() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); ApiIncludedColumnTestClientResponseModel response = await client.IncludedColumnTestGetAsync(default(int)); response.Should().BeNull(); }
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; ApiIncludedColumnTestClientResponseModel response = await client.IncludedColumnTestGetAsync(1); response.Should().NotBeNull(); response.Id.Should().Be(1); response.Name.Should().Be("A"); response.Name2.Should().Be("A"); }