public virtual async void TestByExternalIdFound() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); ApiLinkClientResponseModel response = await client.ByLinkByExternalId(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da")); response.Should().NotBeNull(); response.AssignedMachineId.Should().Be(1); response.ChainId.Should().Be(1); response.DateCompleted.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.DateStarted.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.DynamicParameters.Should().Be("A"); response.ExternalId.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da")); response.Id.Should().Be(1); response.LinkStatusId.Should().Be(1); response.Name.Should().Be("A"); response.Order.Should().Be(1); response.Response.Should().Be("A"); response.StaticParameters.Should().Be("A"); response.TimeoutInSeconds.Should().Be(1); }
public virtual async void TestByExternalIdNotFound() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); ApiLinkClientResponseModel response = await client.ByLinkByExternalId(default(Guid)); response.Should().BeNull(); }
public void MapClientResponseToRequest() { var mapper = new ApiLinkModelMapper(); var model = new ApiLinkClientResponseModel(); model.SetProperties(1, 1, 1, DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM"), "A", Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), 1, "A", 1, "A", "A", 1); ApiLinkClientRequestModel response = mapper.MapClientResponseToRequest(model); response.Should().NotBeNull(); response.AssignedMachineId.Should().Be(1); response.ChainId.Should().Be(1); response.DateCompleted.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.DateStarted.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.DynamicParameters.Should().Be("A"); response.ExternalId.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da")); response.LinkStatusId.Should().Be(1); response.Name.Should().Be("A"); response.Order.Should().Be(1); response.Response.Should().Be("A"); response.StaticParameters.Should().Be("A"); response.TimeoutInSeconds.Should().Be(1); }