using Perforce.P4;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
namespace p4api.net.unit.test
{
///
///This is a test class for FixTest and is intended
///to contain all FixTest Unit Tests
///
[TestClass()]
public class FixTest
{
private TestContext testContextInstance;
///
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#region Additional test attributes
//
//You can use the following additional attributes as you write your tests:
//
//Use ClassInitialize to run code before running the first test in the class
//[ClassInitialize()]
//public static void MyClassInitialize(TestContext testContext)
//{
//}
//
//Use ClassCleanup to run code after all tests in a class have run
//[ClassCleanup()]
//public static void MyClassCleanup()
//{
//}
//
//Use TestInitialize to run code before running each test
//[TestInitialize()]
//public void MyTestInitialize()
//{
//}
//
//Use TestCleanup to run code after each test has run
//[TestCleanup()]
//public void MyTestCleanup()
//{
//}
//
#endregion
///
///A test for Action
///
[TestMethod()]
public void ActionTest()
{
Fix target = new Fix("job000001", 4, new DateTime(2011, 02, 04), "client_name", "user_name", "open", FixAction.Unfixed);
FixAction expected = FixAction.Unfixed;
FixAction actual = target.Action;
Assert.AreEqual(expected, actual);
}
/////
/////A test for ChangelistId
/////
[TestMethod()]
public void ChangelistIdTest()
{
Fix target = new Fix("job000001", 4, new DateTime(2011, 02, 04), "client_name", "user_name", "open", FixAction.Unfixed);
int expected = 4;
int actual = target.ChangeId;
Assert.AreEqual(expected, actual);
}
/////
/////A test for ClientName
/////
[TestMethod()]
public void ClientNameTest()
{
Fix target = new Fix("job000001", 4, new DateTime(2011, 02, 04), "client_name", "user_name", "open", FixAction.Unfixed);
string expected = "client_name";
string actual = target.ClientName;
Assert.AreEqual(expected, actual);
}
/////
/////A test for Date
/////
[TestMethod()]
public void DateTest()
{
Fix target = new Fix("job000001", 4, new DateTime(2011, 02, 04), "client_name", "user_name", "open", FixAction.Unfixed);
DateTime expected = new DateTime(2011, 02, 04);
DateTime actual = target.Date;
Assert.AreEqual(expected, actual);
}
/////
/////A test for JobId
/////
[TestMethod()]
public void JobIdTest()
{
Fix target = new Fix("job000001", 4, new DateTime(2011, 02, 04), "client_name", "user_name", "open", FixAction.Unfixed);
string expected = "job000001";
string actual = target.JobId;
Assert.AreEqual(expected, actual);
}
/////
/////A test for Status
/////
[TestMethod()]
public void StatusTest()
{
Fix target = new Fix("job000001", 4, new DateTime(2011,02,04), "client_name", "user_name", "open", FixAction.Unfixed);
string expected = "open";
string actual = target.Status;
Assert.AreEqual(expected, actual);
}
/////
/////A test for UserName
/////
[TestMethod()]
public void UserNameTest()
{
Fix target = new Fix("job000001", 4, new DateTime(2011, 02, 04), "client_name", "user_name", "open", FixAction.Unfixed);
string expected = "user_name";
string actual = target.UserName;
Assert.AreEqual(expected, actual);
}
}
}