public void Task1SetInvalidItem()
{
int cnt = 0;
var tk = new Task<int> ((a) => cnt += a);
try {
tk [1] = new PortElement<int> (2);
Assert.Fail ("#1");
} catch (ArgumentException) {}
try {
var obj = tk [1];
Assert.Fail ("#2");
} catch (ArgumentException) {}
try {
tk [0] = new PortElement<double> (2);
Assert.Fail ("#3");
} catch (InvalidCastException) {} //LAMEIMPL it should report a better error and take any IPortElement<T>
}