Beispiel #1
0
    public void NullDisplayText_LastSettingWins()
    {
        // Arrange
        var displayMetadata = new DisplayMetadata();

        // Act 1
        displayMetadata.NullDisplayText = "first string";

        // Assert 1
        Assert.Equal("first string", displayMetadata.NullDisplayText);
        Assert.Equal("first string", displayMetadata.NullDisplayTextProvider());

        // Act 2
        displayMetadata.NullDisplayTextProvider = () => "second string";

        // Assert 2
        Assert.Equal("second string", displayMetadata.NullDisplayText);
        Assert.Equal("second string", displayMetadata.NullDisplayTextProvider());

        // Act 3
        displayMetadata.NullDisplayText = "third string";

        // Assert 3
        Assert.Equal("third string", displayMetadata.NullDisplayText);
        Assert.Equal("third string", displayMetadata.NullDisplayTextProvider());
    }
Beispiel #2
0
    public void NullDisplayTextProvider_AffectsBothNullDisplayProperties()
    {
        // Arrange
        var displayMetadata = new DisplayMetadata();

        // Act
        displayMetadata.NullDisplayTextProvider = () => "expected string";

        // Assert
        Assert.Equal("expected string", displayMetadata.NullDisplayText);
        Assert.Equal("expected string", displayMetadata.NullDisplayTextProvider());
    }