using Perforce.P4; using Microsoft.VisualStudio.TestTools.UnitTesting; using System; namespace p4api.net.unit.test { /// <summary> ///This is a test class for FixTest and is intended ///to contain all FixTest Unit Tests ///</summary> [TestClass()] public class FixTest { private TestContext testContextInstance; /// <summary> ///Gets or sets the test context which provides ///information about and functionality for the current test run. ///</summary> 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 /// <summary> ///A test for Action ///</summary> [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); } ///// <summary> /////A test for ChangelistId /////</summary> [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); } ///// <summary> /////A test for ClientName /////</summary> [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); } ///// <summary> /////A test for Date /////</summary> [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); } ///// <summary> /////A test for JobId /////</summary> [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); } ///// <summary> /////A test for Status /////</summary> [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); } ///// <summary> /////A test for UserName /////</summary> [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); } } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 19284 | ava | "Forking branch Main of perforce-software-p4connect to ava-p4connect." | ||
//guest/perforce_software/p4connect/main/src/P4Bridge/p4api.net-unit-test/FixTest.cs | |||||
#1 | 16209 | Norman Morse | Move entire source tree into "main" branch so workshop code will act correctly. | ||
//guest/perforce_software/p4connect/src/P4Bridge/p4api.net-unit-test/FixTest.cs | |||||
#1 | 10940 | Norman Morse |
Inital Workshop release of P4Connect. Released under BSD-2 license |