diff options
Diffstat (limited to 'Xamarin.Forms.Core.UnitTests/BoxViewUnitTests.cs')
-rw-r--r-- | Xamarin.Forms.Core.UnitTests/BoxViewUnitTests.cs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Xamarin.Forms.Core.UnitTests/BoxViewUnitTests.cs b/Xamarin.Forms.Core.UnitTests/BoxViewUnitTests.cs new file mode 100644 index 00000000..6d26af45 --- /dev/null +++ b/Xamarin.Forms.Core.UnitTests/BoxViewUnitTests.cs @@ -0,0 +1,42 @@ +using System; +using NUnit.Framework; + +using System.Collections.Generic; +using System.Linq; + +namespace Xamarin.Forms.Core.UnitTests +{ + [TestFixture] + public class BoxViewUnitTests : BaseTestFixture + { + [Test] + public void TestConstructor () + { + var box = new BoxView { + Color = new Color (0.2, 0.3, 0.4), + WidthRequest=20, + HeightRequest=30, + IsPlatformEnabled = true, + Platform = new UnitPlatform () + }; + + Assert.AreEqual (new Color (0.2, 0.3, 0.4), box.Color); + var request = box.GetSizeRequest (double.PositiveInfinity, double.PositiveInfinity).Request; + Assert.AreEqual (20, request.Width); + Assert.AreEqual (30, request.Height); + } + + [Test] + public void DefaultSize () + { + var box = new BoxView { + IsPlatformEnabled = true, + Platform = new UnitPlatform () + }; + + var request = box.GetSizeRequest (double.PositiveInfinity, double.PositiveInfinity).Request; + Assert.AreEqual (40, request.Width); + Assert.AreEqual (40, request.Height); + } + } +} |