-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
3 - M (<= 1 month)
-
1694
<!--- Questions: If you have questions about how to use Realm, please ask on -->
<!--- StackOverflow: http://stackoverflow.com/questions/ask?tags=realm -->
<!--- We monitor the realm tag. -->
<!--- Feature Request: Just fill in the first two sections below. -->
<!--- Bugs: To help you as fast as possible with an issue please describe your issue -->
<!--- and the steps you have taken to reproduce it in as much detail as possible. -->
<Unable to render embedded object: File (--- Thanks for helping us help you) not found. -->
Goals
<!--- What are you trying to achieve? -->
I wanted to unit test my .NET Standard 2.0 library containing the latest Realm Nuget package with the Realm being initiated using a filename and some simple models to fill the database with using Visual Studio 2017's Live Testing feature on it's default settings.
Expected Results
<!--- What did you expect to happen? -->
The same results as a manual unit test (using test explorer), that it just works to initiate the realm instance, also when using live unit testing.
Actual Results
<!--- What happened instead? -->
<!--- e.g. the stack trace of a crash -->
see this image for the problem
manual testing works
Steps to Reproduce
<!--- What are steps we can follow to reproduce this issue? -->
- Create solution with two projects: one .NET Standard library project and one .NET Core 2.0 MSTEST project.
- In the library create a class that initiates the Realm instance (in the constructor).
- Create a few models within the library
- Write a test that has to create an object of the class that initiates the Realm instance.
- Turn on Live Testing
6 ...
7 Fail
Code Sample
<!--- Please provide a code sample or test case that highlights the issue. -->
<!--- If relevant, include your model definitions. -->
<!--- For larger code samples, links to external gists/repositories are preferred. -->
<!--- Alternatively, you can share information confidentially via email at help@realm.io. -->
<Unable to render embedded object: File (--- Full projects that we can compile and run ourselves are ideal) not found. -->
Library project
public class Database
{
private Realm _realm;
public Database ()
}
public class FancyModel : RealmObject
{
[PrimaryKey]
public int ID
public string name {get; set;}
}
Test project
public void DatabaseManagerInitiatesRealmObject()
{
PrivateObject databaseManager = new PrivateObject(oftype(DatabaseManager));
Assert.IsNotNull(databseManager.GetField("_realm");
}
Version of Realm and Tooling
All is done locally with te latest versions of the tooling