Skip to content

Commit cdf2fa2

Browse files
Merge pull request #1 from andreakarasho/feat/optional-element-declaration
feat(elements): make ElementDeclaration fields nullable
2 parents 1e6a07a + 8ec18b2 commit cdf2fa2

5 files changed

Lines changed: 458 additions & 56 deletions

File tree

src/Clay.Test/ConfigTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,21 +206,21 @@ public void Container_SetsLayout()
206206
{
207207
var layout = LayoutConfig.FillRow(gap: 8);
208208
var decl = ElementDeclaration.Container(layout);
209-
Assert.Equal(8, decl.Layout.ChildGap);
209+
Assert.Equal(8, decl.Layout!.Value.ChildGap);
210210
}
211211

212212
[Fact]
213213
public void Box_SetsLayoutAndColor()
214214
{
215215
var decl = ElementDeclaration.Box(LayoutConfig.FillRow(), Color.Red);
216-
Assert.Equal(Color.Red.R, decl.BackgroundColor.R);
216+
Assert.Equal(Color.Red.R, decl.BackgroundColor!.Value.R);
217217
}
218218

219219
[Fact]
220220
public void RoundedBox_SetsCornerRadius()
221221
{
222222
var decl = ElementDeclaration.RoundedBox(LayoutConfig.FillRow(), Color.Red, 8f);
223-
Assert.True(decl.CornerRadius.HasRadius);
223+
Assert.True(decl.CornerRadius!.Value.HasRadius);
224224
}
225225
}
226226

0 commit comments

Comments
 (0)