-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes Window being too wide/tall when added
Fixes Window being core 'moveable' This goes considerable way to fixing: gui-cs/Terminal.Gui#3650 But can consider making the Arrangement property user configureable in the same way that we do with Visible (see TestSettingVisible_False) where user can change the value but it does not manifest in the behavior of the view (only for code gen).
- Loading branch information
Showing
3 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace UnitTests | ||
{ | ||
internal class WindowTests : Tests | ||
{ | ||
[Test] | ||
public void TestViewFactory_HasSensibleDimensions() | ||
{ | ||
var w = ViewFactory.Create<Window>(); | ||
Assert.That(w.Width,Is.EqualTo((DimAbsolute)10)); | ||
Assert.That(w.Height, Is.EqualTo((DimAbsolute)5)); | ||
} | ||
|
||
[Test] | ||
public void TestViewFactory_IsNotVanillaDraggable() | ||
{ | ||
RoundTrip<View, Window>(static (_, w) => | ||
{ | ||
// When adding a Window to the editor it should not be 'moveable' | ||
// This is because the core Terminal.Gui drag will conflict with the TGD dragging. | ||
Assert.That(w.Arrangement, Is.EqualTo(ViewArrangement.Fixed)); | ||
|
||
}, out _); | ||
} | ||
} | ||
} |