public void RequiresNonNullArgumentForNonNullGenericConstraint() { var sample = new ClassWithNullableContext1(); var exception = Assert.Throws <ArgumentNullException>(() => { sample.NotNullGeneric <string>(null); }); Assert.Equal("nonNullArg", exception.ParamName); }
public void RequiresNonNullReturnForNonNullGenericConstraint() { var sample = new ClassWithNullableContext1(); var exception = Assert.Throws <InvalidOperationException>(() => { sample.NotNullGeneric <string>(""); }); }