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

Idea (NUnit, XUnit migration) #198

Open
amirrajan opened this issue Jul 27, 2017 · 2 comments
Open

Idea (NUnit, XUnit migration) #198

amirrajan opened this issue Jul 27, 2017 · 2 comments

Comments

@amirrajan
Copy link
Collaborator

amirrajan commented Jul 27, 2017

Would be cool if you could do:

//somwhere inside of a custom Program.cs that references both NUnit and NSpec

var builder = nspecThingy.TestFinder(someAssembly, (methodInfo) => 
{
    if (nspecThingy.ContainsAttribute<Setup>(methodInfo))
    {
	return nspecThingy.Before();
    }
    
    if (nspecThingy.ContainsAttribute<TestMethod>(methodInfo))
    {
	return nspecThingy.Context("NUnit Method: " + methodInfo.Name);
    }
    
    if (nspecThingy.ContainsAttribute<TearDown>(methodInfo))
    {
	return nspecThingy.After();
    }
    
    return nspecThingy.Skip();
});

specRunner.run(builder, builder2, builder3);
@amirrajan
Copy link
Collaborator Author

@BrainCrumbz, thoughts? ^

@BrainCrumbz
Copy link
Collaborator

That looks quite like some kind of adapter from NUnit to NSpec 😺 . Might be interesting.

Going from the top of my head, are those the only test attributes we should look for within NUnit? Looking at doc page, there might some more to look at: TestFixture, Test. And when pushing forward with adaptation: OneTimeSetUp, OneTimeTearDown, SetUpFixture, TearDownFixture. Then theories as well, to somehow map them to parameterized tests.

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

No branches or pull requests

2 participants