-
Notifications
You must be signed in to change notification settings - Fork 662
Expand file tree
/
Copy pathYamlAotCompatibilityTests.cs
More file actions
52 lines (46 loc) · 1.96 KB
/
YamlAotCompatibilityTests.cs
File metadata and controls
52 lines (46 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using GitVersion.Configuration;
using GitVersion.VersionCalculation;
namespace GitVersion.Core.Tests;
[TestFixture]
public class YamlAotCompatibilityTests
{
[Test]
public void YamlConfigurationContextCanBeInstantiated()
{
// Arrange & Act
var context = new YamlConfigurationContext();
// Assert
// The fact that we can instantiate the context means the infrastructure is in place
// Once the source generator issues are resolved, this context will provide AOT-compatible serialization
context.ShouldNotBeNull();
context.ShouldBeOfType<YamlConfigurationContext>();
}
[Test]
public void YamlConfigurationContextHasCorrectBaseType()
{
// Arrange
var context = new YamlConfigurationContext();
// Assert
// Verify it inherits from StaticContext as required by YamlDotNet source generator
context.ShouldBeAssignableTo<YamlDotNet.Serialization.StaticContext>();
}
/// <summary>
/// Note: Full AOT serialization/deserialization tests are currently disabled due to known issues
/// in the Vecc.YamlDotNet.Analyzers.StaticGenerator package (TypeFactoryGenerator failures).
///
/// When the source generator issues are resolved, the following functionality should work:
/// - StaticSerializerBuilder(context).Build() for AOT-compatible serialization
/// - StaticDeserializerBuilder(context).Build() for AOT-compatible deserialization
///
/// See: https://github.com/aaubry/YamlDotNet/issues/740
/// </summary>
[Test]
[Ignore("Source generator has known issues - TypeFactoryGenerator fails with IndexOutOfRangeException")]
public void StaticContextCanSerializeConfiguration()
{
// This test is placeholder for future when source generator is fixed
var context = new YamlConfigurationContext();
// var serializer = new StaticSerializerBuilder(context).Build();
// Test serialization...
}
}