public virtual async void TestByPublicIdNotFound() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); ApiDeviceClientResponseModel response = await client.ByDeviceByPublicId(default(Guid)); response.Should().BeNull(); }
public void MapClientRequestToResponse() { var mapper = new ApiDeviceModelMapper(); var model = new ApiDeviceClientRequestModel(); model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), true, "A", Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da")); ApiDeviceClientResponseModel response = mapper.MapClientRequestToResponse(1, model); response.Should().NotBeNull(); response.DateOfLastPing.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.IsActive.Should().Be(true); response.Name.Should().Be("A"); response.PublicId.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da")); }
public virtual async void TestByPublicIdFound() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); ApiDeviceClientResponseModel response = await client.ByDeviceByPublicId(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da")); response.Should().NotBeNull(); response.DateOfLastPing.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.Id.Should().Be(1); response.IsActive.Should().Be(true); response.Name.Should().Be("A"); response.PublicId.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da")); }