Simple NUnit test doesn't run

Hi,

I am following this simple NUnit example, but it give me an error when I run it. "A project with an Output Type of Class Library cannot be started directly."
0.JPG
In the example, I created 2 projects(both are Class Library type) with a class on each project. The structure of the solution and project references look like this.
2.JPG
And this is the code I have for TellerTests.cs
3.JPG
It seems that I need a normal class that has a Main method. But I am not sure, the author brought up this screen. I don't know how.
4.JPG
I am using Visual Studio 2012 Ultimate version.

Thanks
IzzyTwinklyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Fernando SotoRetiredCommented:
Try setting the start up project to be BankManager.Test and not BankManager.
0
käµfm³d 👽Commented:
Are you using F5 to try and run your tests? If so, you shouldn't be. NUnit should have a menu option to start tests. You shouldn't need to actually start your application in order to be able run your unit tests.
0
IzzyTwinklyAuthor Commented:
Hi Kaufmed, I am using Visual Studio2012 and where can I find that Nunit menu?

Hi Fremando, I made BankManager.Test as a start up project, but nothing happened. Should I create BankManger.Test project, should I create this as "Coded UI Test Project" or "Unit TestProject"? However, the author clearly said to create it as class library. =(
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

käµfm³d 👽Commented:
Have you installed the Visual Studio Test Adapter already? I *think* older versions of NUnit had a separate window to run unit tests...at least that what I remember seeing...but now they are run via the Test Explorer window that Visual Studio provides. Installing the Test Adapter should expose this to you:

 Screenshot
Once you build your project/solution, the tests should show in the Test Explorer.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Fernando SotoRetiredCommented:
0
IzzyTwinklyAuthor Commented:
That was it! I had to install "Visual Studio Test Adapter". In my case, Test Explorer itself was there, but the test method wasn't appeared under Test Explorer. Now it appears after I installed "Visual Studio Test Adapter".
Thank you so much! I just passed my first unit test!!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.