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

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

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

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

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

        sample.NotNullPropertyWithAllowNull = null;
    }