Skip to content

Commit

Permalink
fix: add private does not obscure test
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyMakkison committed Jul 11, 2023
1 parent ff51d7d commit de10dc1
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/Riok.Mapperly.Tests/Mapping/ObjectPropertyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,29 @@ public Task WithPrivateTargetPathGetterShouldIgnoreAndDiagnostic()
return TestHelper.VerifyGenerator(source);
}

[Fact]
public void PrivateMemberPropertyShouldNotOverride()
{
var source = TestSourceBuilder.Mapping(
"A",
"B",
"class A { private int MyValue { get; set; } public C My { get; set; } }",
"class B { public int MyValue { get; set; } }",
"class C { public int Value { get; set; } }"
);

TestHelper
.GenerateMapper(source)
.Should()
.HaveMapMethodBody(
"""
var target = new global::B();
target.MyValue = source.My.Value;
return target;
"""
);
}

[Fact]
public Task WithPrivateSourceGetterShouldIgnoreAndDiagnostic()
{
Expand Down

0 comments on commit de10dc1

Please sign in to comment.