mirror of
https://github.com/bitwarden/server.git
synced 2024-11-22 12:15:36 +01:00
4e7b9d2edd
* Extract Import-Api endpoints into separate controller Moved ciphers/import and ciphers/import-organization into new ImportController Paths have been kept intact for now (no changes on clients needed) Moved request-models used for import into tools-subfolder * Update CODEOWNERS for team-tools-dev * Move HibpController (reports) to tools * Moving files related to Send * Moving files related to ReferenceEvent * Removed unneeded newline
28 lines
697 B
C#
28 lines
697 B
C#
using System.Text.Json;
|
|
using Bit.Core.Tools.Models.Data;
|
|
using Bit.Test.Common.Helpers;
|
|
using Xunit;
|
|
|
|
namespace Bit.Core.Test.Tools.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 _));
|
|
}
|
|
}
|