Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Improve dropdown menu creation. * Improve unit test description * Added unit tests for ToolStripMenuItemEx
- Loading branch information
Showing
5 changed files
with
65 additions
and
37 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,47 @@ | ||
using FluentAssertions; | ||
using KeePass.UI; | ||
using KeeTrayTOTP.Menu; | ||
using KeeTrayTOTP.Tests.Extensions; | ||
using KeeTrayTOTP.Tests.Helpers; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using System.Collections.Generic; | ||
using System.Drawing; | ||
using System.Linq; | ||
using KeeTrayTOTP.Helpers; | ||
|
||
namespace KeeTrayTOTP.Tests.Menu | ||
{ | ||
[TestClass] | ||
public class ToolStripMenuItemExTests | ||
{ | ||
[TestMethod] | ||
public void ToolStripMenuItemEx_ShouldReturnHasDropDownItems_EvenIfEmpty() | ||
{ | ||
var sut = new ToolStripMenuItemEx("foo", new Bitmap(1,1)); | ||
sut.ForceDropDownArrow = true; | ||
|
||
sut.HasDropDownItems.Should() | ||
.BeTrue("because we want to display the dropdown arrow even if there are no items present"); | ||
} | ||
|
||
[TestMethod] | ||
public void ToolStripMenuItemEx_ShouldHaveDefaultBehavior_IfForceDropDownArrowIsNotSet() | ||
{ | ||
var sut = new ToolStripMenuItemEx("foo", new Bitmap(1, 1)); | ||
|
||
sut.HasDropDownItems.Should() | ||
.BeFalse("because it's the default behavior"); | ||
} | ||
|
||
[TestMethod] | ||
public void ToolStripMenuItemEx_ShouldHaveDefaultBehavior_IfForceDropDownArrowIsNotSet2() | ||
{ | ||
var sut = new ToolStripMenuItemEx("foo", new Bitmap(1, 1)); | ||
sut.DropDownItems.Add("bar"); | ||
|
||
sut.HasDropDownItems.Should() | ||
.BeTrue("because it's the default behavior"); | ||
} | ||
|
||
} | ||
} |
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