public void ThrowForWrongCast() { object obj = new TestDto(); Action action = () => { obj.To <string>(); }; action.ShouldThrow <InvalidCastException>(); }
public void CastToT() { object obj = new TestDto(); obj.To <TestDto>().GetType().ShouldBe(typeof(TestDto)); }