Files
duplicati/Duplicati/UnitTest/ResultFormatSerializerProviderTest.cs
T

47 lines
2.0 KiB
C#
Raw Normal View History

// Copyright (C) 2026, The Duplicati Team
2024-02-28 15:45:30 +01:00
// https://duplicati.com, hello@duplicati.com
2026-01-08 14:41:48 +01:00
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
2024-02-28 15:45:30 +01:00
// Software is furnished to do so, subject to the following conditions:
2026-01-08 14:41:48 +01:00
//
// The above copyright notice and this permission notice shall be included in
2024-02-28 15:45:30 +01:00
// all copies or substantial portions of the Software.
2026-01-08 14:41:48 +01:00
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2024-02-28 15:45:30 +01:00
// DEALINGS IN THE SOFTWARE.
2026-01-08 14:41:48 +01:00
using Duplicati.Library.ResultSerialization;
2018-04-09 18:53:37 -02:30
using NUnit.Framework;
namespace Duplicati.UnitTest
2018-04-09 18:53:37 -02:30
{
[TestFixture]
2022-05-06 21:46:17 -07:00
public class ResultFormatSerializerProviderTest : BasicSetupHelper
2018-04-09 18:53:37 -02:30
{
[Test]
[Category("Serialization")]
2018-04-09 18:53:37 -02:30
public void TestGetSerializerGivenDuplicatiReturnsDuplicatiSerializer()
{
IResultFormatSerializer serializer = ResultFormatSerializerProvider.GetSerializer(ResultExportFormat.Duplicati);
2025-06-13 11:48:24 +02:00
Assert.That(serializer, Is.InstanceOf<DuplicatiFormatSerializer>());
2018-04-09 18:53:37 -02:30
}
[Test]
[Category("Serialization")]
2018-04-09 18:53:37 -02:30
public void TestGetSerializerGivenJsonReturnsJsonSerializer()
{
IResultFormatSerializer serializer = ResultFormatSerializerProvider.GetSerializer(ResultExportFormat.Json);
2025-06-13 11:48:24 +02:00
Assert.That(serializer, Is.InstanceOf<JsonFormatSerializer>());
2018-04-09 18:53:37 -02:30
}
}
}