FrameViewTests.cs 979 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Xunit;
  7. namespace Terminal.Gui.ViewTests {
  8. public class FrameViewTests {
  9. [Fact]
  10. public void Constuctors_Defaults ()
  11. {
  12. var fv = new FrameView ();
  13. Assert.Equal (string.Empty, fv.Title);
  14. Assert.Equal (string.Empty, fv.Text);
  15. Assert.NotNull (fv.Border);
  16. Assert.Single (fv.InternalSubviews);
  17. Assert.Single (fv.Subviews);
  18. fv = new FrameView ("Test");
  19. Assert.Equal ("Test", fv.Title);
  20. Assert.Equal (string.Empty, fv.Text);
  21. Assert.NotNull (fv.Border);
  22. Assert.Single (fv.InternalSubviews);
  23. Assert.Single (fv.Subviews);
  24. fv = new FrameView (new Rect (1, 2, 10, 20), "Test");
  25. Assert.Equal ("Test", fv.Title);
  26. Assert.Equal (string.Empty, fv.Text);
  27. Assert.NotNull (fv.Border);
  28. Assert.Single (fv.InternalSubviews);
  29. Assert.Single (fv.Subviews);
  30. Assert.Equal (new Rect (1, 2, 10, 20), fv.Frame);
  31. }
  32. }
  33. }