Free cookie consent management tool by TermsFeed Policy Generator

source: branches/gteufl/HeuristicLab.Tests/HeuristicLab-3.3/NamedItemTest.cs @ 11063

Last change on this file since 11063 was 9820, checked in by mkommend, 11 years ago

#1099: Corrected namespace of NamedItemTest and added it to the basic test list.

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.