Skip to content

Commit

Permalink
add test for mcintyre321#174
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanLochauMF committed Jun 24, 2024
1 parent 2a60ba1 commit d546b18
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions OneOf.SourceGenerator.Tests/SourceGeneratorTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using OneOf;
using Xunit;

namespace OneOf.SourceGenerator.Tests
Expand Down Expand Up @@ -129,6 +130,13 @@ public void GenerateOneOf_Works_With_Open_And_Closed_Generics()
OpenGenericWithClosed<MyClass2> openWithClosed2 = new MyClass();
Assert.True(openWithClosed2.IsT1);
}

[Fact]
public void GenerateOneOf_Works_WithTypesFromOneOfNameSpace()
{
DifferentLibrary.OneOf.JustLibraryClass justLibraryClass = new DifferentLibrary.OneOf.LibraryClass();
Assert.True(justLibraryClass.IsT0);
}
}

[GenerateOneOf]
Expand Down Expand Up @@ -184,3 +192,15 @@ public class OneOf

}
}

namespace DifferentLibrary.OneOf
{
public class LibraryClass
{
}

[GenerateOneOf]
public partial class JustLibraryClass : OneOfBase<LibraryClass>
{
}
}

0 comments on commit d546b18

Please sign in to comment.