1) What is the difference between
using NUnit.Framework;
and
using Microsoft.VisualStudio.TestTools.UnitTesting;
I had a problem running my tests. I create a new project in VS 2010 (File -> New Project -> Visual C # -> Test, and Visual Studio automatically creates some code for me:
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace TestProject1
{
[TestClass]
public class UnitTest1
{
public UnitTest1()
{
}
private TestContext testContextInstance;
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#region Additional test attributes
#endregion
[TestMethod]
public void TestMethod1()
{
}
}
}
I record my test using the Selenium IDE and I get:
using System;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using NUnit.Framework;
using Selenium;
namespace SeleniumTests
{
[TestFixture]
public class Untitled2
{
private ISelenium selenium;
private StringBuilder verificationErrors;
[SetUp]
public void SetupTest()
{
selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://localhost/km/pldefault.aspx");
selenium.Start();
verificationErrors = new StringBuilder();
}
[TearDown]
public void TeardownTest()
{
try
{
selenium.Stop();
}
catch (Exception)
{
}
Assert.AreEqual("", verificationErrors.ToString());
}
[Test]
public void TheUntitled2Test()
{
}
}
}
I am really confused when I combine these two.
Maya source
share