Skip to content

Commit

Permalink
Move test entities.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcweber committed Feb 20, 2025
1 parent 19a3c30 commit f893d6e
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 51 deletions.
19 changes: 19 additions & 0 deletions test/Tests.Infrastructure/GraphSon/Entities/Bug_1884_Entity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
namespace ExRam.Gremlinq.Tests.Infrastructure.GraphSon.Entities
{
public class Bug_1884_Entity
{
public Bug_1884_Entity()
{
MyEnum1 = Bug_1884_Enum.ValueB;
}

// this default value is overwritten during deserialization (as expected)
public DateTime CreatedAt { get; set; } = TimeProvider.System.GetUtcNow().DateTime.Date;

// after deserialization, the value of this property is always ValueB (bug)
public Bug_1884_Enum MyEnum1 { get; set; }

// after deserialization the value of this property is always false (bug)
public bool IsDeleted { get; set; } = false;
}
}
8 changes: 8 additions & 0 deletions test/Tests.Infrastructure/GraphSon/Entities/Bug_1884_Enum.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace ExRam.Gremlinq.Tests.Infrastructure.GraphSon.Entities
{
public enum Bug_1884_Enum
{
ValueA,
ValueB
}
}
7 changes: 7 additions & 0 deletions test/Tests.Infrastructure/GraphSon/Entities/ClassWithField.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace ExRam.Gremlinq.Tests.Infrastructure.GraphSon.Entities
{
public class ClassWithField
{
public string? Property;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace ExRam.Gremlinq.Tests.Infrastructure.GraphSon.Entities
{
public class ClassWithFieldsAndConstructor
{
public ClassWithFieldsAndConstructor(string stringArg, string? nullableStringArg, int intArg, int? nullableIntArg)
{
StringArg = stringArg;
NullableStringArg = nullableStringArg;
IntArg = intArg;
NullableIntArg = nullableIntArg;
}

public string StringArg { get; }
public string? NullableStringArg { get; }
public int IntArg { get; }
public int? NullableIntArg { get; }

public string? SettableString { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace ExRam.Gremlinq.Tests.Infrastructure.GraphSon.Entities
{
public class ClassWithInitProperty
{
public string? Property { get; init; }
}
}
52 changes: 1 addition & 51 deletions test/Tests.Infrastructure/GraphSon/GraphsonSupportTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,60 +9,10 @@
using System.Collections.Immutable;
using System.Collections.Concurrent;
using System.Collections;
using ExRam.Gremlinq.Tests.Infrastructure.GraphSon.Entities;

namespace ExRam.Gremlinq.Tests.Infrastructure
{
public class ClassWithInitProperty
{
public string? Property { get; init; }
}

public class ClassWithField
{
public string? Property;
}

public class ClassWithFieldsAndConstructor
{
public ClassWithFieldsAndConstructor(string stringArg, string? nullableStringArg, int intArg, int? nullableIntArg)
{
StringArg = stringArg;
NullableStringArg = nullableStringArg;
IntArg = intArg;
NullableIntArg = nullableIntArg;
}

public string StringArg { get; }
public string? NullableStringArg { get; }
public int IntArg { get; }
public int? NullableIntArg { get; }

public string? SettableString { get; set; }
}

public enum Bug_1884_Enum
{
ValueA,
ValueB
}

public class Bug_1884_Entity
{
public Bug_1884_Entity()
{
MyEnum1 = Bug_1884_Enum.ValueB;
}

// this default value is overwritten during deserialization (as expected)
public DateTime CreatedAt { get; set; } = TimeProvider.System.GetUtcNow().DateTime.Date;

// after deserialization, the value of this property is always ValueB (bug)
public Bug_1884_Enum MyEnum1 { get; set; }

// after deserialization the value of this property is always false (bug)
public bool IsDeleted { get; set; } = false;
}

public abstract class GraphsonSupportTestBase<TNativeToken> : VerifyBase
{
protected readonly IGremlinQueryEnvironment _environment;
Expand Down

0 comments on commit f893d6e

Please sign in to comment.