DropDownTests.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright (c) The Perspex Project. All rights reserved.
  2. // Licensed under the MIT license. See licence.md file in the project root for full license information.
  3. using System;
  4. using System.Linq;
  5. using Perspex.Controls.Presenters;
  6. using Perspex.Controls.Primitives;
  7. using Perspex.Controls.Templates;
  8. using Perspex.Platform;
  9. using Ploeh.AutoFixture;
  10. using Ploeh.AutoFixture.AutoMoq;
  11. using Xunit;
  12. namespace Perspex.Controls.UnitTests
  13. {
  14. public class DropDownTests
  15. {
  16. private FuncControlTemplate GetTemplate()
  17. {
  18. return new FuncControlTemplate<DropDown>(parent =>
  19. {
  20. return new Panel
  21. {
  22. Name = "container",
  23. Children = new Controls
  24. {
  25. new ContentControl
  26. {
  27. Name = "contentControl",
  28. [~ContentPresenter.ContentProperty] = parent[~DropDown.SelectionBoxItemProperty],
  29. },
  30. new ToggleButton
  31. {
  32. Name = "toggle",
  33. },
  34. new Popup
  35. {
  36. Name = "popup",
  37. }
  38. }
  39. };
  40. });
  41. }
  42. }
  43. }