You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
744 B
C#
30 lines
744 B
C#
using System.Text.Json;
|
|
using Xunit;
|
|
using CncService.LogAnalyzer;
|
|
using CncService.Models;
|
|
|
|
namespace CncService.Tests
|
|
{
|
|
public class LogSerializationTests
|
|
{
|
|
[Fact]
|
|
public void LogAnalysisResult_Serialize_ToJson_Includes_Summary()
|
|
{
|
|
// Arrange
|
|
var analysis = new LogAnalysisResult
|
|
{
|
|
Summary = "New log entry analyzed: no changes",
|
|
DetailsJson = "{\"change\":false}",
|
|
Confidence = 0.92
|
|
};
|
|
|
|
// Act
|
|
var json = JsonSerializer.Serialize(analysis);
|
|
|
|
// Assert
|
|
Assert.Contains("Summary", json);
|
|
Assert.Contains("New log entry analyzed", json);
|
|
}
|
|
}
|
|
}
|