mirror of https://github.com/Squidex/squidex.git
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.
53 lines
1.3 KiB
53 lines
1.3 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
using Squidex.Domain.Apps.Entities.Contents.Operations;
|
|
|
|
namespace Squidex.MongoDb.Domain.Contents;
|
|
|
|
public class AdaptionTests
|
|
{
|
|
[Fact]
|
|
public void Should_adapt_to_meta_field()
|
|
{
|
|
var source = "lastModified";
|
|
|
|
var result = Adapt.MapPath(source).ToString();
|
|
|
|
Assert.Equal("mt", result);
|
|
}
|
|
|
|
[Fact]
|
|
public void Should_adapt_to_data_field()
|
|
{
|
|
var source = "data.test";
|
|
|
|
var result = Adapt.MapPath(source).ToString();
|
|
|
|
Assert.Equal("do.test", result);
|
|
}
|
|
|
|
[Fact]
|
|
public void Should_adapt_from_meta_field()
|
|
{
|
|
var source = "mt";
|
|
|
|
var result = Adapt.MapPathReverse(source).ToString();
|
|
|
|
Assert.Equal("lastModified", result);
|
|
}
|
|
|
|
[Fact]
|
|
public void Should_adapt_from_data_field()
|
|
{
|
|
var source = "do.test";
|
|
|
|
var result = Adapt.MapPathReverse(source).ToString();
|
|
|
|
Assert.Equal("data.test", result);
|
|
}
|
|
}
|
|
|