Fix audit findings for coverage, architecture checks, and XML docs
This commit is contained in:
@@ -16,6 +16,9 @@ public class SourceGeneratorFeaturesTests : IDisposable
|
||||
private readonly string _walPath;
|
||||
private readonly Shared.TestDbContext _db;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SourceGeneratorFeaturesTests"/> class.
|
||||
/// </summary>
|
||||
public SourceGeneratorFeaturesTests()
|
||||
{
|
||||
_dbPath = Path.Combine(Path.GetTempPath(), $"test_sg_features_{Guid.NewGuid()}.db");
|
||||
@@ -26,6 +29,9 @@ public class SourceGeneratorFeaturesTests : IDisposable
|
||||
|
||||
#region Inheritance Tests
|
||||
|
||||
/// <summary>
|
||||
/// Tests derived entity inherits id from base class.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void DerivedEntity_InheritsId_FromBaseClass()
|
||||
{
|
||||
@@ -50,6 +56,9 @@ public class SourceGeneratorFeaturesTests : IDisposable
|
||||
retrieved.CreatedAt.Date.ShouldBe(entity.CreatedAt.Date); // Compare just date part
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests derived entity update works with inherited id.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void DerivedEntity_Update_WorksWithInheritedId()
|
||||
{
|
||||
@@ -80,6 +89,9 @@ public class SourceGeneratorFeaturesTests : IDisposable
|
||||
updated.Description.ShouldBe("Updated Description");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests derived entity query works with inherited properties.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void DerivedEntity_Query_WorksWithInheritedProperties()
|
||||
{
|
||||
@@ -107,6 +119,9 @@ public class SourceGeneratorFeaturesTests : IDisposable
|
||||
|
||||
#region Computed Properties Tests
|
||||
|
||||
/// <summary>
|
||||
/// Tests computed properties are not serialized.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ComputedProperties_AreNotSerialized()
|
||||
{
|
||||
@@ -135,6 +150,9 @@ public class SourceGeneratorFeaturesTests : IDisposable
|
||||
retrieved.DisplayInfo.ShouldContain("John Doe");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests computed properties update does not break.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ComputedProperties_UpdateDoesNotBreak()
|
||||
{
|
||||
@@ -170,6 +188,9 @@ public class SourceGeneratorFeaturesTests : IDisposable
|
||||
|
||||
#region Advanced Collections Tests
|
||||
|
||||
/// <summary>
|
||||
/// Tests hash set serializes and deserializes.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void HashSet_SerializesAndDeserializes()
|
||||
{
|
||||
@@ -197,6 +218,9 @@ public class SourceGeneratorFeaturesTests : IDisposable
|
||||
retrieved.Tags.ShouldContain("tag3");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests iset serializes and deserializes.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ISet_SerializesAndDeserializes()
|
||||
{
|
||||
@@ -225,6 +249,9 @@ public class SourceGeneratorFeaturesTests : IDisposable
|
||||
retrieved.Numbers.ShouldContain(30);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests linked list serializes and deserializes.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void LinkedList_SerializesAndDeserializes()
|
||||
{
|
||||
@@ -253,6 +280,9 @@ public class SourceGeneratorFeaturesTests : IDisposable
|
||||
historyList[2].ShouldBe("third");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests queue serializes and deserializes.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void Queue_SerializesAndDeserializes()
|
||||
{
|
||||
@@ -280,6 +310,9 @@ public class SourceGeneratorFeaturesTests : IDisposable
|
||||
items.ShouldContain("item3");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests stack serializes and deserializes.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void Stack_SerializesAndDeserializes()
|
||||
{
|
||||
@@ -307,6 +340,9 @@ public class SourceGeneratorFeaturesTests : IDisposable
|
||||
items.ShouldContain("action3");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests hash set with nested objects serializes and deserializes.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void HashSet_WithNestedObjects_SerializesAndDeserializes()
|
||||
{
|
||||
@@ -334,6 +370,9 @@ public class SourceGeneratorFeaturesTests : IDisposable
|
||||
addressList.ShouldContain(a => a.Street == "456 Oak Ave" && a.City.Name == "LA");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests iset with nested objects serializes and deserializes.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ISet_WithNestedObjects_SerializesAndDeserializes()
|
||||
{
|
||||
@@ -363,6 +402,9 @@ public class SourceGeneratorFeaturesTests : IDisposable
|
||||
cityNames.ShouldContain("London");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests advanced collections all types in single entity.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void AdvancedCollections_AllTypesInSingleEntity()
|
||||
{
|
||||
@@ -411,6 +453,9 @@ public class SourceGeneratorFeaturesTests : IDisposable
|
||||
|
||||
#region Private Setters Tests
|
||||
|
||||
/// <summary>
|
||||
/// Tests entity with private setters can be deserialized.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void EntityWithPrivateSetters_CanBeDeserialized()
|
||||
{
|
||||
@@ -429,6 +474,9 @@ public class SourceGeneratorFeaturesTests : IDisposable
|
||||
retrieved.Age.ShouldBe(30);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests entity with private setters update works.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void EntityWithPrivateSetters_Update_Works()
|
||||
{
|
||||
@@ -452,6 +500,9 @@ public class SourceGeneratorFeaturesTests : IDisposable
|
||||
retrieved.Age.ShouldBe(35);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests entity with private setters query works.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void EntityWithPrivateSetters_Query_Works()
|
||||
{
|
||||
@@ -478,6 +529,9 @@ public class SourceGeneratorFeaturesTests : IDisposable
|
||||
|
||||
#region Init-Only Setters Tests
|
||||
|
||||
/// <summary>
|
||||
/// Tests entity with init setters can be deserialized.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void EntityWithInitSetters_CanBeDeserialized()
|
||||
{
|
||||
@@ -502,6 +556,9 @@ public class SourceGeneratorFeaturesTests : IDisposable
|
||||
retrieved.Age.ShouldBe(28);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests entity with init setters query works.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void EntityWithInitSetters_Query_Works()
|
||||
{
|
||||
@@ -526,6 +583,9 @@ public class SourceGeneratorFeaturesTests : IDisposable
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Disposes the resources used by this instance.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
_db?.Dispose();
|
||||
|
||||
Reference in New Issue
Block a user