I'm trying to do Selenium webdriver test automation through C#. I wanted to basically understand how NUnit works. I've the following code in VS
namespace SeleniumCHash
{
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using System;
using NUnit.Framework;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
[TestFixture]
public class StartUpClassCopy
{
[SetUp]
public void Initialize() {
Console.WriteLine("hi");
}
[Test]
public void LoginCheckCopy()
{
Console.WriteLine("hiTest");
}
[TearDown]
public void EndTest()
{
Console.WriteLine("hiTear");
}
}
}
When I execute this through Test Explorer, the following is the output.
[12/4/2018 7:12:46 AM Informational] ------ Discover test started ------
[12/4/2018 7:12:49 AM Warning] No test is available in C:\Users\XXXX\Source\Repos\SeleniumCHash\SeleniumCHash\SeleniumCHash.csproj. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
[12/4/2018 7:12:49 AM Informational] ========== Discover test finished: 0 found (0:00:03.4464214) ==========
[12/4/2018 7:13:04 AM Informational] ------ Run test started ------
[12/4/2018 7:13:05 AM Informational] NUnit Adapter 3.11.2.0: Test execution started
[12/4/2018 7:13:05 AM Informational] Running selected tests in C:\Users\XXXX\Source\Repos\SeleniumCHash\SeleniumCHash\bin\Debug\SeleniumCHash.exe
[12/4/2018 7:13:06 AM Informational] NUnit3TestExecutor converted 2 of 2 NUnit test cases
[12/4/2018 7:13:06 AM Informational] NUnit Adapter 3.11.2.0: Test execution complete
[12/4/2018 7:13:06 AM Informational] ========== Run test finished: 1 run (0:00:02.0547664) ==========
I'm actually expecting the console to display this in the console.
hi
hiTest
hiTear