This repository has been archived by the owner on Jun 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net462</TargetFramework> | ||
|
||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="coverlet.msbuild" Version="2.2.1" /> | ||
<PackageReference Include="FluentAssertions" Version="5.4.1" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" /> | ||
<PackageReference Include="ReactiveUI.Testing" Version="8.3.1" /> | ||
<PackageReference Include="xunit" Version="2.4.0" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" /> | ||
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\ModSink.WPF\ModSink.WPF.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System; | ||
using DynamicData; | ||
using FluentAssertions; | ||
using ModSink.Common.Models.Repo; | ||
using ModSink.WPF.ViewModel; | ||
using Xunit; | ||
|
||
namespace ModSink.WPF.Tests.ViewModel | ||
{ | ||
public class LibraryViewModelTests | ||
{ | ||
[Fact] | ||
public void ModpacksContructorInitialization() | ||
{ | ||
var source = new SourceCache<Modpack, Guid>(_ => Guid.NewGuid()); | ||
var vm = new LibraryViewModel(source); | ||
vm.Modpacks.Should().HaveCount(0); | ||
source.AddOrUpdate(new Modpack()); | ||
vm.Modpacks.Should().HaveCount(1); | ||
} | ||
|
||
[Fact] | ||
public void SelectedModpackNotifies() | ||
{ | ||
var source = new SourceCache<Modpack, Guid>(_ => Guid.NewGuid()); | ||
var vm = new LibraryViewModel(source); | ||
using (var monitor = vm.Monitor()) | ||
{ | ||
vm.SelectedModpack = new Modpack(); | ||
monitor.Should().RaisePropertyChangeFor(x => x.SelectedModpack); | ||
} | ||
} | ||
} | ||
} |