Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HiveStatistics/sources/HeuristicLab.Tests/HeuristicLab-3.3/NamedItemTest.cs @ 11655

Last change on this file since 11655 was 11205, checked in by ascheibe, 10 years ago

merged rest of trunk into hive statistics branch

File size: 1005 bytes
Line 
1using System.Linq;
2using System.Text;
3using HeuristicLab.Common;
4using HeuristicLab.Core;
5using HeuristicLab.PluginInfrastructure;
6using Microsoft.VisualStudio.TestTools.UnitTesting;
7
8namespace HeuristicLab.Tests {
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.