SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Equivalent to "Unit Test Project"?

Last post 03-21-2017 9:54 PM by MattWard. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-15-2017 1:42 PM

    Equivalent to "Unit Test Project"?

    Normal 0 21 false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Normal tabell"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:0cm; mso-para-margin-right:0cm; mso-para-margin-bottom:8.0pt; mso-para-margin-left:0cm; line-height:107%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri",sans-serif; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-ansi-language:EN-US; mso-fareast-language:EN-US;}

    I'm trying to setup a test framework in Sharpdevelop and there's this guide but the creator is using Visual Studio. He first creates a C# Class Library and names it WordpressAutomation, I assume the equivalent in Sharpdevelop is "Class Library", then he creates a "Test Project" in Visual Studio and names it "WordpressTests"..

    In the Automation project he references the Selenium packages (used to command browsers in testing), and in the test project he references the framework, looking like this:

    -- WordpressAutomation --

    namespaceWordpressAutomation

    {

                                 public class Class1

                                 {

                                                              public void Go()

                                                              {

                                                                                           var driver = new FirefoxDriver();

                                                                                           driver.Navigate().GoToUrl("http://www.google.com");

                                                              }

                                 }

    }

    -- WordpressTests --

    using Microsoft.VisualStudio.TestTools.UnitTesting;

    using WordpressAutomation;

    namespace WordpressTests

    {

                                 [TestClass]

                                 public class UnitTest1

                                 {

                                                              [TestMethod]

                                                              public void TestMethod()

                                                              {

                                                                                           var c = new Class1();

                                                                                           c.Go();

                                                              }

                                 }

    }

    However, when trying to do the same I'm not sure what to use.Is there an equivalent to "Unit Test Project"? I tried using an empty project, and then going from there but it gives me the "CS5001 - does not contain a static 'Main' method suitable for an entry point" error. What am I missing?

    Also, is the NUnit framework a good alternative to Visual Studio's
    TestTools?

     

    Filed under:
  • 03-21-2017 9:54 PM In reply to

    Re: Equivalent to "Unit Test Project"?

    NUnit is a good alternative to use in SharpDevelop. Create a class library project and then add a reference to NUnit.Framework. If you add a new Unit Test file from the new file dialog it should add a NUnit.Framework reference for you.

Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.