Testura.Code.UnitTestGenerator is a simple framework/tool to inspect assemblies and generate unit tests from exported types. It's created as a simple example on how you can use Testura.Code
https://github.com/Testura/Testura.Code.UnitTestGenerator/releases
- MsTest
- NUnit
- Moq
- A unit test file for all types that are exported and isn't static or abstract
- A setUp that initialize the type under test (TuT) by looking at it's first constructor.
- All required parameters will either be mocked, initialized or set to some default value.
- Will generate fields for TuT and required parameters
- All files created will follw your assembly namespace/directory strcture.
varunitTestGenerator=newUnitTestGenerator();unitTestGenerator.GenerateUnitTests(DllPath,TestFrameworks.NUnit,MockFrameworks.Moq,OutputDirectory);namespaceTestura.Android.Device.Services.Default{publicclassUiService{publicUiService(IScreenDumperscreenDumper,SomeClasssomeClass,stringmyString,intnumber){}}}namespaceTestura.Android.Tests.Device.Services.Default{[TestFixture]publicclassUiServiceTest{privateMock<IScreenDumper>screenDumperMock;privateSomeClasssomeClass;privateUIServiceuiService;[SetUp]publicSetUp(){screenDumperMock=newMock<IScreenDumper>();uiService=newUiService(screenDumperMock.Object,someClass,string.Empty,0)}}}
