Example #1
0
        public void Size2_EqualsObject()
        {
            var size1 = new Size2(123, 456);
            var size2 = new Size2(123, 456);

            TheResultingValue(size1.Equals((Object)size2)).ShouldBe(true);
            TheResultingValue(size1.Equals("This is a test")).ShouldBe(false);
        }
Example #2
0
        public void Size2_EqualsObject()
        {
            var size1 = new Size2(123, 456);
            var size2 = new Size2(123, 456);

            TheResultingValue(size1.Equals((Object)size2)).ShouldBe(true);
            TheResultingValue(size1.Equals("This is a test")).ShouldBe(false);
        }
Example #3
0
        public void Size2_EqualsSize2()
        {
            var size1 = new Size2(123, 456);
            var size2 = new Size2(123, 456);
            var size3 = new Size2(123, 555);
            var size4 = new Size2(222, 456);

            TheResultingValue(size1.Equals(size2)).ShouldBe(true);
            TheResultingValue(size1.Equals(size3)).ShouldBe(false);
            TheResultingValue(size1.Equals(size4)).ShouldBe(false);
        }
Example #4
0
        public void Size2_EqualsSize2()
        {
            var size1 = new Size2(123, 456);
            var size2 = new Size2(123, 456);
            var size3 = new Size2(123, 555);
            var size4 = new Size2(222, 456);

            TheResultingValue(size1.Equals(size2)).ShouldBe(true);
            TheResultingValue(size1.Equals(size3)).ShouldBe(false);
            TheResultingValue(size1.Equals(size4)).ShouldBe(false);
        }
Example #5
0
        private void GameForm_ResizeEndActions(SDL.SDL_WindowEvent e)
        {
            if (isUserResizing && cachedSize.Equals(Size))
            {
                UserResized?.Invoke(this, EventArgs.Empty);
                // UpdateScreen();
            }

            isUserResizing = false;
            ResumeRendering?.Invoke(this, EventArgs.Empty);
        }
        public void Equality(Size2 size1, Size2 size2, bool expectedToBeEqual)
        {
            Assert.IsTrue(Equals(size1, size2) == expectedToBeEqual);
            Assert.IsTrue(size1 == size2 == expectedToBeEqual);
            Assert.IsFalse(size1 == size2 != expectedToBeEqual);
            Assert.IsTrue(size1.Equals(size2) == expectedToBeEqual);

            if (expectedToBeEqual)
            {
                Assert.AreEqual(size1.GetHashCode(), size2.GetHashCode());
            }
        }
Example #7
0
        private void GameForm_ResizeEndActions(SDL.SDL_WindowEvent e)
        {
            if (Graphics.GraphicsDevice.Platform == Graphics.GraphicsPlatform.Vulkan && OriginalSize.HasValue)
            {
                // resizing not supported, return to original resolution
                Size = cachedSize = OriginalSize.Value;
            }
            else
            {
                if (isUserResizing && cachedSize.Equals(Size))
                {
                    UserResized?.Invoke(this, EventArgs.Empty);
                    // UpdateScreen();
                }

                isUserResizing = false;
                ResumeRendering?.Invoke(this, EventArgs.Empty);
            }
        }
 public void Inequality(Size2 size, object obj, bool expectedToBeEqual)
 {
     Assert.IsTrue(size.Equals(obj) == expectedToBeEqual);
 }