mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-24 12:06:37 +00:00
33 lines
1.0 KiB
C#
33 lines
1.0 KiB
C#
// Copyright (c) Craftwork Games. All rights reserved.
|
|
// Licensed under the MIT license.
|
|
// See LICENSE file in the project root for full license information.
|
|
|
|
namespace MonoGame.Extended.Tiled.Tests;
|
|
|
|
public class TileMapPropertiesTest
|
|
{
|
|
// NullReferenceException in TiledMapProperties
|
|
// https://github.com/craftworkgames/MonoGame.Extended/issues/901
|
|
[Fact]
|
|
public void TryGetValue_InvalidKey_ReturnsFalse()
|
|
{
|
|
TiledMapProperties properties = new TiledMapProperties();
|
|
var result = properties.TryGetValue("invalid", out string value);
|
|
Assert.False(result);
|
|
Assert.True(string.IsNullOrEmpty(value));
|
|
}
|
|
|
|
[Fact]
|
|
public void TryGetValue_ValidKey_ReturnsFalse()
|
|
{
|
|
var expected = "value";
|
|
TiledMapProperties properties = new TiledMapProperties();
|
|
properties.Add("test", new TiledMapPropertyValue(expected));
|
|
|
|
var result = properties.TryGetValue("test", out string actual);
|
|
|
|
Assert.True(result);
|
|
Assert.Equal(expected, actual);
|
|
}
|
|
}
|