microsoft/teams.net

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
6594a29aa91c928c547a8821d305758bc8d340ed

Branches

Tags

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

Clone

HTTPS

Download ZIP

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

23lines · modecode

1using System.Text.Json;
2
3namespace Microsoft.Teams.Common.Tests;
4
5public class StringEnumTests
6{
7 [Fact]
8 public void JsonSerialize()
9 {
10 var value = new StringEnum("test");
11 var json = JsonSerializer.Serialize(value);
12
13 Assert.Equal("\"test\"", json);
14
15 var obj = new Dictionary<string, object>()
16 {
17 { "hello", new StringEnum("world") }
18 };
19
20 json = JsonSerializer.Serialize(obj);
21 Assert.Equal("{\"hello\":\"world\"}", json);
22 }
23}