diff --git a/test/Core.Test/Services/SendServiceTests.cs b/test/Core.Test/Services/SendServiceTests.cs index 6a1b65e9ff..b18733edc5 100644 --- a/test/Core.Test/Services/SendServiceTests.cs +++ b/test/Core.Test/Services/SendServiceTests.cs @@ -1,5 +1,8 @@ using System; using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Text.Json; using System.Linq; using Bit.Core.Context; using Bit.Core.Enums; @@ -10,9 +13,9 @@ using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Core.Test.AutoFixture; using Bit.Core.Test.AutoFixture.SendFixtures; +using Microsoft.AspNetCore.Identity; using NSubstitute; using Xunit; -using System.Text.Json; namespace Bit.Core.Test.Services { @@ -581,10 +584,11 @@ namespace Bit.Core.Test.Services { Id = "TEST", Size = fileContents.Length, + Validated = false, }; send.Type = SendType.File; - send.Data = JsonConvert.SerializeObject(sendFileData); + send.Data = JsonSerializer.Serialize(sendFileData); sutProvider.GetDependency() .ValidateFileAsync(send, sendFileData.Id, sendFileData.Size, Arg.Any()) @@ -607,7 +611,7 @@ namespace Bit.Core.Test.Services }; send.Type = SendType.File; - send.Data = JsonConvert.SerializeObject(sendFileData); + send.Data = JsonSerializer.Serialize(sendFileData); sutProvider.GetDependency() .ValidateFileAsync(send, sendFileData.Id, sendFileData.Size, Arg.Any()) @@ -616,8 +620,6 @@ namespace Bit.Core.Test.Services var badRequest = await Assert.ThrowsAsync(() => sutProvider.Sut.UploadFileToExistingSendAsync(new MemoryStream(Encoding.UTF8.GetBytes(fileContents)), send) ); - - Assert.Contains("does not match", badRequest.Message, StringComparison.InvariantCultureIgnoreCase); } [Theory]