test: add draft workflow coverage and sqlite migration helpers
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using JobTrackerApi.Controllers;
|
||||
using JobTrackerApi.Services;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Moq;
|
||||
using Xunit;
|
||||
|
||||
namespace JobTrackerApi.Tests;
|
||||
|
||||
public sealed class ProductionConfigTests
|
||||
{
|
||||
[Fact]
|
||||
public void Summarizer_service_exposes_section_summarization_api()
|
||||
{
|
||||
var method = typeof(ISummarizerService).GetMethod("SummarizeSectionAsync");
|
||||
Assert.NotNull(method);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Profile_cv_controller_supports_pdf_and_docx_extensions()
|
||||
{
|
||||
var field = typeof(ProfileCvController).GetField("AllowedExtensions", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
|
||||
Assert.NotNull(field);
|
||||
var values = ((System.Collections.IEnumerable)field!.GetValue(null)!).Cast<string>().ToHashSet(StringComparer.OrdinalIgnoreCase);
|
||||
Assert.Contains(".pdf", values);
|
||||
Assert.Contains(".docx", values);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using Microsoft.Data.Sqlite;
|
||||
using Xunit;
|
||||
|
||||
namespace JobTrackerApi.Tests;
|
||||
|
||||
public sealed class SqliteMigrationHelperTests
|
||||
{
|
||||
[Fact]
|
||||
public void Export_payload_shape_can_be_serialized()
|
||||
{
|
||||
var payload = new
|
||||
{
|
||||
users = new[] { new { Id = "u1", Email = "u@example.com" } },
|
||||
companies = new[] { new { Id = 1, Name = "Acme" } },
|
||||
jobs = new[] { new { Id = 1, JobTitle = "Backend Dev" } }
|
||||
};
|
||||
|
||||
var json = JsonSerializer.Serialize(payload);
|
||||
Assert.Contains("users", json);
|
||||
Assert.Contains("companies", json);
|
||||
Assert.Contains("jobs", json);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user