Я пытаюсь проверить, что некоторые объекты имеют определенный тип: < /p>
[TestInitialize]
public void SetUp()
{
exam = new Exam(examId, name, date, templateId);
tabViewModel = new TabControlViewModel(exam);
tabs = new List(tabViewModel.Tabs);
// Not using this in the current code, but including here to make
// clear the expected type of the tabs
examsTab = tabs[0] as ExamsTabViewModel;
compareTab = tabs[1] as CompareExamsTabViewModel;
templatesTab = tabs[2] as TemplatesTabViewModel;
}
[TestMethod]
public void TestTabTypes()
{
Assert.IsInstanceOfType(tabs[0], ExamsTabViewModel);
Assert.IsInstanceOfType(tabs[1], CompareExamsTabViewModel);
Assert.IsInstanceOfType(tabs[2], TemplatesTabViewModel);
}
< /code>
Но в утверждениях типы дают ошибку: < /p>
'exmembleStabViewModel' - это тип, который недопустим в данном контексте. />
void assert.isinstanceoftype (значение объекта, тип weadtype) < /p>
< /blockquote>
Почему это не работает? < /p>
Подробнее здесь: https://stackoverflow.com/questions/616 ... s-argument