Skip to content

Commit

Permalink
add test for migrationhash codefix on records
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianAuinger committed Sep 28, 2023
1 parent 0b0abee commit d63aa7b
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,32 @@ record TypeName
VerifyCSharpFix(source, expected);
}

[Fact]
public void ShouldFixRecordWithPrimaryCtorIfInCorrectIsSpecified()
{
var source = @"
using Weingartner.Json.Migration;
using System.Runtime.Serialization;
[Migratable(""758832573"")]
[DataContract]
record TypeName([property: DataMember] int A, [property: DataMember] double B)
{
}";

var expected = @"
using Weingartner.Json.Migration;
using System.Runtime.Serialization;
[Migratable(""687340935"")]
[DataContract]
record TypeName([property: DataMember] int A, [property: DataMember] double B)
{
}";

VerifyCSharpFix(source, expected);
}


protected override CodeFixProvider GetCSharpCodeFixProvider()
{
Expand Down

0 comments on commit d63aa7b

Please sign in to comment.