Beispiel #1
0
    public void AllowsNonNullRefReturnValueFromNonNullGeneric()
    {
        var sample = new ClassWithRefReturns.GenericNonNull <string>(string.Empty);

        sample.GetNonNullRef();
    }
Beispiel #2
0
 public void RequiresNonNullRefReturnValueFromNonNullGeneric()
 {
     var sample    = new ClassWithRefReturns.GenericNonNull <string>(null);
     var exception = Assert.Throws <InvalidOperationException>(() => { sample.GetNonNullRef(); });
 }