Exemple #1
0
    public void PropertyGetterAllowsNullReturnForNestedNotNullGenericWithMaybeNull()
    {
        var sample = new ClassWithGenericNestedClass.NestedNotNull <string>();
        var value  = sample.NotNullPropertyWithMaybeNull;

        Assert.Null(value);
    }
    public void AllowsNullOutputForNestedGenericMaybeNullOutArgumentWhenFalse()
    {
        var sample = new ClassWithGenericNestedClass.NestedNotNull <string>();
        var ret    = sample.MaybeNullOutValueWhenFalse(out var result);

        Assert.False(ret);
        Assert.Null(result);
    }
Exemple #3
0
    public void PropertyGetterThrowsOnNullReturnForNestedNotNullGenericWithAllowNull()
    {
        var sample = new ClassWithGenericNestedClass.NestedNotNull <string>();

        Assert.Throws <InvalidOperationException>(() =>
        {
            var dummy = sample.NotNullPropertyWithAllowNull;
        });
    }
Exemple #4
0
    public void PropertySetterThrowsOnNullArgumentForNestedNotNullGenericWithMaybeNull()
    {
        var sample = new ClassWithGenericNestedClass.NestedNotNull <string>();

        Assert.Throws <ArgumentNullException>(() => sample.NotNullPropertyWithMaybeNull = null);
    }
Exemple #5
0
    public void PropertySetterAllowsNullArgumentForNestedNotNullGenericWithAllowNull()
    {
        var sample = new ClassWithGenericNestedClass.NestedNotNull <string>();

        sample.NotNullPropertyWithAllowNull = null;
    }