public void TestSample() { var serviceProvider = CreateServiceProvider(); var appViewModel = new AppViewModel(serviceProvider); MainPageViewModel viewModel = null; var action = Execute.OnUIThread(() => { viewModel = new MainPageViewModel(serviceProvider, appViewModel); }); Eventually.ShouldBecomeTrue(() => viewModel != null, DefaultTimeout); Eventually.ShouldBecomeTrue(() => viewModel.ConnectionInfo != null, DefaultTimeout); viewModel.ConnectionInfoTaskStatus.ShouldEqual(TaskStatus.RanToCompletion); viewModel.ConnectionInfo.Address.ToString().ShouldEqual("22.33.44.55"); viewModel.ConnectionInfo.Network.ToString().ShouldEqual("22.33.44.0/24"); Eventually.ShouldBecomeTrue(() => viewModel.DhcpInfo != null, DefaultTimeout); viewModel.DhcpInfoTaskStatus.ShouldEqual(TaskStatus.RanToCompletion); viewModel.DhcpInfo.GatewayAddress.ToString().ShouldEqual("100.101.102.103"); viewModel.DhcpInfo.DnsServerAddress.ToString().ShouldEqual("200.201.202.203"); viewModel.DhcpInfo.DomainName.ShouldEqual("my-domain-name"); Eventually.ShouldBecomeTrue(() => viewModel.ExternalAddress != null, DefaultTimeout); viewModel.ExternalAddressTaskStatus.ShouldEqual(TaskStatus.RanToCompletion); viewModel.ExternalAddress.ToString().ShouldEqual("50.51.52.53"); Eventually.ShouldBecomeTrue(() => viewModel.ScanCommand.CanExecute(null), DefaultTimeout); Eventually.ShouldBecomeFalse(() => viewModel.CancelScanCommand.CanExecute(null), DefaultTimeout); Eventually.ShouldBecomeTrue(() => viewModel.ShowServicesCommand.CanExecute(null), DefaultTimeout); viewModel.AvailableServices.ShouldBeEmpty(); viewModel.ProgressPercent.ShouldEqual(0.0d); viewModel.Status.ShouldEqual(String.Empty); viewModel.CustomSelectionCommands.Count.ShouldEqual(1); viewModel.CustomSelectionCommands.First().Label.ShouldEqual("select whole network"); viewModel.StartAddressValue.ShouldEqual(IPAddress.Parse("22.33.44.01").Value); viewModel.IsStartAddressValid.ShouldBeTrue(); viewModel.EndAddressValue.ShouldEqual(IPAddress.Parse("22.33.44.254").Value); viewModel.IsEndAddressValid.ShouldBeTrue(); }