public void MapClientResponseToRequest() { var mapper = new ApiCallAssignmentModelMapper(); var model = new ApiCallAssignmentClientResponseModel(); model.SetProperties(1, 1, 1); ApiCallAssignmentClientRequestModel response = mapper.MapClientResponseToRequest(model); response.Should().NotBeNull(); response.CallId.Should().Be(1); response.UnitId.Should().Be(1); }
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()); ApiCallAssignmentClientResponseModel response = await client.CallAssignmentGetAsync(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; ApiCallAssignmentClientResponseModel response = await client.CallAssignmentGetAsync(1); response.Should().NotBeNull(); response.CallId.Should().Be(1); response.Id.Should().Be(1); response.UnitId.Should().Be(1); }