You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
685 B
27 lines
685 B
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 _)); |
|
} |
|
}
|
|
|