Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions benchmarks/ReactiveUI.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,15 @@
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
<OutputType>Exe</OutputType>
<CodeAnalysisRuleSet>..\src\reactiveui.tests.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

<ItemGroup>
<Compile Remove="ReactiveUI.Benchmarks\**" />
<EmbeddedResource Remove="ReactiveUI.Benchmarks\**" />
<None Remove="ReactiveUI.Benchmarks\**" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="DynamicData" Version="6.4.0.2419" />
<PackageReference Include="BenchmarkDotNet" Version="0.11.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFrameworks>net461</TargetFrameworks>
<IsPackable>false</IsPackable>
<CodeAnalysisRuleSet>..\..\src\reactiveui.tests.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

<ItemGroup>
Expand Down
29 changes: 24 additions & 5 deletions integrationtests/IntegrationTests.Shared/LoginViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
using Genesis.Ensure;
using ReactiveUI;
using System;
using System;
using System.Reactive;
using System.Reactive.Concurrency;
using System.Reactive.Linq;
using System.Threading;
using System.Threading.Tasks;
using Genesis.Ensure;
using ReactiveUI;

namespace IntegrationTests.Shared
{
/// <summary>
/// View model for login functionality.
/// </summary>
/// <seealso cref="ReactiveUI.ReactiveObject" />
public class LoginViewModel : ReactiveObject
{
private string _userName;
private string _password;
private IScheduler _mainScheduler;

/// <summary>
/// Initializes a new instance of the <see cref="LoginViewModel"/> class.
/// </summary>
/// <param name="mainScheduler">The main scheduler.</param>
public LoginViewModel(IScheduler mainScheduler)
{
Ensure.ArgumentNotNull(mainScheduler, nameof(mainScheduler));
Expand All @@ -25,8 +33,7 @@ public LoginViewModel(IScheduler mainScheduler)
.WhenAnyValue(
vm => vm.UserName,
vm => vm.Password,
(user, password) => !string.IsNullOrWhiteSpace(user) && !string.IsNullOrWhiteSpace(password)
);
(user, password) => !string.IsNullOrWhiteSpace(user) && !string.IsNullOrWhiteSpace(password));

Login = ReactiveCommand.CreateFromObservable(
() =>
Expand All @@ -38,16 +45,28 @@ public LoginViewModel(IScheduler mainScheduler)
Cancel = ReactiveCommand.Create(() => { }, Login.IsExecuting, _mainScheduler);
}

/// <summary>
/// Gets the login command.
/// </summary>
public ReactiveCommand<Unit, bool?> Login { get; }

/// <summary>
/// Gets the cancel command.
/// </summary>
public ReactiveCommand<Unit, Unit> Cancel { get; }

/// <summary>
/// Gets or sets the name of the user.
/// </summary>
public string UserName
{
get => _userName;
set => this.RaiseAndSetIfChanged(ref _userName, value);
}

/// <summary>
/// Gets or sets the password.
/// </summary>
public string Password
{
get => _password;
Expand Down