Ejemplo n.º 1
0
        public void Size2D_EqualsObject()
        {
            var size1 = new Size2D(123.45, 456.78);
            var size2 = new Size2D(123.45, 456.78);

            TheResultingValue(size1.Equals((Object)size2)).ShouldBe(true);
            TheResultingValue(size1.Equals("This is a test")).ShouldBe(false);
        }
Ejemplo n.º 2
0
        public void Size2D_EqualsObject()
        {
            var size1 = new Size2D(123.45, 456.78);
            var size2 = new Size2D(123.45, 456.78);

            TheResultingValue(size1.Equals((Object)size2)).ShouldBe(true);
            TheResultingValue(size1.Equals("This is a test")).ShouldBe(false);
        }
Ejemplo n.º 3
0
        public void Size2D_EqualsSize2D()
        {
            var size1 = new Size2D(123.45, 456.78);
            var size2 = new Size2D(123.45, 456.78);
            var size3 = new Size2D(123.45, 555.55);
            var size4 = new Size2D(222.22, 456.78);

            TheResultingValue(size1.Equals(size2)).ShouldBe(true);
            TheResultingValue(size1.Equals(size3)).ShouldBe(false);
            TheResultingValue(size1.Equals(size4)).ShouldBe(false);
        }
Ejemplo n.º 4
0
        public void Size2D_EqualsSize2D()
        {
            var size1 = new Size2D(123.45, 456.78);
            var size2 = new Size2D(123.45, 456.78);
            var size3 = new Size2D(123.45, 555.55);
            var size4 = new Size2D(222.22, 456.78);

            TheResultingValue(size1.Equals(size2)).ShouldBe(true);
            TheResultingValue(size1.Equals(size3)).ShouldBe(false);
            TheResultingValue(size1.Equals(size4)).ShouldBe(false);
        }
Ejemplo n.º 5
0
        // Calculate menu's size based on content's size
        private void CalculateMenuSize()
        {
            if (Content == null)
            {
                return;
            }

            if (Size2D.Equals(Content.Size2D) == false)
            {
                Size2D = new Size2D(Content.Size2D.Width, Content.Size2D.Height);
            }
        }
Ejemplo n.º 6
0
        public void Size2DEquals()
        {
            tlog.Debug(tag, $"Size2DEquals START");

            var testingTarget = new Size2D(1, 1);

            Assert.IsNotNull(testingTarget, "Can't create success object Size2D");
            Assert.IsInstanceOf <Size2D>(testingTarget, "Should be an instance of Size2D type.");

            using (Size2D size = new Size2D(1, 1))
            {
                var result = testingTarget.Equals(size);
                Assert.IsTrue(result, "Should be true here!");
            }

            testingTarget.Dispose();
            tlog.Debug(tag, $"Size2DEquals END (OK)");
        }
Ejemplo n.º 7
0
 public void EqualsSize2DWorks(Size2D size1, Size2D size2, bool expectedResult)
 {
     Assert.AreEqual(expectedResult, size1.Equals(size2));
 }