-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
expose change and object types on config
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using SIL.Harmony.Sample.Changes; | ||
using SIL.Harmony.Sample.Models; | ||
using SIL.Harmony.Tests.Adapter; | ||
|
||
namespace SIL.Harmony.Tests; | ||
|
||
public class ConfigTests | ||
{ | ||
[Fact] | ||
public void CanGetEntityTypes() | ||
{ | ||
var config = new CrdtConfig(); | ||
config.ObjectTypeListBuilder.DefaultAdapter() | ||
.Add<Word>() | ||
.Add<Definition>(); | ||
config.ObjectTypeListBuilder | ||
.CustomAdapter<CustomObjectAdapterTests.IMyCustomInterface, CustomObjectAdapterTests.MyClassAdapter>() | ||
.Add<CustomObjectAdapterTests.MyClass>(); | ||
var types = config.ObjectTypes.ToArray(); | ||
types.Should().BeEquivalentTo([typeof(Word), typeof(Definition), typeof(CustomObjectAdapterTests.MyClass)]); | ||
} | ||
|
||
[Fact] | ||
public void CanGetChangeTypes() | ||
{ | ||
var config = new CrdtConfig(); | ||
config.ChangeTypeListBuilder.Add<NewDefinitionChange>(); | ||
config.ChangeTypeListBuilder.Add<SetWordTextChange>(); | ||
var types = config.ChangeTypes.ToArray(); | ||
types.Should().BeEquivalentTo([typeof(NewDefinitionChange), typeof(SetWordTextChange)]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters