|
using CommonData;
using CommonUtilities;
using HiveStudios.EventBroker;
using Interfaces;
using Map;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace MapUnitTest
{
/// <summary>
///This is a test class for MapModelTest and is intended
///to contain all MapModelTest Unit Tests
///</summary>
[TestClass()]
public class MapModelTest
{
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 MapModel Constructor
///</summary>
[TestMethod()]
[DeploymentItem("Map.dll")]
public void MapModelConstructorTest()
{
MapModel_Accessor target = new MapModel_Accessor(new CommonThreadsManager());
Assert.IsNotNull(target.MapData);
Assert.IsTrue(EventBroker.ExecutionMethods.Contains(CommonEventsMessages.MapThreadStarted));
Assert.IsTrue(EventBroker.ExecutionMethods.Contains(CommonEventsMessages.MapThreadStopped));
Assert.IsTrue(EventBroker.ExecutionMethods.Contains(CommonEventsMessages.UpdateMapData));
}
/// <summary>
///A test for ThreadStarted
///</summary>
[TestMethod()]
[DeploymentItem("Map.dll")]
public void ThreadStartedTest()
{
MapModel_Accessor target = new MapModel_Accessor(new CommonThreadsManager());
object sender = null;
GlobalEventEventArgs e = new GlobalEventEventArgs(new ThreadsCreateData());
target.ThreadStarted(sender, e);
}
/// <summary>
///A test for ThreadStopped
///</summary>
[TestMethod()]
[DeploymentItem("Map.dll")]
public void ThreadStoppedTest()
{
MapModel_Accessor target = new MapModel_Accessor(new CommonThreadsManager());
object sender = null;
GlobalEventEventArgs e = new GlobalEventEventArgs(new ThreadsCreateData());
target.ThreadStopped(sender, e);
}
/// <summary>
///A test for UpdateData
///</summary>
[TestMethod()]
[DeploymentItem("Map.dll")]
public void UpdateDataTest()
{
MapModel_Accessor target = new MapModel_Accessor(new CommonThreadsManager());
object sender = null;
GlobalEventEventArgs e = new GlobalEventEventArgs(new MapData());
target.UpdateData(sender, e);
}
/// <summary>
///A test for MapData
///</summary>
[TestMethod()]
public void MapDataTest()
{
MapModel target = new MapModel(new CommonThreadsManager()); // TODO: Initialize to an appropriate value
IMapData expected = new MapData("Map Init", "00:00:00"); // TODO: Initialize to an appropriate value
IMapData actual;
target.MapData = expected;
actual = target.MapData;
Assert.AreEqual(expected, actual);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Project Manager and Application Developer, in a wide variety of business applications. Particularly interested in client/server and Graphical User Interface design using Visual C#.
Specialties: 13 Y'rs in C#, 10 Y'rs experience in C++ Highly experienced in wide technologies, IT projects, military projects etc'.