<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1668188705279131313</id><updated>2020-02-28T19:48:31.174-08:00</updated><category term=".Net"/><category term="F#"/><category term="ReactiveUI"/><category term="Rx"/><category term="Xamarin"/><category term="Xamarin.Forms"/><category term="C#"/><category term="Reactive Extensions"/><category term="Russia"/><category term="TDD"/><category term="drink"/><category term="kvass"/><category term="ricipy"/><title type='text'>Jonathan Peel</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://www.jonathanpeel.co.za/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/1668188705279131313/posts/default'/><link rel='alternate' type='text/html' href='https://www.jonathanpeel.co.za/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Jonathan Peel</name><uri>http://www.blogger.com/profile/17062014578160115054</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1668188705279131313.post-7227806530500073572</id><published>2019-03-06T20:45:00.002-08:00</published><updated>2019-03-06T20:45:17.751-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".Net"/><category scheme="http://www.blogger.com/atom/ns#" term="F#"/><category scheme="http://www.blogger.com/atom/ns#" term="Reactive Extensions"/><category scheme="http://www.blogger.com/atom/ns#" term="ReactiveUI"/><category scheme="http://www.blogger.com/atom/ns#" term="Rx"/><category scheme="http://www.blogger.com/atom/ns#" term="Xamarin"/><category scheme="http://www.blogger.com/atom/ns#" term="Xamarin.Forms"/><title type='text'>Xamarin Forms, with F# - Part 2, ReactiveUI</title><content type='html'>&lt;p&gt;Next, I want to add &lt;a href=&quot;https://reactiveui.net/&quot;&gt;ReactiveUI&lt;/a&gt;.&lt;/p&gt;&lt;h2 id=&quot;copy-project&quot;&gt;Copy Project&lt;/h2&gt;&lt;p&gt;I am making a copy of my project folder and calling it FXamRx. I also open up Visual Studio, the solution, projects, and all namespaces to FXamRx.&lt;br&gt;Then build and run everything, to make sure that nothing has been broken.&lt;/p&gt;&lt;aside&gt;   I have been using Reactive Extensions for a couple of months, and I have next to zero experience with F#. These are both experiments for me, so I have no idea if I am doing this the &quot;Right Way&quot;.   If anyone sees a better way anything can be done, please let me know. The main purpose of this is for me to explore and learn.   &lt;/aside&gt;   &lt;p&gt;ReactiveUI is an &lt;a href=&quot;https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel&quot;&gt;MVVM&lt;/a&gt; framework, based on &lt;a href=&quot;https://github.com/dotnet/reactive&quot;&gt;Reactive Extensions&lt;/a&gt;.&lt;/p&gt;&lt;h2 id=&quot;add-reactiveui&quot;&gt;Add ReactiveUI&lt;/h2&gt;&lt;p&gt;Right click on the solution and select &lt;em&gt;Manage NuGet Packages for Solution&lt;/em&gt;, Search for &lt;a href=&quot;https://www.nuget.org/packages/ReactiveUI.XamForms&quot;&gt;ReactiveUI.XamForms&lt;/a&gt; and add it to both projects.&lt;/p&gt;&lt;h2 id=&quot;create-a-viewmodel&quot;&gt;Create a ViewModel&lt;/h2&gt;&lt;p&gt;In the &lt;code&gt;Xamarin.Forms&lt;/code&gt; project create a code file called &lt;code&gt;MyReactiveViewModel.fs&lt;/code&gt;&lt;/p&gt;&lt;p&gt;Our ViewModel needs to inherit from &lt;code&gt;ReactiveObject&lt;/code&gt; and &lt;code&gt;IRoutableViewModel&lt;/code&gt;. It needs an &lt;code&gt;IScreen&lt;/code&gt; (this is what ReactiveUI uses for switching between views and view models).&lt;/p&gt;&lt;p&gt;I am also going to add a message for now. This will be static, I want to get the basics working, then I will expand on it., so &lt;code&gt;MyReactiveViewModel.fs&lt;/code&gt; ends up being&lt;/p&gt;&lt;pre class=&quot; language-fsharp&quot;&gt;&lt;code class=&quot;prism  language-fsharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;namespace&lt;/span&gt;  Jon&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;FXamRx  &lt;br /&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;open&lt;/span&gt;  ReactiveUI  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;open&lt;/span&gt;  Splat  &lt;br /&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;type&lt;/span&gt;  &lt;span class=&quot;token function&quot;&gt;MyReactiveViewModel&lt;/span&gt;  &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;?&lt;/span&gt;hostScreen&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;  IScreen&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;inherit&lt;/span&gt;  &lt;span class=&quot;token function&quot;&gt;ReactiveObject&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;  &lt;span class=&quot;token function&quot;&gt;MyReactiveViewModel&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;br /&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;member&lt;/span&gt;  this&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Message  &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;  &lt;span class=&quot;token string&quot;&gt;&quot;Welcome to a basic MVVM&quot;&lt;/span&gt;  &lt;br /&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;interface&lt;/span&gt;  &lt;span class=&quot;token class-name&quot;&gt;IRoutableViewModel&lt;/span&gt;  &lt;span class=&quot;token keyword&quot;&gt;with&lt;/span&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;member&lt;/span&gt;  this&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;HostScreen&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;  IScreen  &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;  &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt;  hostScreen&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;IsSome  &lt;span class=&quot;token keyword&quot;&gt;then&lt;/span&gt;  hostScreen&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Value  &lt;span class=&quot;token keyword&quot;&gt;else&lt;/span&gt;  Locator&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Current&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetService&lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt;IScreen&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;member&lt;/span&gt;  this&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;UrlPathSegment&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;  string  &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;  &lt;span class=&quot;token string&quot;&gt;&quot;&quot;&lt;/span&gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;create-a-view&quot;&gt;Create a View&lt;/h2&gt;&lt;p&gt;I am going to delete &lt;code&gt;Page1.fs&lt;/code&gt;, I got the XAML page working, so I am not going to keep the old coded page. If you prefer using coded pages, please use it, but I am not going to show that here.&lt;/p&gt;&lt;p&gt;I make a copy of &lt;code&gt;Page2.xaml[.fs]&lt;/code&gt; and rename it to &lt;code&gt;MyReactiveView.xaml[.fs]&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;The page needs to inherit from &lt;code&gt;ReactiveContentPage&amp;lt;T&amp;gt;&lt;/code&gt; instead of the Xamlarin built in &lt;code&gt;ContentPage&lt;/code&gt;. It also needs a &lt;em&gt;type paramter&lt;/em&gt; that will point to the View Model. I also want to keep the label, but this time, instead of giving a default message I give it a name, to use for binding in the “code behind”.&lt;/p&gt;&lt;p&gt;&lt;code&gt;MyReactiveView.xaml&lt;/code&gt; now looks like this&lt;/p&gt;&lt;pre class=&quot; language-xml&quot;&gt;&lt;code class=&quot;prism  language-xml&quot;&gt;&lt;span class=&quot;token prolog&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;/span&gt;  &lt;br /&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token namespace&quot;&gt;rxFroms:&lt;/span&gt;ReactiveContentPage&lt;/span&gt;  &lt;span class=&quot;token attr-name&quot;&gt;xmlns&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;http://xamarin.com/schemas/2014/forms&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span class=&quot;token attr-name&quot;&gt;&lt;span class=&quot;token namespace&quot;&gt;xmlns:&lt;/span&gt;x&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;http://schemas.microsoft.com/winfx/2009/xaml&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span class=&quot;token attr-name&quot;&gt;&lt;span class=&quot;token namespace&quot;&gt;xmlns:&lt;/span&gt;rxFroms&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;clr-namespace:ReactiveUI.XamForms;assembly=ReactiveUI.XamForms&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span class=&quot;token attr-name&quot;&gt;&lt;span class=&quot;token namespace&quot;&gt;xmlns:&lt;/span&gt;local&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;clr-namespace:Jon.FXamRx&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span class=&quot;token attr-name&quot;&gt;&lt;span class=&quot;token namespace&quot;&gt;x:&lt;/span&gt;Class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Jon.FXamRx.MyReactiveView&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span class=&quot;token attr-name&quot;&gt;&lt;span class=&quot;token namespace&quot;&gt;x:&lt;/span&gt;TypeArguments&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;local:MyReactiveViewModel&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;Label&lt;/span&gt;  &lt;span class=&quot;token attr-name&quot;&gt;&lt;span class=&quot;token namespace&quot;&gt;x:&lt;/span&gt;Name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Message&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;  &lt;span class=&quot;token attr-name&quot;&gt;VerticalOptions&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Center&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;  &lt;span class=&quot;token attr-name&quot;&gt;HorizontalOptions&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Center&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;  &lt;span class=&quot;token punctuation&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;token namespace&quot;&gt;rxFroms:&lt;/span&gt;ReactiveContentPage&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In &lt;code&gt;MyReactiveView.xaml.fs&lt;/code&gt; we just have to rename the type, inherit from &lt;code&gt;ReactiveContentPage&lt;/code&gt;, and bind the control to the View Model&lt;/p&gt;&lt;pre class=&quot; language-fsharp&quot;&gt;&lt;code class=&quot;prism  language-fsharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;namespace&lt;/span&gt;  Jon&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;FXamRx  &lt;br /&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;open&lt;/span&gt;  ReactiveUI&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;XamForms  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;open&lt;/span&gt;  Xamarin&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Forms&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Xaml  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;open&lt;/span&gt;  ReactiveUI  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;open&lt;/span&gt;  Xamarin&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Forms  &lt;br /&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;type&lt;/span&gt;  &lt;span class=&quot;token function&quot;&gt;MyReactiveView&lt;/span&gt;  &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;token keyword&quot;&gt;as&lt;/span&gt;  this  &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;inherit&lt;/span&gt;  ReactiveContentPage&lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt;MyReactiveViewModel&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt;  &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt;  _  &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;  &lt;span class=&quot;token keyword&quot;&gt;base&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;LoadFromXaml&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;typeof&lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt;MyReactiveView&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt;  message  &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;  &lt;span class=&quot;token keyword&quot;&gt;base&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;FindByName&lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt;Label&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Message&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;br /&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;override&lt;/span&gt;  __&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;OnAppearing&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;base&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;OnAppearing&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;br /&gt;this&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;OneWayBind&lt;/span&gt;  &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;this&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;ViewModel&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;  &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;fun&lt;/span&gt;  vm  &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt;  vm&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Message&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;  &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;fun&lt;/span&gt;  v  &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt;  &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;v&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Message  &lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;  Label&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Text&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt;  ignore  &lt;br /&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;member&lt;/span&gt;  &lt;span class=&quot;token keyword&quot;&gt;val&lt;/span&gt;  Message  &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;  message  &lt;span class=&quot;token keyword&quot;&gt;with&lt;/span&gt;  get  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I know that I am ignoring a subscription, and this should be disposed, but for now, I am not going to worry about that.&lt;/p&gt;&lt;h2 id=&quot;appbootstrapper&quot;&gt;AppBootstrapper&lt;/h2&gt;&lt;p&gt;This is not going to just run, because we need to first tell the app what that “MainPage” is.&lt;/p&gt;&lt;p&gt;In ReactiveUI, it is common to use an AppBootstrapper. This also acts as out &lt;code&gt;IScreen&lt;/code&gt; that gets sent to the View Model.&lt;/p&gt;&lt;p&gt;We create a new code file called &lt;code&gt;AppBootstrapper.fs&lt;/code&gt;.&lt;br&gt;In here we need to set up a very basic service locator. We will use &lt;code&gt;Splat&lt;/code&gt; because it bundles with ReactiveUI. It might not be my favourite in some regards, but it is very quick to get going, and for a small project it does the job.&lt;br&gt;We need to connect &lt;code&gt;AppBootstrapper&lt;/code&gt; to &lt;code&gt;IScreen&lt;/code&gt;, and we need to connect our View to our View Model. We also need a small function that will create our MainPage.&lt;/p&gt;&lt;pre class=&quot; language-fsharp&quot;&gt;&lt;code class=&quot;prism  language-fsharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;namespace&lt;/span&gt;  Jon&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;FXamRx  &lt;br /&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;open&lt;/span&gt;  ReactiveUI  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;open&lt;/span&gt;  Splat  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;open&lt;/span&gt;  ReactiveUI&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;XamForms  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;open&lt;/span&gt;  Jon&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;FXamRx  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;open&lt;/span&gt;  Xamarin&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Forms  &lt;br /&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;type&lt;/span&gt;  &lt;span class=&quot;token function&quot;&gt;AppBootstrapper&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;token keyword&quot;&gt;as&lt;/span&gt;  this  &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;inherit&lt;/span&gt;  &lt;span class=&quot;token function&quot;&gt;ReactiveObject&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;br /&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt;  router  &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;  &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt;  &lt;span class=&quot;token class-name&quot;&gt;RoutingState&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;br /&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;do&lt;/span&gt;  &lt;br /&gt;Locator&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;CurrentMutable&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;RegisterConstant&lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt;IScreen&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt;  this  &lt;br /&gt;Locator&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;CurrentMutable&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Register&lt;/span&gt;  &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;fun&lt;/span&gt;  &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt;  &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt;  &lt;span class=&quot;token class-name&quot;&gt;MyReactiveView&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt;  IViewFor&lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt;MyReactiveViewModel&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;br /&gt;router&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;NavigateAndReset&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Execute&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;MyReactiveViewModel&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt;  ignore  &lt;br /&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;member&lt;/span&gt;  __&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;CreateMainPage&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt;  &lt;span class=&quot;token class-name&quot;&gt;RoutedViewHost&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt;  Page  &lt;br /&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;interface&lt;/span&gt;  &lt;span class=&quot;token class-name&quot;&gt;IScreen&lt;/span&gt;  &lt;span class=&quot;token keyword&quot;&gt;with&lt;/span&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;member&lt;/span&gt;  __&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Router  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;with&lt;/span&gt;  &lt;span class=&quot;token function&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;  &lt;br /&gt;router  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;app.fs&quot;&gt;App.fs&lt;/h2&gt;&lt;p&gt;&lt;code&gt;App.fs&lt;/code&gt; just needs to be wired up to create the Bootstrapper and grab the Main Page.&lt;/p&gt;&lt;pre class=&quot; language-fsharp&quot;&gt;&lt;code class=&quot;prism  language-fsharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;namespace&lt;/span&gt;  Jon&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;FXamRx  &lt;br /&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;open&lt;/span&gt;  Xamarin&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Forms  &lt;br /&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;type&lt;/span&gt;  &lt;span class=&quot;token function&quot;&gt;App&lt;/span&gt;  &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;  &lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;inherit&lt;/span&gt;  &lt;span class=&quot;token function&quot;&gt;Application&lt;/span&gt;  &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;MainPage  &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;  &lt;span class=&quot;token function&quot;&gt;AppBootstrapper&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;CreateMainPage&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;&lt;p&gt;This now builds, and the expected message is shown on the screen. It might seem like a lot of work for just a message, but this outline should make the next steps of any apps a little easier.&lt;/p&gt;&lt;p&gt;The code, up to this point, is available &lt;a href=&quot;https://github.com/Thorocaine/JonathanPeelBlog/tree/master/Xamarin-F%23/FXamRx&quot;&gt;on GitHub&lt;/a&gt;.&lt;/p&gt; </content><link rel='replies' type='application/atom+xml' href='https://www.jonathanpeel.co.za/feeds/7227806530500073572/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.jonathanpeel.co.za/2019/03/xamarin-forms-with-f-part-2-reactiveui.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/1668188705279131313/posts/default/7227806530500073572'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/1668188705279131313/posts/default/7227806530500073572'/><link rel='alternate' type='text/html' href='https://www.jonathanpeel.co.za/2019/03/xamarin-forms-with-f-part-2-reactiveui.html' title='Xamarin Forms, with F# - Part 2, ReactiveUI'/><author><name>Jonathan Peel</name><uri>http://www.blogger.com/profile/17062014578160115054</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1668188705279131313.post-5702145850986705047</id><published>2019-03-02T05:37:00.001-08:00</published><updated>2019-03-02T05:37:19.203-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".Net"/><category scheme="http://www.blogger.com/atom/ns#" term="F#"/><category scheme="http://www.blogger.com/atom/ns#" term="Xamarin"/><category scheme="http://www.blogger.com/atom/ns#" term="Xamarin.Forms"/><title type='text'>Xamarin Forms, with F#</title><content type='html'>&lt;!DOCTYPE html&gt;&lt;html&gt; &lt;head&gt;  &lt;meta charset=&quot;utf-8&quot;&gt;  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;  &lt;title&gt;xam-fsharp-01&lt;/title&gt;  &lt;link rel=&quot;stylesheet&quot; href=&quot;https://stackedit.io/style.css&quot; /&gt;&lt;/head&gt; &lt;body class=&quot;stackedit&quot;&gt;  &lt;div class=&quot;stackedit__html&quot;&gt;&lt;p&gt;I wanted to give F# a “go” in a Xamarin project, but Visual Studio (at least on Windows) does not have a Xamarin Forms template for F#. This means that I will need to create it myself.&lt;br&gt;I am sure it will be possible, and I will use a C# project as a guide.&lt;/p&gt;&lt;p&gt;I am in no way proficient in F#, but that is also because I have never really used it in a “real” project, and I would like to give it a good try.&lt;/p&gt;&lt;p&gt;In this post, I am going to attempt to create just the outline of the project.&lt;/p&gt;&lt;h1 id=&quot;create-a-new-project&quot;&gt;Create a new project&lt;/h1&gt;&lt;p&gt;In Visual Studio, I am creating an &lt;em&gt;F#, .Net Standard Class Library&lt;/em&gt;. This will become my Xamarin Forms library (called PCL before .Net Standard). I am naming my project &lt;code&gt;Jon.FXam&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;I then want to add &lt;code&gt;Xamarin.Forms&lt;/code&gt; from NuGet.&lt;/p&gt;&lt;p&gt;Now I need to create my App “Class”, I can’t find any XAML for F#, so I will just have to try my best at coding it.&lt;/p&gt;&lt;p&gt;Rename &lt;code&gt;Library.fs&lt;/code&gt; to &lt;code&gt;App.fs&lt;/code&gt; and set its content to:&lt;/p&gt;&lt;pre class=&quot; language-fsharp&quot;&gt;&lt;code class=&quot;prism  language-fsharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;namespace&lt;/span&gt; Jon&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;FXam&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;open&lt;/span&gt; Xamarin&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Forms&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;App&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;inherit&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;Application&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It builds.&lt;/p&gt;&lt;h1 id=&quot;add-an-android-project&quot;&gt;Add an Android project&lt;/h1&gt;&lt;p&gt;I am using Android because that is what I am most familiar with, and it is what I use most the time for projects at work. If I get the need to use iOS I will update this, or add to it.  For now, it is Android only.&lt;/p&gt;&lt;p&gt;I use the &lt;em&gt;Blank App (Android)&lt;/em&gt; Template, in F#. I name it &lt;code&gt;Jon.FXam.Android&lt;/code&gt;. Some people might prefer to use &lt;code&gt;.Droid&lt;/code&gt; but &lt;code&gt;.Android&lt;/code&gt; seems to be the current convention.&lt;/p&gt;&lt;p&gt;I add &lt;code&gt;Xamarin.Forms&lt;/code&gt; through NuGet, I also add a project reference to my base project. I then need to edit &lt;code&gt;MainActivity.fs&lt;/code&gt;.&lt;/p&gt;&lt;pre class=&quot; language-fsharp&quot;&gt;&lt;code class=&quot;prism  language-fsharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;namespace&lt;/span&gt; Jon&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;FXam&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Android&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;open&lt;/span&gt; Jon&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;FXam&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;open&lt;/span&gt; Android&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;App&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;open&lt;/span&gt; Xamarin&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Forms&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;open&lt;/span&gt; Xamarin&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Forms&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Platform&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Android&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;type&lt;/span&gt; Resources &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; Jon&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;FXam&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Android&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Resource&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Activity&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;Label &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Jon.FXam.Android&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; MainLauncher &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; Icon &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;@mipmap/icon&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;MainActivity&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;inherit&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;FormsAppCompatActivity&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;override&lt;/span&gt; this&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;OnCreate&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;bundle&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;token keyword&quot;&gt;base&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;OnCreate&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;bundle&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;br /&gt;        Forms&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Init&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;this&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; bundle&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;br /&gt;        this&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;LoadApplication&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;App&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It builds.&lt;/p&gt;&lt;h1 id=&quot;appcompat&quot;&gt;AppCompat&lt;/h1&gt;&lt;h2 id=&quot;theme&quot;&gt;Theme&lt;/h2&gt;&lt;p&gt;App Compat needs a theme, so I copy the &lt;code&gt;styles.xml&lt;/code&gt; file from another Xamarin project. This goes in  &lt;strong&gt;&lt;code&gt;Resources&lt;/code&gt;&lt;/strong&gt; &lt;strong&gt;&amp;gt;&lt;/strong&gt; &lt;strong&gt;&lt;code&gt;values&lt;/code&gt;&lt;/strong&gt;, and needs the build action set to &lt;code&gt;AndroidResource&lt;/code&gt;.&lt;/p&gt;&lt;pre class=&quot; language-xml&quot;&gt;&lt;code class=&quot;prism  language-xml&quot;&gt;&lt;span class=&quot;token prolog&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;resources&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;style&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;MainTheme&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;parent&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;MainTheme.Base&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token style language-css&quot;&gt;&lt;br /&gt;  &lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;token comment&quot;&gt;&amp;lt;!-- Base theme applied no matter what API --&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;style&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;MainTheme.Base&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;parent&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Theme.AppCompat.Light.DarkActionBar&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token style language-css&quot;&gt;&lt;br /&gt;    &amp;lt;!--&amp;lt;item name=&lt;span class=&quot;token string&quot;&gt;&quot;android:colorActivatedHighlight&quot;&lt;/span&gt;&amp;gt;&lt;span class=&quot;token hexcode&quot;&gt;#00f&lt;/span&gt;&amp;lt;/item&amp;gt;--&amp;gt;&lt;br /&gt;    &amp;lt;!--If you are using revision &lt;span class=&quot;token number&quot;&gt;22.1&lt;/span&gt; please use just windowNoTitle&lt;span class=&quot;token number&quot;&gt;.&lt;/span&gt; Without &lt;span class=&quot;token property&quot;&gt;android&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;--&amp;gt;&lt;br /&gt;    &amp;lt;item name=&lt;span class=&quot;token string&quot;&gt;&quot;windowNoTitle&quot;&lt;/span&gt;&amp;gt;true&amp;lt;/item&amp;gt;&lt;br /&gt;    &amp;lt;!--We will be using the toolbar so no need to show ActionBar--&amp;gt;&lt;br /&gt;    &amp;lt;item name=&lt;span class=&quot;token string&quot;&gt;&quot;windowActionBar&quot;&lt;/span&gt;&amp;gt;false&amp;lt;/item&amp;gt;&lt;br /&gt;    &amp;lt;!-- Set theme colors from &lt;span class=&quot;token property&quot;&gt;http&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;//www&lt;span class=&quot;token number&quot;&gt;.&lt;/span&gt;google&lt;span class=&quot;token number&quot;&gt;.&lt;/span&gt;com/design/spec/style/color&lt;span class=&quot;token number&quot;&gt;.&lt;/span&gt;html#color-color-palette --&amp;gt;&lt;br /&gt;    &amp;lt;!-- colorPrimary is used for the default action bar background --&amp;gt;&lt;br /&gt;    &amp;lt;item name=&lt;span class=&quot;token string&quot;&gt;&quot;colorPrimary&quot;&lt;/span&gt;&amp;gt;&lt;span class=&quot;token hexcode&quot;&gt;#2196F3&lt;/span&gt;&amp;lt;/item&amp;gt;&lt;br /&gt;    &amp;lt;!-- colorPrimaryDark is used for the status bar --&amp;gt;&lt;br /&gt;    &amp;lt;item name=&lt;span class=&quot;token string&quot;&gt;&quot;colorPrimaryDark&quot;&lt;/span&gt;&amp;gt;&lt;span class=&quot;token hexcode&quot;&gt;#1976D2&lt;/span&gt;&amp;lt;/item&amp;gt;&lt;br /&gt;    &amp;lt;!-- colorAccent is used as the default value for colorControlActivated&lt;br /&gt;         which is used to tint widgets --&amp;gt;&lt;br /&gt;    &amp;lt;item name=&lt;span class=&quot;token string&quot;&gt;&quot;colorAccent&quot;&lt;/span&gt;&amp;gt;&lt;span class=&quot;token hexcode&quot;&gt;#FF4081&lt;/span&gt;&amp;lt;/item&amp;gt;&lt;br /&gt;    &amp;lt;!-- You can also set colorControlNormal, colorControlActivated&lt;br /&gt;         colorControlHighlight and colorSwitchThumbNormal&lt;span class=&quot;token number&quot;&gt;.&lt;/span&gt; --&amp;gt;&lt;br /&gt;    &amp;lt;item name=&lt;span class=&quot;token string&quot;&gt;&quot;windowActionModeOverlay&quot;&lt;/span&gt;&amp;gt;true&amp;lt;/item&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;item name=&lt;span class=&quot;token string&quot;&gt;&quot;android:datePickerDialogTheme&quot;&lt;/span&gt;&amp;gt;@style/AppCompatDialogStyle&amp;lt;/item&amp;gt;&lt;br /&gt;  &lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;style&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;AppCompatDialogStyle&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;parent&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Theme.AppCompat.Light.Dialog&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token style language-css&quot;&gt;&lt;br /&gt;    &amp;lt;item name=&lt;span class=&quot;token string&quot;&gt;&quot;colorAccent&quot;&lt;/span&gt;&amp;gt;&lt;span class=&quot;token hexcode&quot;&gt;#FF4081&lt;/span&gt;&amp;lt;/item&amp;gt;&lt;br /&gt;  &lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;resources&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;mainactivity&quot;&gt;MainActivity&lt;/h2&gt;&lt;p&gt;The attributes on MainActivity need to reference the theme, so it gets changed to&lt;/p&gt;&lt;pre class=&quot; language-fsharp&quot;&gt;&lt;code class=&quot;prism  language-fsharp&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Activity&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;Label &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Jon.FXam.Android&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; MainLauncher &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; Icon &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;@mipmap/icon&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; Theme &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;@style/MainTheme&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It builds.&lt;br&gt;It also runs, but at the moment it is only a blank screen.&lt;/p&gt;&lt;h1 id=&quot;content-page&quot;&gt;Content Page&lt;/h1&gt;&lt;p&gt;We are back to the Base Project.&lt;/p&gt;&lt;p&gt;I add &lt;code&gt;New Item&lt;/code&gt; to the project,  and select &lt;em&gt;Source File&lt;/em&gt;. There is no XAML option. That is something I will miss, but even in a C# project, XAML is optional.  I name it &lt;code&gt;Page1.fs&lt;/code&gt;, and create a very basic outline of Xamarin Forms Page.&lt;/p&gt;&lt;pre class=&quot; language-fsharp&quot;&gt;&lt;code class=&quot;prism  language-fsharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;namespace&lt;/span&gt; Jon&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;FXam&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;open&lt;/span&gt; Xamarin&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Forms&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;private&lt;/span&gt; Page1 &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;content&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt; layout &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;StackLayout&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;br /&gt;        layout&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Children&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Label&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;Text &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Welcome to F# &amp;amp; Xamarin Forms!&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;br /&gt;        layout&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;Page1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;inherit&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;ContentPage&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;Content &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; Page1&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I do not know if this is the best way to do this (F# is not the first language for me), but it is working, so, for now, I am happy.&lt;/p&gt;&lt;p&gt;Then reference that from &lt;code&gt;App&lt;/code&gt;.&lt;/p&gt;&lt;pre class=&quot; language-fsharp&quot;&gt;&lt;code class=&quot;prism  language-fsharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;App&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;inherit&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;Application&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;MainPage &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Page1&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It builds.&lt;br&gt;It runs.&lt;br&gt;It shows something on the screen.&lt;/p&gt;&lt;h1 id=&quot;follow-up-xaml&quot;&gt;Follow up (XAML)&lt;/h1&gt;&lt;p&gt;Visusal Studio for Mac has F# Xamarin projects (I am jelous). It also allows you to add XAML files to the project.&lt;/p&gt;&lt;h3 id=&quot;xaml-file&quot;&gt;XAML File&lt;/h3&gt;&lt;p&gt;Create an XML file in the &lt;em&gt;Forms&lt;/em&gt; project, call it &lt;code&gt;Page2.xaml&lt;/code&gt;&lt;/p&gt;&lt;pre class=&quot; language-xml&quot;&gt;&lt;code class=&quot;prism  language-xml&quot;&gt;&lt;span class=&quot;token prolog&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;ContentPage&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;xmlns&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;http://xamarin.com/schemas/2014/forms&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;             &lt;span class=&quot;token attr-name&quot;&gt;&lt;span class=&quot;token namespace&quot;&gt;xmlns:&lt;/span&gt;x&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;http://schemas.microsoft.com/winfx/2009/xaml&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;             &lt;span class=&quot;token attr-name&quot;&gt;&lt;span class=&quot;token namespace&quot;&gt;xmlns:&lt;/span&gt;local&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;clr-namespace:Jon.FXam&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;             &lt;span class=&quot;token attr-name&quot;&gt;&lt;span class=&quot;token namespace&quot;&gt;x:&lt;/span&gt;Class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Jon.FXam.Page2&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;Label&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Welcome to F# &lt;span class=&quot;token entity&quot; title=&quot;&amp;amp;&quot;&gt;&amp;amp;amp;&lt;/span&gt; Xamarin Forms, now with XAML!!!&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;VerticalOptions&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Center&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;HorizontalOptions&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Center&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;ContentPage&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Be sure to add the full namespace in &lt;code&gt;xmlns:local&lt;/code&gt;, and make sure you have the fully qualified class name in &lt;code&gt;x:Class&lt;/code&gt;.&lt;/p&gt;&lt;h3 id=&quot;code-file&quot;&gt;Code File&lt;/h3&gt;&lt;p&gt;Create an &lt;em&gt;F#&lt;/em&gt; file called &lt;code&gt;Page2.xaml.fs&lt;/code&gt;&lt;/p&gt;&lt;pre class=&quot; language-fsharp&quot;&gt;&lt;code class=&quot;prism  language-fsharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;namespace&lt;/span&gt; Jon&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;FXam&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;open&lt;/span&gt; Xamarin&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Forms&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;open&lt;/span&gt; Xamarin&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Forms&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Xaml&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;Page2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;br /&gt;   &lt;span class=&quot;token keyword&quot;&gt;inherit&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;ContentPage&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;br /&gt;   &lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt; _ &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;base&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;LoadFromXaml&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;typeof&lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt;Page2&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&quot;app&quot;&gt;App&lt;/h3&gt;&lt;p&gt;Set the application main page to &lt;code&gt;Page&lt;/code&gt;, in &lt;code&gt;App.fs&lt;/code&gt;&lt;/p&gt;&lt;pre class=&quot; language-fsharp&quot;&gt;&lt;code class=&quot;prism  language-fsharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;App&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;inherit&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;Application&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;MainPage &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Page2&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This base XAML page can now be coppied if more XAML pages are needed.&lt;/p&gt;&lt;h1 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h1&gt;&lt;p&gt;This is the point that I was wanting to get to, and I am happy here. Happy that it can be done, and happy that I have a base project that I can clone and use as a starting point.&lt;/p&gt;&lt;p&gt;To peruse, copy, or make fun of any of the code, please find it on &lt;a href=&quot;https://github.com/Thorocaine/JonathanPeelBlog/tree/master/Xamarin-F%23/FXam&quot;&gt;GitHub&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;/body&gt; &lt;/html&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.jonathanpeel.co.za/feeds/5702145850986705047/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.jonathanpeel.co.za/2019/02/xamarin-forms-with-f.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/1668188705279131313/posts/default/5702145850986705047'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/1668188705279131313/posts/default/5702145850986705047'/><link rel='alternate' type='text/html' href='https://www.jonathanpeel.co.za/2019/02/xamarin-forms-with-f.html' title='Xamarin Forms, with F#'/><author><name>Jonathan Peel</name><uri>http://www.blogger.com/profile/17062014578160115054</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1668188705279131313.post-3293334757925840046</id><published>2018-09-21T07:27:00.004-07:00</published><updated>2018-09-27T07:40:31.555-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="ReactiveUI"/><category scheme="http://www.blogger.com/atom/ns#" term="Rx"/><category scheme="http://www.blogger.com/atom/ns#" term="TDD"/><title type='text'>Reactive Unit Testing</title><content type='html'>&lt;!DOCTYPE html&gt;&lt;html&gt; &lt;head&gt;  &lt;meta charset=&quot;utf-8&quot;&gt;  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;  &lt;title&gt;Reactive Unit Testing&lt;/title&gt;  &lt;link rel=&quot;stylesheet&quot; href=&quot;https://stackedit.io/style.css&quot; /&gt;&lt;/head&gt; &lt;body class=&quot;stackedit&quot;&gt;  &lt;div class=&quot;stackedit__html&quot;&gt;&lt;h2 id=&quot;the-problem&quot;&gt;The problem&lt;/h2&gt;&lt;p&gt;I have done a project using &lt;a href=&quot;http://reactivex.io/&quot;&gt;Reactive Extentions&lt;/a&gt;, but I have not been able to figure out how to write unit tests for it.&lt;br&gt;My plan is o create a simple example I can use to try unit testing reactive code.&lt;/p&gt;&lt;h2 id=&quot;the-solution&quot;&gt;The solution&lt;/h2&gt;&lt;p&gt;To start with I am creating a new solution, with two projects, one is a simple .Net Standard project, and the other an XUnit project.&lt;br&gt;Add &lt;a href=&quot;https://www.nuget.org/packages/System.Reactive/&quot;&gt;System.Reactive&lt;/a&gt; to both projects, and add &lt;a href=&quot;https://www.nuget.org/packages/Microsoft.Reactive.Testing/&quot;&gt;Microsoft.Reactive.Testing&lt;/a&gt; to the test project.&lt;/p&gt;&lt;p&gt;I want to start with something simple, like a counter that will return the next value every seccond.&lt;/p&gt;&lt;h3 id=&quot;first-test&quot;&gt;First Test&lt;/h3&gt;&lt;p&gt;The first test will be to make sure it starts by returning a &lt;code&gt;0&lt;/code&gt;.&lt;br&gt;The outline of test class is:&lt;/p&gt;&lt;pre class=&quot; language-csharp&quot;&gt;&lt;code class=&quot;prism  language-csharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;using&lt;/span&gt; System&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Reactive&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Linq&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;using&lt;/span&gt; System&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Threading&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Tasks&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;using&lt;/span&gt; Jonathan&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;ReactiveProject&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;using&lt;/span&gt; Xunit&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;namespace&lt;/span&gt; Jonathan&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;ReactiveProjectTests&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;ReactiveObjectTests&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;Fact&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;async&lt;/span&gt; Task &lt;span class=&quot;token function&quot;&gt;Sequence_Recieves_0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;            &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; fixture &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;ReactiveObject&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;            &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; result &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;await&lt;/span&gt; fixture&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Sequence&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;FirstAsync&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;            Assert&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Equal&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; result&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This test is going to fail, becase we haven’t written anything to support it yet,&lt;br&gt;so we need to start with the minimum amount of code to allow the test to pass:&lt;/p&gt;&lt;pre class=&quot; language-csharp&quot;&gt;&lt;code class=&quot;prism  language-csharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;using&lt;/span&gt; System&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;using&lt;/span&gt; System&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Reactive&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Linq&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;namespace&lt;/span&gt; Jonathan&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;ReactiveProject&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;ReactiveObject&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; IObservable&lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt; Sequence &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; Observable&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Return&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&quot;a-test-with-a-schedualer&quot;&gt;A test with a schedualer&lt;/h3&gt;&lt;p&gt;I want to be able to recieve the next value, so the test needs to be a little more sofisticated.&lt;/p&gt;&lt;pre class=&quot; language-csharp&quot;&gt;&lt;code class=&quot;prism  language-csharp&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;Fact&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;async&lt;/span&gt; Task &lt;span class=&quot;token function&quot;&gt;Sequence_Recieves_1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; scheduler &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;TestScheduler&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; fixture &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;ReactiveObject&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;scheduler&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; result &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;    fixture&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Sequence&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Take&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Subscribe&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;x &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt; result &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; x&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;    scheduler&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Start&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;    Assert&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Equal&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; result&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We use a &lt;a href=&quot;http://www.introtorx.com/Content/v1.0.10621.0/15_SchedulingAndThreading.html&quot;&gt;Scheduler&lt;/a&gt; to help with the flow. If we implemented this we would repplace the &lt;code&gt;TestScheduler&lt;/code&gt; with something like &lt;code&gt;RxApp.MainThreadScheduler&lt;/code&gt;, or &lt;code&gt;Scheduler.CurrentThread&lt;/code&gt; depending on what thread we need the code to run on.&lt;/p&gt;&lt;p&gt;We &lt;code&gt;Take(2)&lt;/code&gt; because we want the second result (the first one being &lt;code&gt;0&lt;/code&gt;).&lt;/p&gt;&lt;p&gt;This test is not going to pass, so we need to update our &lt;code&gt;ReactiveObject&lt;/code&gt;:&lt;/p&gt;&lt;pre class=&quot; language-csharp&quot;&gt;&lt;code class=&quot;prism  language-csharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;ReactiveObject&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt; counter &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;ReactiveObject&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;IScheduler scheduler&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;        Sequence &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; Observable&lt;br /&gt;                  &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Interval&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;TimeSpan&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;FromSeconds&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; scheduler&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;br /&gt;                  &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Select&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;_ &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt; counter&lt;span class=&quot;token operator&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; IObservable&lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt; Sequence &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This breaks the first test, but we can remove that, and update out second &lt;code&gt;[Fact]&lt;/code&gt; to a &lt;code&gt;[Theory]&lt;/code&gt; to handle more options:&lt;/p&gt;&lt;pre class=&quot; language-csharp&quot;&gt;&lt;code class=&quot;prism  language-csharp&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;Theory&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;async&lt;/span&gt; Task &lt;span class=&quot;token function&quot;&gt;Sequence_Recieves&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt; expected&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; scheduler &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;TestScheduler&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; fixture &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;ReactiveObject&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;scheduler&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; result &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;    fixture&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Sequence&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Take&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;expected &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Subscribe&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;x &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt; result &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; x&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;    scheduler&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Start&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;    Assert&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Equal&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;expected&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; result&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This test should still pass, so lets add more inline data, and it should still work just fine:&lt;/p&gt;&lt;pre class=&quot; language-csharp&quot;&gt;&lt;code class=&quot;prism  language-csharp&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;10000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;100000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Because of how the &lt;code&gt;TestSchedualr&lt;/code&gt; works, this still runs very quickly, and we don’t have to wait 100000 seconds for the last one to run.&lt;/p&gt;&lt;h3 id=&quot;extra-tests&quot;&gt;Extra tests&lt;/h3&gt;&lt;p&gt;If we want to, we can also add a test that will check the range of results returned, I will start by copying the first test, and making a few modifications to it:&lt;/p&gt;&lt;pre class=&quot; language-csharp&quot;&gt;&lt;code class=&quot;prism  language-csharp&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;Theory&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;10000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;InlineData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;100000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;async&lt;/span&gt; Task &lt;span class=&quot;token function&quot;&gt;Sequence_Recieves_Range&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt; expected&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; expectedRange &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; Enumerable&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Range&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; expected &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; scheduler &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;TestScheduler&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; fixture &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;ReactiveObject&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;scheduler&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; resultRange &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;    fixture&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Sequence&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Take&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;expected &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Subscribe&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;x &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt; resultRange&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;x&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;    scheduler&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Start&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;    Assert&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Equal&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;expectedRange&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; resultRange&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;These tests also pass, so the next step will be to refactor.&lt;/p&gt;&lt;p&gt;I can’t see to much wrong in &lt;code&gt;ReactiveObject&lt;/code&gt; so I will refactor my test class;&lt;br&gt;I can take the scheduler and fixture out of each test method (Some people prefer to set up each test from scratch within each test, and not to mix anything, but for now I will take it out). There is also a lot of duplicated &lt;code&gt;InlineData&lt;/code&gt;, so I will see what can be done with that:&lt;/p&gt;&lt;pre class=&quot; language-csharp&quot;&gt;&lt;code class=&quot;prism  language-csharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;ReactiveObjectTests&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;readonly&lt;/span&gt; TestScheduler scheduler &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;TestScheduler&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;readonly&lt;/span&gt; ReactiveObject fixture&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;ReactiveObjectTests&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt; fixture &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;ReactiveObject&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;scheduler&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;Theory&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;MemberData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;nameof&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;GetTestData&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;Sequence_Recieves&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt; expected&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; result &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;        fixture&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Sequence&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Take&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;expected &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Subscribe&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;x &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt; result &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; x&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;        scheduler&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Start&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;        Assert&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Equal&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;expected&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; result&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;Theory&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;MemberData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;nameof&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;GetTestData&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;Sequence_Recieves_Range&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt; expected&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; expectedRange &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; Enumerable&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Range&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; expected &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; resultRange &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;        fixture&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Sequence&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Take&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;expected &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Subscribe&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;x &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt; resultRange&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;x&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;        scheduler&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Start&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;        Assert&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Equal&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;expectedRange&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; resultRange&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;static&lt;/span&gt; IEnumerable&lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;object&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;GetTestData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;10000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;100000&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;br /&gt;       &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Select&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;x &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; x &lt;span class=&quot;token keyword&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;object&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;done&quot;&gt;Done&lt;/h2&gt;&lt;p&gt;That is it for now, I really don’t know if this is bthe best way to do that, but it is more than what I have been able to figure out before.&lt;/p&gt;&lt;p&gt;If you have any questions, or suggestions, please leave a comment. If you would like to grab the code I was working on, it is on &lt;a href=&quot;https://github.com/Thorocaine/JonathanPeelBlog/tree/master/RX-TDD-01&quot;&gt;GitHub&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;&lt;/body&gt; &lt;/html&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.jonathanpeel.co.za/feeds/3293334757925840046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.jonathanpeel.co.za/2018/09/reactive-unit-testing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/1668188705279131313/posts/default/3293334757925840046'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/1668188705279131313/posts/default/3293334757925840046'/><link rel='alternate' type='text/html' href='https://www.jonathanpeel.co.za/2018/09/reactive-unit-testing.html' title='Reactive Unit Testing'/><author><name>Jonathan Peel</name><uri>http://www.blogger.com/profile/17062014578160115054</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>Sandton, South Africa</georss:featurename><georss:point>-26.1075663 28.056700699999965</georss:point><georss:box>-26.335796799999997 27.733977199999966 -25.8793358 28.379424199999963</georss:box></entry><entry><id>tag:blogger.com,1999:blog-1668188705279131313.post-7408299342857215458</id><published>2018-09-14T22:57:00.002-07:00</published><updated>2018-09-27T07:39:05.773-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="drink"/><category scheme="http://www.blogger.com/atom/ns#" term="kvass"/><category scheme="http://www.blogger.com/atom/ns#" term="ricipy"/><category scheme="http://www.blogger.com/atom/ns#" term="Russia"/><title type='text'>My recipe for Kvass</title><content type='html'>&lt;p&gt;I have been tweaking a personal &lt;a href=&quot;https://en.wikipedia.org/wiki/Kvass&quot;&gt;kvass&lt;/a&gt; recipy. I feel it has reached the point where it can be &lt;em&gt;written down&lt;/em&gt;, although there may still be some editing done to it.&lt;/p&gt;&lt;h2 id=&quot;ingrediants&quot;&gt;Ingrediants&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;500g rye bread&lt;/li&gt;&lt;li&gt;about 5&lt;i&gt;l&lt;/i&gt; water&lt;/li&gt;&lt;li&gt;raisons (optional)&lt;/li&gt;&lt;li&gt;100g sugar&lt;/li&gt;&lt;li&gt;10g brewers yeast&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;You also will need some muslin cloth.&lt;/p&gt;&lt;p&gt;&lt;small&gt;Try get 100% rye. I have tried 60% and 100%, and the pure rye bread makes it a lot better.&lt;br&gt;I don’t like it too sweet, so try this, and adjust your sugar if you need to.&lt;br&gt;For a while the only yeast I could find was instant yeast. This still works, but it seems to activate a bit quicker&lt;/small&gt;&lt;/p&gt;&lt;h2 id=&quot;process&quot;&gt;Process&lt;/h2&gt;&lt;h3 id=&quot;dry-the-bread&quot;&gt;Dry the bread&lt;/h3&gt;&lt;p&gt;The first thing you want to do is break the bread up a bit (I break each slice into qurters) and lay it out in an ovan tray. Bake the bread on about 180 until it has compltly dried out, turning it over once the top has dried out.&lt;/p&gt;&lt;p&gt;I find that it is best to pull it out just before the bread starts to burn. If it starts to smoke it has been in a little to long, but the point just before that is purfect.&lt;/p&gt;&lt;p&gt;You can also use a toaster, and just toast each slice of bread, that is up to you.&lt;/p&gt;&lt;h3 id=&quot;soak-bread&quot;&gt;Soak bread&lt;/h3&gt;&lt;p&gt;Put the bread into one or two large containers. I use two 3&lt;i&gt;l&lt;/i&gt; jugs. You could also a large pot, if that is what you have.&lt;/p&gt;&lt;p&gt;Throw in a handfull of rainsons.&lt;/p&gt;&lt;p&gt;Boil 4&lt;i&gt;l&lt;/i&gt; of water (in the kettle), and pour it over the bread. For me that is two kettles of 2&lt;i&gt;l&lt;/i&gt;, one for each jar.&lt;/p&gt;&lt;h3 id=&quot;caramel-water&quot;&gt;Caramel water&lt;/h3&gt;&lt;p&gt;In a small pot, carmalise about 60g of sugar, and disolve it into a leter of boiled water.&lt;/p&gt;&lt;h3 id=&quot;let-it-stand&quot;&gt;Let it stand&lt;/h3&gt;&lt;p&gt;Put the caramel water, and the bread jars aside and just let them cool down.&lt;br&gt;Time is needed for the bread to flavour the water, and you want to wait for both to be just above room temprature so you don’t harm the yeast when that is mixed in.&lt;/p&gt;&lt;h3 id=&quot;drain&quot;&gt;Drain&lt;/h3&gt;&lt;p&gt;Once the bread water is at room temprature, you can drain it into another pot.&lt;br&gt;Line a sift with muslin cloth, and pour the water through it, cathing bread chunks and raisons.&lt;/p&gt;&lt;p&gt;The bread can be thrown away, and the jars should be rinced out.&lt;/p&gt;&lt;h3 id=&quot;mix-yeast&quot;&gt;Mix yeast&lt;/h3&gt;&lt;p&gt;Mix 10g of yeast and 40g sugar into the caramel water. once it is mixed, pour the liquid back into the jars.&lt;/p&gt;&lt;p&gt;The mixture with the yeast needs time to brew. Keep it in a fairly warm place, with a towel over the jars to keep a bit of extra heat in.&lt;/p&gt;&lt;p&gt;Keep an eye on the liquid, you should see it forming a very fine foam layer on top. Let it stand for about half an hour longer, for the foam to start disapaiting.&lt;/p&gt;&lt;h3 id=&quot;bottle&quot;&gt;Bottle&lt;/h3&gt;&lt;p&gt;Line a funnle with muslin cloth, and slowly pour the liquid into old water or colddrink bottles.&lt;/p&gt;&lt;p&gt;Close the bottles, and put them in the fridge, at least over night.&lt;br&gt;It is drinkable the next day, but I find it best after about two days.&lt;/p&gt;&lt;h2 id=&quot;feedback&quot;&gt;Feedback&lt;/h2&gt;&lt;p&gt;Please let me know if you try this, and any of your own tweaks you add.&lt;/p&gt; </content><link rel='replies' type='application/atom+xml' href='https://www.jonathanpeel.co.za/feeds/7408299342857215458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.jonathanpeel.co.za/2018/09/kvass.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/1668188705279131313/posts/default/7408299342857215458'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/1668188705279131313/posts/default/7408299342857215458'/><link rel='alternate' type='text/html' href='https://www.jonathanpeel.co.za/2018/09/kvass.html' title='My recipe for Kvass'/><author><name>Jonathan Peel</name><uri>http://www.blogger.com/profile/17062014578160115054</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>Sandton, South Africa</georss:featurename><georss:point>-26.1075663 28.056700699999965</georss:point><georss:box>-26.335796799999997 27.733977199999966 -25.8793358 28.379424199999963</georss:box></entry></feed>