using System; using System.Text; using HeuristicLab.Problems.Instances.ElloumiCTAP; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace UnitTests { [TestClass()] public class ElloumiCTAPInstanceProviderTest { [TestMethod()] public void GetElloumiCTAPInstanceTest() { var target = new ElloumiCTAPInstanceProvider(); StringBuilder erroneousInstances = new StringBuilder(); int count = 0; foreach (var id in target.GetInstanceDescriptors()) { try { target.GetInstance(id); } catch (Exception ex) { erroneousInstances.AppendLine(id.Name + ": " + ex.Message); } count++; } Assert.IsTrue(count > 0, "No problem instances were found."); Assert.IsTrue(erroneousInstances.Length == 0, "Some instances could not be parsed: " + Environment.NewLine + erroneousInstances.ToString()); } } }