public void TestIndexer() { TaskInfoCollection taskInfColl = new TaskInfoCollection(); taskInfColl.MVCConfig = mvcConfig; TaskInfo ti = taskInfColl[typeof(StubTask)]; Assert.AreSame(StubTaskInfoProvider.returnedObj, ti); Assert.AreSame(StubViewInfosProvider.returnedViewInfoColl, ti.ViewInfos); }
public void TestEnumerateAndCount() { TaskInfoCollection taskInfColl = new TaskInfoCollection(); taskInfColl[typeof(int)] = new TaskInfo(); taskInfColl[typeof(string)] = new TaskInfo(); Assert.AreEqual(2, taskInfColl.Count); bool containsFirst = false, containsSecond = false; int count = 0; foreach (Type t in taskInfColl) { if (t == typeof(int)) containsFirst = true; else if (t == typeof(string)) containsSecond = true; count++; } Assert.IsTrue(containsFirst && containsSecond && (count == 2)); }
public MVCConfiguration() { TaskInfos = new TaskInfoCollection();; TaskInfos.MVCConfig = this; }