lundi 23 mars 2015

Nunit testing if first element of list is instance of class

I've made a list which can contain elements of an interface type: List <ICar>.


I have two car classes which implement the ICar interface, SlowCar and FastCar.


I've made a method which either adds a SlowCar or FastCar to the list, and now I want to test if the first element in the list is an instance of the SlowCar class. Is there a way to do this in Nunit?


Thank you.


Aucun commentaire:

Enregistrer un commentaire