             CGRect(
                 x: layoutRect.minX + l.layoutMargins.left,
                 y: layoutRect.minY + l.layoutMargins.top,
-                width: fixedSize.width - l.layoutMargins.left - l.layoutMargins.right,
-                height: fixedSize.height - l.layoutMargins.top - l.layoutMargins.bottom),
+                width: fixedSize.width - l.horizontalMargins,
+                height: fixedSize.height - l.verticalMargins),
             "frame not matching")
     }
 

        XCTAssertEqual(
            fit,
            CGSize(
                width: l.layoutMargins.left + l.layoutMargins.right + l.sideLength,
                height: fixedHeight),
            "size not matching")
    }

            CGRect(
                x: layoutRect.minX + l.layoutMargins.left,
                y: layoutRect.minY + l.layoutMargins.top,
                width: fixedWidth - l.horizontalMargins,
                height: l.sideLength),
            "frame not matching")
    }
    
    func testFixedWidthMatchingHeight() {
        let fixedWidth: CGFloat = 100
        l = TestLayoutable(layoutModes: BayaLayoutModes(width: .wrapContent, height: .matchParent))
        var layout = l.layoutWithFixedSize(width: fixedWidth, height: nil)
        layout.startLayout(with: layoutRect)
        
        XCTAssertEqual(
            l.frame,
            CGRect(
                x: layoutRect.minX + l.layoutMargins.left,
                y: layoutRect.minY + l.layoutMargins.top,
                width: fixedWidth - l.horizontalMargins,
                height: layoutRect.height - l.verticalMargins),
            "frame not matching")
    }

