I tried to find if there's a similar question but didn't even know what keywords should I use :)

I got a method in an interface accepting an other interface as a parameter:

```
bool CanDoIt(AnInterface subject)

```

One of the implementations needs to fulfill the requirement that the method should return false for all concrete types (implementing AnInterface) different than X.

Simple implementation could look like (didn't wrote it since got no UT for that):

```
bool CanDoIt(AnInterface subject)
{
    if(!(subject is X)) return false;
    else ...
}

```

I know that this is a code smell accepting an interface and then checking it's concrete type - unfortunately for now I got to stick with it.

I would like to write a test that would check if the requirement is implemented correctly. So that test would fail if someone would ever add a new type implementing AnInterface and changed the method not to meet the requirement. 

If writing such a test isn't possible then what can I do to consider the coded tested? Would writing a test using few exemplary types would be enough, or is it better not to write it at all?