Skip to content

Commit

Permalink
WIP: adding superviewrenderslinecanvas tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tig committed Nov 6, 2024
1 parent 07b295b commit 3ad8969
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
2 changes: 1 addition & 1 deletion UICatalog/Scenarios/AdvancedClipping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private View CreateTiledView (int id, Pos x, Pos y)
CanFocus = true, // Can't drag without this? BUGBUG
TabStop = TabBehavior.TabStop,
Arrangement = ViewArrangement.Movable | ViewArrangement.Resizable,
ShadowStyle = ShadowStyle.Transparent
ShadowStyle = ShadowStyle.Transparent,
};
//tiled.Padding.Thickness = new (1);
//tiled.Padding.Diagnostics = ViewDiagnosticFlags.Thickness;
Expand Down
55 changes: 55 additions & 0 deletions UnitTests/View/Adornment/BorderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -821,4 +821,59 @@ public void View_SetBorderStyle ()
Assert.Equal (Thickness.Empty, view.Border.Thickness);
view.Dispose ();
}

[Theory]
[InlineData (false, @"
┌───┐
│ ║ │
│═┌┄│
│ ┊ │
└───┘")]
[InlineData (true, @"
╔═╗─┐
║ ║ │
╚═╬┄┐
│ ┊ ┊
└─└┄┘")]
[SetupFakeDriver]
public void SuperViewRendersLineCanvas_AutoJoinsLines (bool superViewRendersLineCanvas, string expected)
{
View superView = new View ()
{
Id = "superView",
Width = 5,
Height = 5,
BorderStyle = LineStyle.Single
};

View view1 = new View ()
{
Id = "view1",
Width = 3,
Height = 3,
X = -1,
Y = -1,
BorderStyle = LineStyle.Double,
SuperViewRendersLineCanvas = superViewRendersLineCanvas
};

View view2 = new View ()
{
Id = "view2",
Width = 3,
Height = 3,
X = 1,
Y = 1,
BorderStyle = LineStyle.Dotted,
SuperViewRendersLineCanvas = superViewRendersLineCanvas
};

superView.Add (view1, view2);

superView.BeginInit ();
superView.EndInit ();
superView.Draw ();

TestHelpers.AssertDriverContentsAre (expected, output);
}
}

0 comments on commit 3ad8969

Please sign in to comment.