title: Xamarin forms testing layout
body: <pre class="lang-cs prettyprint-override"><code>var child = new Frame();
  var relativeLayout = new RelativeLayout();
  relativeLayout.Children.Add(child, Constraint.RelativeToParent(r =&gt; 42));
  
  var x = child.X;
  
  x.Should().Be(42);
  </code></pre>
  
  <p>I'm trying to test some logic related to the position of elements in my Xamarin Forms app. The problem is that <code>x</code> is 0 in this case, but in the running App, it is 42.
  I know there is the concept of UI-testing, but I would not like to go down that road just yet. </p>
  
  <p>Is there some way of forcing layout in the tests?</p>
  
  <p>In WPF you can do <code>.Measure</code> and <code>.Arrange</code> to place items correctly.</p>