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); }
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); }
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()); } }
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); }