-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add T Create(Guid) to ILcmFactory<T> (#313)
* expose data reader via Cache.InternalServices.DataReader * declare new method ILcmFactory<T>.Create(Guid guid) implement via code generation remove ICmPicture Create method * change behavior when guid is empty * add a test ensuring LexEntryTypes can be created with a guid --------- Co-authored-by: Jake Oliver <jeoliver97@gmail.com>
- Loading branch information
1 parent
80c9d96
commit 2820554
Showing
8 changed files
with
60 additions
and
19 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
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
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
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
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
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
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
20 changes: 20 additions & 0 deletions
20
tests/SIL.LCModel.Tests/Infrastructure/Impl/LexEntryTypeTests.cs
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,20 @@ | ||
using System; | ||
using System.Linq; | ||
using NUnit.Framework; | ||
|
||
namespace SIL.LCModel.Infrastructure.Impl | ||
{ | ||
public class LexEntryTypeTests: MemoryOnlyBackendProviderRestoredForEachTestTestBase | ||
{ | ||
[Test] | ||
public void CreateTypeWithGuid_CanAddToList() | ||
{ | ||
var guid = Guid.NewGuid(); | ||
var lexEntryType = Cache.ServiceLocator.GetInstance<ILexEntryTypeFactory>().Create(guid); | ||
|
||
Cache.LangProject.LexDbOA.ComplexEntryTypesOA.PossibilitiesOS.Add(lexEntryType); | ||
|
||
Assert.That(Cache.ServiceLocator.ObjectRepository.GetObject(guid), Is.EqualTo(lexEntryType)); | ||
} | ||
} | ||
} |