PageRenderTime 25ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/Branches/PostBeta1Work/SharpMap.Rendering.Wpf.Test/VectorRendererTest.cs

#
C# | 252 lines | 169 code | 18 blank | 65 comment | 0 complexity | 2446118e8d52c3a46004f0e8cc88e03d MD5 | raw file
  1. using SharpMap.Wpf.Rendering;
  2. using Microsoft.VisualStudio.TestTools.UnitTesting;
  3. using SharpMap.Rendering.Rendering2D;
  4. using System.Windows.Media;
  5. using System.Collections.Generic;
  6. using SharpMap.Styles;
  7. using SharpMap.Rendering;
  8. namespace SharpMap.Rendering.Wpf.Test
  9. {
  10. /// <summary>
  11. ///This is a test class for VectorRendererTest and is intended
  12. ///to contain all VectorRendererTest Unit Tests
  13. ///</summary>
  14. [TestClass()]
  15. public class VectorRendererTest
  16. {
  17. private TestContext testContextInstance;
  18. /// <summary>
  19. ///Gets or sets the test context which provides
  20. ///information about and functionality for the current test run.
  21. ///</summary>
  22. public TestContext TestContext
  23. {
  24. get
  25. {
  26. return testContextInstance;
  27. }
  28. set
  29. {
  30. testContextInstance = value;
  31. }
  32. }
  33. #region Additional test attributes
  34. //
  35. //You can use the following additional attributes as you write your tests:
  36. //
  37. //Use ClassInitialize to run code before running the first test in the class
  38. //[ClassInitialize()]
  39. //public static void MyClassInitialize(TestContext testContext)
  40. //{
  41. //}
  42. //
  43. //Use ClassCleanup to run code after all tests in a class have run
  44. //[ClassCleanup()]
  45. //public static void MyClassCleanup()
  46. //{
  47. //}
  48. //
  49. //Use TestInitialize to run code before running each test
  50. //[TestInitialize()]
  51. //public void MyTestInitialize()
  52. //{
  53. //}
  54. //
  55. //Use TestCleanup to run code after each test has run
  56. //[TestCleanup()]
  57. //public void MyTestCleanup()
  58. //{
  59. //}
  60. //
  61. #endregion
  62. /// <summary>
  63. ///A test for TryGetCache
  64. ///</summary>
  65. [TestMethod()]
  66. [DeploymentItem("SharpMap.Rendering.Wpf.dll")]
  67. public void TryGetCacheTest()
  68. {
  69. VectorRenderer_Accessor target = new VectorRenderer_Accessor(); // TODO: Initialize to an appropriate value
  70. Path2D path = null; // TODO: Initialize to an appropriate value
  71. StreamGeometry pathCache = null; // TODO: Initialize to an appropriate value
  72. StreamGeometry pathCacheExpected = null; // TODO: Initialize to an appropriate value
  73. bool expected = false; // TODO: Initialize to an appropriate value
  74. bool actual;
  75. actual = target.TryGetCache(path, out pathCache);
  76. Assert.AreEqual(pathCacheExpected, pathCache);
  77. Assert.AreEqual(expected, actual);
  78. Assert.Inconclusive("Verify the correctness of this test method.");
  79. }
  80. /// <summary>
  81. ///A test for RenderSymbols
  82. ///</summary>
  83. [TestMethod()]
  84. public void RenderSymbolsTest2()
  85. {
  86. VectorRenderer target = new VectorRenderer(); // TODO: Initialize to an appropriate value
  87. IEnumerable<Point2D> locations = null; // TODO: Initialize to an appropriate value
  88. Symbol2D symbolData = null; // TODO: Initialize to an appropriate value
  89. RenderState renderState = new RenderState(); // TODO: Initialize to an appropriate value
  90. IEnumerable<Drawing> expected = null; // TODO: Initialize to an appropriate value
  91. IEnumerable<Drawing> actual;
  92. actual = target.RenderSymbols(locations, symbolData, renderState);
  93. Assert.AreEqual(expected, actual);
  94. Assert.Inconclusive("Verify the correctness of this test method.");
  95. }
  96. /// <summary>
  97. ///A test for RenderSymbols
  98. ///</summary>
  99. [TestMethod()]
  100. public void RenderSymbolsTest1()
  101. {
  102. VectorRenderer target = new VectorRenderer(); // TODO: Initialize to an appropriate value
  103. IEnumerable<Point2D> locations = null; // TODO: Initialize to an appropriate value
  104. Symbol2D symbol = null; // TODO: Initialize to an appropriate value
  105. Symbol2D highlightSymbol = null; // TODO: Initialize to an appropriate value
  106. Symbol2D selectSymbol = null; // TODO: Initialize to an appropriate value
  107. RenderState renderState = new RenderState(); // TODO: Initialize to an appropriate value
  108. IEnumerable<Drawing> expected = null; // TODO: Initialize to an appropriate value
  109. IEnumerable<Drawing> actual;
  110. actual = target.RenderSymbols(locations, symbol, highlightSymbol, selectSymbol, renderState);
  111. Assert.AreEqual(expected, actual);
  112. Assert.Inconclusive("Verify the correctness of this test method.");
  113. }
  114. /// <summary>
  115. ///A test for RenderSymbols
  116. ///</summary>
  117. [TestMethod()]
  118. public void RenderSymbolsTest()
  119. {
  120. VectorRenderer target = new VectorRenderer(); // TODO: Initialize to an appropriate value
  121. IEnumerable<Point2D> locations = null; // TODO: Initialize to an appropriate value
  122. Symbol2D symbolData = null; // TODO: Initialize to an appropriate value
  123. ColorMatrix highlight = null; // TODO: Initialize to an appropriate value
  124. ColorMatrix select = null; // TODO: Initialize to an appropriate value
  125. RenderState renderState = new RenderState(); // TODO: Initialize to an appropriate value
  126. IEnumerable<Drawing> expected = null; // TODO: Initialize to an appropriate value
  127. IEnumerable<Drawing> actual;
  128. actual = target.RenderSymbols(locations, symbolData, highlight, select, renderState);
  129. Assert.AreEqual(expected, actual);
  130. Assert.Inconclusive("Verify the correctness of this test method.");
  131. }
  132. /// <summary>
  133. ///A test for RenderPaths
  134. ///</summary>
  135. [TestMethod()]
  136. public void RenderPathsTest2()
  137. {
  138. VectorRenderer target = new VectorRenderer(); // TODO: Initialize to an appropriate value
  139. IEnumerable<Path2D> paths = null; // TODO: Initialize to an appropriate value
  140. StylePen line = null; // TODO: Initialize to an appropriate value
  141. StylePen highlightLine = null; // TODO: Initialize to an appropriate value
  142. StylePen selectLine = null; // TODO: Initialize to an appropriate value
  143. StylePen outline = null; // TODO: Initialize to an appropriate value
  144. StylePen highlightOutline = null; // TODO: Initialize to an appropriate value
  145. StylePen selectOutline = null; // TODO: Initialize to an appropriate value
  146. RenderState renderState = new RenderState(); // TODO: Initialize to an appropriate value
  147. IEnumerable<Drawing> expected = null; // TODO: Initialize to an appropriate value
  148. IEnumerable<Drawing> actual;
  149. actual = target.RenderPaths(paths, line, highlightLine, selectLine, outline, highlightOutline, selectOutline, renderState);
  150. Assert.AreEqual(expected, actual);
  151. Assert.Inconclusive("Verify the correctness of this test method.");
  152. }
  153. /// <summary>
  154. ///A test for RenderPaths
  155. ///</summary>
  156. [TestMethod()]
  157. public void RenderPathsTest1()
  158. {
  159. VectorRenderer target = new VectorRenderer(); // TODO: Initialize to an appropriate value
  160. IEnumerable<Path2D> paths = null; // TODO: Initialize to an appropriate value
  161. StyleBrush fill = null; // TODO: Initialize to an appropriate value
  162. StyleBrush highlightFill = null; // TODO: Initialize to an appropriate value
  163. StyleBrush selectFill = null; // TODO: Initialize to an appropriate value
  164. StylePen outline = null; // TODO: Initialize to an appropriate value
  165. StylePen highlightOutline = null; // TODO: Initialize to an appropriate value
  166. StylePen selectOutline = null; // TODO: Initialize to an appropriate value
  167. RenderState renderState = new RenderState(); // TODO: Initialize to an appropriate value
  168. IEnumerable<Drawing> expected = null; // TODO: Initialize to an appropriate value
  169. IEnumerable<Drawing> actual;
  170. actual = target.RenderPaths(paths, fill, highlightFill, selectFill, outline, highlightOutline, selectOutline, renderState);
  171. Assert.AreEqual(expected, actual);
  172. Assert.Inconclusive("Verify the correctness of this test method.");
  173. }
  174. /// <summary>
  175. ///A test for RenderPaths
  176. ///</summary>
  177. [TestMethod()]
  178. public void RenderPathsTest()
  179. {
  180. VectorRenderer target = new VectorRenderer(); // TODO: Initialize to an appropriate value
  181. IEnumerable<Path2D> paths = null; // TODO: Initialize to an appropriate value
  182. StylePen outline = null; // TODO: Initialize to an appropriate value
  183. StylePen highlightOutline = null; // TODO: Initialize to an appropriate value
  184. StylePen selectOutline = null; // TODO: Initialize to an appropriate value
  185. RenderState renderState = new RenderState(); // TODO: Initialize to an appropriate value
  186. IEnumerable<Drawing> expected = null; // TODO: Initialize to an appropriate value
  187. IEnumerable<Drawing> actual;
  188. actual = target.RenderPaths(paths, outline, highlightOutline, selectOutline, renderState);
  189. Assert.AreEqual(expected, actual);
  190. Assert.Inconclusive("Verify the correctness of this test method.");
  191. }
  192. /// <summary>
  193. ///A test for CreatePaths
  194. ///</summary>
  195. [TestMethod()]
  196. [DeploymentItem("SharpMap.Rendering.Wpf.dll")]
  197. public void CreatePathsTest()
  198. {
  199. VectorRenderer_Accessor target = new VectorRenderer_Accessor(); // TODO: Initialize to an appropriate value
  200. IEnumerable<Path2D> paths = null; // TODO: Initialize to an appropriate value
  201. bool filled = false; // TODO: Initialize to an appropriate value
  202. bool stroked = false; // TODO: Initialize to an appropriate value
  203. IEnumerable<StreamGeometry> expected = null; // TODO: Initialize to an appropriate value
  204. IEnumerable<StreamGeometry> actual;
  205. actual = target.CreatePaths(paths, filled, stroked);
  206. Assert.AreEqual(expected, actual);
  207. Assert.Inconclusive("Verify the correctness of this test method.");
  208. }
  209. /// <summary>
  210. ///A test for AddCache
  211. ///</summary>
  212. [TestMethod()]
  213. [DeploymentItem("SharpMap.Rendering.Wpf.dll")]
  214. public void AddCacheTest()
  215. {
  216. VectorRenderer_Accessor target = new VectorRenderer_Accessor(); // TODO: Initialize to an appropriate value
  217. Path2D path = null; // TODO: Initialize to an appropriate value
  218. StreamGeometry pathCache = null; // TODO: Initialize to an appropriate value
  219. target.AddCache(path, pathCache);
  220. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  221. }
  222. /// <summary>
  223. ///A test for VectorRenderer Constructor
  224. ///</summary>
  225. [TestMethod()]
  226. public void CreateWpfVectorRendererTest()
  227. {
  228. VectorRenderer renderer = new VectorRenderer();
  229. Assert.AreEqual(new Matrix2D(), renderer.RenderTransform);
  230. Assert.AreEqual(StyleRenderingMode.Default, renderer.StyleRenderingMode);
  231. renderer.Dispose();
  232. }
  233. }
  234. }