Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[no-merge] Add unit tests for Issue389 #392

Closed
wants to merge 1 commit into from
Closed

Conversation

ericnewton76
Copy link
Member

@ericnewton76 ericnewton76 commented Jan 18, 2019

This tries to address #389

Note, this PR may never get merged.

@ericnewton76 ericnewton76 changed the base branch from master to develop January 18, 2019 04:19
@ericnewton76 ericnewton76 changed the title Fix for issue 389 [no-merge] Add unit tests for Issue389 Jan 23, 2019
@moh-hassan
Copy link
Collaborator

moh-hassan commented Mar 13, 2019

The resolve this issue , the test class should reference the next class:

	 public class BaseTest
		{
			public BaseTest()  
			{  
				//in case multi target project,use #if because no appdomain in netcore
	#if NETFRAMEWORK
			  
				var assembly = Assembly.GetCallingAssembly();  

				var manager = new AppDomainManager();  
				var entryAssemblyfield = manager.GetType().GetField("m_entryAssembly", BindingFlags.Instance | BindingFlags.NonPublic);  
				entryAssemblyfield?.SetValue(manager, assembly); 

				var domain = AppDomain.CurrentDomain;  
				var domainManagerField = domain.GetType().GetField("_domainManager", BindingFlags.Instance | BindingFlags.NonPublic);  
				domainManagerField?.SetValue(domain, manager);  
				
	#endif
			} 
		}

Then test class inherit BaseTest:

      public class Issue389_Tests: BaseTest
   {
      //test stuff
      }

The solution is tested for the same issue#389 here

@moh-hassan
Copy link
Collaborator

The test case is involved and Pass in PR 389 in both net461 and netcoreapp2.0 after resolving the null EntryAssemply problems

@moh-hassan
Copy link
Collaborator

@ericnewton76
It's added and merged to PR #430

@moh-hassan moh-hassan closed this Apr 27, 2019
@moh-hassan moh-hassan mentioned this pull request Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants