public void EqualsOperator_WhenHeightIsTheSameAsWidth_ReturnsTrue()
        {
            var sizeA = new Size(1, 1);
            var sizeB = new Size(1, 1);

            Assert.IsTrue(sizeA == sizeB);
        }
        public void GetHashCode_ForEqualObjects_IsTheSame()
        {
            var size1 = new Size(1, 1);
            var size2 = new Size(1, 1);

            Assert.AreEqual(size1, size2);
            Assert.AreEqual(size1.GetHashCode(), size2.GetHashCode());
        }
        public void Constructor_WhenPassedArray_ReturnsCorrectSize()
        {
            var arr = new int[3, 2];
            var matrix = new CoolMatrix(arr);

            var expectedSize = new Size(3, 2);

            Assert.AreEqual(expectedSize, matrix.Size);
        }
        public void EqualsOperator_WhenHeightAndWidthAreDifferent_ReturnsFalse()
        {
            var sizeA = new Size(1, 1);
            var sizeB = new Size(1, 2);
            var sizeC = new Size(2, 1);

            Assert.IsFalse(sizeA == sizeB);
            Assert.IsFalse(sizeA == sizeC);
            Assert.IsFalse(sizeB == sizeC);
        }
        public void WidthProperty_Always_ReturnsWidth()
        {
            var size = new Size(width: 1, height: 2);

            Assert.AreEqual(1, size.Width);
        }
        public void IsSquare_WhenHeightIsTheSameAsWidth_ReturnsTrue()
        {
            var size = new Size(width: 1, height: 1);

            Assert.IsTrue(size.IsSquare);
        }
        public void IsSquare_WhenHeightAndWidthAreDifferent_ReturnsFalse()
        {
            var size = new Size(width: 1, height: 2);

            Assert.IsFalse(size.IsSquare);
        }
        public void HeightProperty_Always_ReturnsHeight()
        {
            var size = new Size(width: 1, height: 2);

            Assert.AreEqual(2, size.Height);
        }
        public void EqualsOperator_ForNull_ReturnsFalse()
        {
            var size = new Size(1, 2);

            Assert.IsFalse(size == null);
        }
示例#10
0
        public void EqualsOperator_ForTheSameObject_ReturnsTrue()
        {
            var size = new Size(1, 2);

            Assert.IsTrue(size == size);
        }