Skip to content

Instantly share code, notes, and snippets.

@JonathonRichardson
Created November 4, 2022 17:24
Show Gist options
  • Save JonathonRichardson/1bc38d239f445c725e2ffd79b3b3b885 to your computer and use it in GitHub Desktop.
Save JonathonRichardson/1bc38d239f445c725e2ffd79b3b3b885 to your computer and use it in GitHub Desktop.
Exposing internals of a CS project to a test project
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("MCV.Lobos.Services.Database.Tests")]
/**
* Allow dynamically generated proxy types to access internals. For details see
* https://stackoverflow.com/questions/17569746/mocking-internal-classes-with-moq-for-unit-testing/17574183#17574183
*/
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
namespace MCV.Lobos.Services.Database
{
/*
* This class only exists to expose the internals of this project to the test
* runner.
*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment