Skip to content

Commit d81dd31

Browse files
committed
Add failing test that repros #75
1 parent ab50ee2 commit d81dd31

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

src/ImmutableObjectGraph.Generation.Tests/CodeGenTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ public async Task NoFieldsAndOneScalarFieldDerived_HasCreateMethod()
6868
Assert.Equal(1, result.DeclaredMethods.Count(m => m.ContainingType.Name == "NotSoEmptyDerived" && m.Name == "Create" && m.Parameters.Length == 1 && m.IsStatic));
6969
}
7070

71+
[Fact]
72+
public async Task ByteArray_CanBuild()
73+
{
74+
var result = await this.GenerateFromStreamAsync("ByteArray");
75+
}
76+
7177
[Fact]
7278
public async Task OneScalarFieldAndEmptyDerived_HasCreateMethod()
7379
{

src/ImmutableObjectGraph.Generation.Tests/ImmutableObjectGraph.Generation.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
<Compile Include="TestSources\AbstractClassMidTypeHierarchyWithRequiredField.cs">
5858
<Generator>MSBuild:GenerateCodeFromAttributes</Generator>
5959
</Compile>
60+
<EmbeddedResource Include="TestSources\ByteArray.cs" />
6061
<Compile Include="TestSources\Generations.cs">
6162
<Generator>MSBuild:GenerateCodeFromAttributes</Generator>
6263
</Compile>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace ImmutableObjectGraph.Generation.Tests.TestSources
2+
{
3+
[GenerateImmutable]
4+
partial class ByteArray
5+
{
6+
readonly byte[] secret;
7+
}
8+
}

0 commit comments

Comments
 (0)