Inheritance Hierarchy
DeltaEngine.Platforms TestWithMocksOrVisually
DeltaEngine.Scenes.Tests AutoArrangingMenuTests
Namespace: DeltaEngine.Scenes.Tests
Assembly: DeltaEngine.Scenes.Tests (in DeltaEngine.Scenes.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The AutoArrangingMenuTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
AutoArrangingMenuTests | Initializes a new instance of the AutoArrangingMenuTests class |
Methods
Properties
Name | Description | |
---|---|---|
IsMockResolver | (Inherited from TestWithMocksOrVisually.) |
Examples
[Test] public void CreateNewMenuWithContentName() { AutoArrangingMenu menuByName = ContentLoader.Load<MenuXml>("TestMenuXml"); Assert.AreEqual(menuByName.Name, "TestMenuXml"); }
[Test, ApproveFirstFrameScreenshot] public void ShowMenuWithTwoButtons() { menu.AddMenuOption(() => { text.Text = "Clicked Top Button"; });
[Test] public void ShowMenuWithThreeButtons() { menu.AddMenuOption(() => { text.Text = "Clicked Top Button"; });
[Test] public void ShowMenuWithThreeTextButtons() { menu.AddMenuOption(new Theme(), () => { text.Text = "Clicked Top Button"; }, "Top Button"); menu.AddMenuOption(new Theme(), () => { text.Text = "Clicked Middle Button"; }, "Middle Button"); menu.AddMenuOption(new Theme(), () => { text.Text = "Clicked Bottom Button"; }, "Bottom Button"); menu.Show(); }
[Test, CloseAfterFirstFrame] public void CreatingSetsButtonSizeAndMenuCenter() { Assert.AreEqual(ButtonSize, menu.ButtonSize); Assert.AreEqual(Vector2D.Half, menu.Center); }
[Test, CloseAfterFirstFrame, Timeout(2000)] public void ChangingButtonSize() { menu.ButtonSize = Size.Half; Assert.AreEqual(Size.Half, menu.ButtonSize); }
[Test, CloseAfterFirstFrame] public void ChangingCenterForSetOfButtons() { menu.Center = Vector2D.One; Assert.AreEqual(Vector2D.One, menu.Center); }
[Test, CloseAfterFirstFrame] public void AddingMenuOptionAddsButton() { menu.Center = new Vector2D(0.6f, 0.6f); menu.AddMenuOption(() => { });
[Test, CloseAfterFirstFrame] public void AddControlContentTwice() { var control = new TestControl(); control.IsActive = false; Assert.AreEqual(false, control.IsActive); control.IsActive = true; Assert.AreEqual(false, control.IsActive); }
[Test, CloseAfterFirstFrame] public void ControlEnableAndDisable() { menu.AddMenuOption(() => { });
[Test, CloseAfterFirstFrame] public void ClearClearsButtons() { menu.AddMenuOption(() => { });
[Test, CloseAfterFirstFrame] public void ClearMenuOptionsLeavesOtherControlsAlone() { var logo = new Material(ShaderFlags.Position2DTextured, "DeltaEngineLogo"); menu.Add(new Sprite(logo, Rectangle.One)); menu.AddMenuOption(() => { });
[Test, CloseAfterFirstFrame] public void MenuRenderLayerIsAppliedToControls() { menu.AddMenuOption(() => { });
[Test, CloseAfterFirstFrame] public void ChangingMenuRenderLayerChangesRenderLayerOfControls() { menu.AddMenuOption(() => { });
See Also