public void AsT() { Assert.That(ServiceFactory.As <int>(33), Is.EqualTo(33)); Assert.Throws <ArgumentNullException>(() => ServiceFactory.As <object>(null)); Assert.Throws <InvalidCastException>(() => ServiceFactory.As <int>("string")); }