mirror of
https://github.com/bitwarden/server.git
synced 2024-11-29 13:25:17 +01:00
28 lines
685 B
C#
28 lines
685 B
C#
using System.Text.Json;
|
|
using Bit.Core.Models.Data;
|
|
using Bit.Test.Common.Helpers;
|
|
using Xunit;
|
|
|
|
namespace Bit.Core.Test.Models.Data;
|
|
|
|
public class SendFileDataTests
|
|
{
|
|
[Fact]
|
|
public void Serialize_Success()
|
|
{
|
|
var sut = new SendFileData
|
|
{
|
|
Id = "test",
|
|
Size = 100,
|
|
FileName = "thing.pdf",
|
|
Validated = true,
|
|
};
|
|
|
|
var json = JsonSerializer.Serialize(sut);
|
|
var document = JsonDocument.Parse(json);
|
|
var root = document.RootElement;
|
|
AssertHelper.AssertJsonProperty(root, "Size", JsonValueKind.String);
|
|
Assert.False(root.TryGetProperty("SizeString", out _));
|
|
}
|
|
}
|