microsoft/teams.net

Public

mirrored fromhttps://github.com/microsoft/teams.netAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
d6998dba88f6dead883a11ae04dd022867d250f1

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

Tests/Microsoft.Teams.Common.Tests/StringEnumTests.cs

23lines · modepreview

using System.Text.Json;

namespace Microsoft.Teams.Common.Tests;

public class StringEnumTests
{
    [Fact]
    public void JsonSerialize()
    {
        var value = new StringEnum("test");
        var json = JsonSerializer.Serialize(value);

        Assert.Equal("\"test\"", json);

        var obj = new Dictionary<string, object>()
        {
            { "hello", new StringEnum("world") }
        };

        json = JsonSerializer.Serialize(obj);
        Assert.Equal("{\"hello\":\"world\"}", json);
    }
}