Free cookie consent management tool by TermsFeed Policy Generator

source: stable/HeuristicLab.Tests/HeuristicLab-3.3/NamedItemTest.cs @ 10449

Last change on this file since 10449 was 9886, checked in by mkommend, 11 years ago

#1099: Merged changesets for named item unit test into the stable branch.

File size: 1005 bytes
RevLine 
[9817]1using System.Linq;
2using System.Text;
3using HeuristicLab.Common;
4using HeuristicLab.Core;
5using HeuristicLab.PluginInfrastructure;
6using Microsoft.VisualStudio.TestTools.UnitTesting;
7
[9820]8namespace HeuristicLab.Tests {
[9817]9  [TestClass]
10  public class NamedItemTest {
11    [ClassInitialize]
12    public static void MyClassInitialize(TestContext testContext) {
13      PluginLoader.Assemblies.Any();
14    }
15
16    [TestMethod]
17    [TestCategory("General")]
18    [TestCategory("Essential")]
19    [TestProperty("Time", "long")]
20    public void NamedItemTestNameNotEmpty() {
21      StringBuilder sb = new StringBuilder();
22      foreach (var namedItem in ApplicationManager.Manager.GetInstances<INamedItem>()) {
23        if (string.IsNullOrEmpty(namedItem.Name)) {
24          sb.AppendLine(string.Format("{0} does not have a name specified when created by the default ctor.", namedItem.GetType().GetPrettyName()));
25        }
26      }
27      Assert.IsTrue(sb.Length == 0, sb.ToString());
28    }
29  }
30}
Note: See TracBrowser for help on using the repository browser.