Skip to content

Commit

Permalink
MauiIcon Test Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AathifMahir committed Oct 14, 2024
1 parent d349f09 commit 2795dcf
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/MauiIcons.Modules.UnitTest/Controls/MauiIconTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ public void IconChangedToDifferentEnumerationThatDontHaveIconCode()
Label baseLabel;

// Act
mauiiIcon = new MauiIcon() { Value = CupertinoIcons.Airplane };
mauiiIcon.Value = newIcon;
mauiiIcon = new MauiIcon() { Icon = CupertinoIcons.Airplane };
mauiiIcon.Icon = newIcon;
baseLabel = (Label)mauiiIcon;

// Assert
mauiiIcon.Value.Should().NotBeNull();
mauiiIcon.Value.Should().Be(newIcon);
mauiiIcon.Icon.Should().NotBeNull();
mauiiIcon.Icon.Should().Be(newIcon);
baseLabel.FormattedText.Spans[0].Should().NotBeNull();
baseLabel.FormattedText.Spans[0].Text.Should().Be(string.Empty);
baseLabel.FormattedText.Spans[0].FontFamily.Should().Be("EnumTest");
Expand All @@ -142,7 +142,7 @@ public void CastingToLabelWithIconProperties()
var iconAutoScaling = true;

// Act
label = (Label)new MauiIcon() { Value = CupertinoIcons.Airplane, IconColor = iconColor, IconSize = iconSize,
label = (Label)new MauiIcon() { Icon = CupertinoIcons.Airplane, IconColor = iconColor, IconSize = iconSize,
IconBackgroundColor = iconBackgroundColor, IconAutoScaling = iconAutoScaling };

// Assert
Expand Down Expand Up @@ -205,7 +205,7 @@ public void CastingToImage()
var iconBackgroundColor = Colors.DarkCyan;

// Act
image = (Image)new MauiIcon() { Value = CupertinoIcons.Airplane, IconBackgroundColor = iconBackgroundColor };
image = (Image)new MauiIcon() { Icon = CupertinoIcons.Airplane, IconBackgroundColor = iconBackgroundColor };

// Assert
image.Source.Should().NotBeNull();
Expand All @@ -223,7 +223,7 @@ public void CastingToFontImageSource()
var iconAutoScaling = true;

// Act
fontImage = (FontImageSource)new MauiIcon() { Value = CupertinoIcons.Airplane, IconColor = iconColor,
fontImage = (FontImageSource)new MauiIcon() { Icon = CupertinoIcons.Airplane, IconColor = iconColor,
IconSize = iconSize, IconAutoScaling = iconAutoScaling };

// Assert
Expand Down Expand Up @@ -375,17 +375,17 @@ public void IconAndSuffixBackgroundColorChanged()
mauiiIcon = new MauiIcon();
mauiiIcon.PropertyChanged += (sender, e) =>
{
if (e.PropertyName == "IconAndSuffixBackgroundColor")
if (e.PropertyName == "BackgroundColor")
{
changedSignaled = true;
}
};
mauiiIcon.BackgroundColor = assignedColor;
mauiiIcon.IconAndSuffixBackgroundColor = assignedColor;


// Assert
mauiiIcon.BackgroundColor.Should().NotBeNull();
mauiiIcon.BackgroundColor.Should().Be(assignedColor);
mauiiIcon.IconAndSuffixBackgroundColor.Should().NotBeNull();
mauiiIcon.IconAndSuffixBackgroundColor.Should().Be(assignedColor);
changedSignaled.Should().BeTrue();
}

Expand Down

0 comments on commit 2795dcf

Please sign in to comment.