ReSharper UnitRun (feed add-in unit-test software)

来源:互联网 发布:模拟植物生长算法 编辑:程序博客网 时间:2024/05/18 17:41

ReSharper UnitRun is a free add-in for Microsoft Visual Studio 2005 that allows you to automatically run and profile unit tests.

1)Download ReSharper UnitRun from the link below :

          http://www.jetbrains.com/unitrun/download/index.html         

2)Get a free license,

          http://www.jetbrains.com/unitrun/download/registration.html

3)Install the software

       After installed the software, restart your vs2005.A Register window form will appear in the dotnet.Skip it.The another window form ask you enther the user name and key,input your license.Then press submit.

4)Download NUnit or csUnit

ReSharper UnitRun must be used together with NUint or csUnit.

you can get them from the link below:

http://sourceforge.net/

5)Install NUnit

6)Create a project for Test

       A:Create a project with name of "NUnitTest";

       B:Add reference NUnit.framework (NUnit setup path/bin/nunit.framework.dll)

       C:Create a "NumberFixture",

using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;

namespace NUnitTest
{
    [TestFixture]
        public class NumbersFixture
        {
        [Test]
            public void AddTwoNumbers()
            {
                Int32 a = 1;
                Int32 b = 2;
                Int32 sum = a + b;
                Assert.AreEqual(sum, 2);

            }
        }
}

7)Change property of the project NUnitTest

       A.Click "VS2005-Project-Property";

       B.Change:Start Action--Start external program: NUnit setup path + "/bin/nunit-gui.exe"

8)Debug this project.

9)Start NUnit

       A.Open Project: "File-Open project", select "NUnitTest.dll" from Server.Mappath("bin") ;

       B.Click "Run".

If the processbar is green,ok.Red bar means that there are somemistaks.yellow means?sorry, i don't remember.

10)Restart VS2005,you will see a green tag on the left of code area.

11)Click the Tag image

原创粉丝点击