Ejemplo n.º 1
0
 public void RequiresNonNullTask()
 {
     Assert.Throws <InvalidOperationException>(new Action(() => ClassWithAsyncMethods.GetNonNullTask()));
 }
Ejemplo n.º 2
0
 public async void RequiresNonNullConcreteTypeAsync()
 {
     await Assert.ThrowsAsync <InvalidOperationException>(() => ClassWithAsyncMethods.GetNonNullAsync());
 }
Ejemplo n.º 3
0
    public void AllowsNullTask()
    {
        var result = ClassWithAsyncMethods.GetNullTask();

        Assert.Null(result);
    }
Ejemplo n.º 4
0
    public async void AllowsNullGenericTypeAsyncWithDelay2()
    {
        var result = await ClassWithAsyncMethods.GetNullAsyncWithDelay2 <string>();

        Assert.Null(result);
    }
Ejemplo n.º 5
0
    public async void AllowsMaybeNullGenericTypeAsync()
    {
        var result = await ClassWithAsyncMethods.GetMaybeNullAsync <string>();

        Assert.Null(result);
    }
Ejemplo n.º 6
0
 public async void RequiresNonNullGenericTypeAsyncWithDelay()
 {
     await Assert.ThrowsAsync <InvalidOperationException>(() => ClassWithAsyncMethods.GetNonNullAsyncWithDelay <string>());
 }
Ejemplo n.º 7
0
    public async void AllowsNullConcreteTypeAsync()
    {
        var result = await ClassWithAsyncMethods.GetNullAsync();

        Assert.Null(result);
    }