Skip to content

Commit

Permalink
fix indenting
Browse files Browse the repository at this point in the history
  • Loading branch information
suraj-desai-wtg committed Jan 29, 2024
1 parent c7ec2e1 commit dc022e0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/Blazor.Diagrams.Core/Controls/ControlsContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ public ControlsContainer(Model model, ControlsType type = ControlsType.OnSelecti
{
Model = model;
Type = type;

if (type == ControlsType.AlwaysOn)
{
Visible = true;
}
}

public Model Model { get; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@

using Blazor.Diagrams.Core.Controls;
using Blazor.Diagrams.Core.Events;
using Blazor.Diagrams.Core.Models;
using Xunit;

namespace Blazor.Diagrams.Core.Tests.Controls
{
public class ControlsContainerTests
{
[Fact]
public void AlwaysOnControlType_AlwaysVisible()
{
// Arrange
var diagram = new TestDiagram();
var node = diagram.Nodes.Add(new NodeModel());
var controls = diagram.Controls.AddFor(node, ControlsType.AlwaysOn);

// Assert
Assert.True(controls.Visible);

node.Selected = true;
Assert.True(controls.Visible);

diagram.TriggerPointerEnter(node, new PointerEventArgs(0, 0, 0, 0, false, false, false, 0, 0, 0, 0, 0, 0, string.Empty, true));
Assert.True(controls.Visible);
}
}
}

0 comments on commit dc022e0

Please sign in to comment.