forked from Sitecore/ASP.NET-Core-SDK
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComponentFixture.cs
More file actions
33 lines (28 loc) · 943 Bytes
/
ComponentFixture.cs
File metadata and controls
33 lines (28 loc) · 943 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using AutoFixture;
using AwesomeAssertions;
using Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model;
using Xunit;
namespace Sitecore.AspNetCore.SDK.LayoutService.Client.Tests.Response.Model;
public class ComponentFixture : FieldsReaderFixture<Component>
{
// ReSharper disable once UnusedMember.Global - Used by testing framework
public static Action<IFixture> AutoSetup => f =>
{
f.Behaviors.Add(new OmitOnRecursionBehavior());
};
[Fact]
public void Ctor_SetsDefaults()
{
// Arrange
Component sut = new();
// Act
bool idIsGuid = Guid.TryParse(sut.Id, out Guid _);
// Assert
idIsGuid.Should().BeTrue();
sut.Name.Should().BeEmpty();
sut.DataSource.Should().Be("available-in-connected-mode");
sut.Parameters.Should().BeEmpty();
sut.Placeholders.Should().BeEmpty();
sut.Fields.Should().BeEmpty();
}
}