Skip to content

Commit

Permalink
Merge branch 'feature/UpdateLibraries' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
SaDiablo committed Feb 3, 2024
2 parents 47fc15b + bc3cc4d commit d38220e
Show file tree
Hide file tree
Showing 12 changed files with 74 additions and 69 deletions.
8 changes: 8 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>

<PropertyGroup Condition=" '$(Configuration)' == 'Release'">
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
<TargetFramework>net8.0-windows</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release'">
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Autoupdater.NET.Official" Version="1.8.4" />
<PackageReference Include="Octokit" Version="0.50.0" />
Expand Down
7 changes: 3 additions & 4 deletions src/GenshinCompanion.Core/GenshinCompanion.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<AssemblyName>GenshinCompanion.Core</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release'">
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Prism.Wpf" Version="8.1.97" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,4 @@
<TargetFramework>netstandard2.1</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release'">
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>

</Project>
4 changes: 4 additions & 0 deletions src/GenshinCompanion.sln
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{DAD31B9E-80A4-4D2E-9622-DC6ADD45883C}"
ProjectSection(SolutionItems) = preProject
Tests\Directory.Build.props = Tests\Directory.Build.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GenshinCompanion.Modules.BannersModule.Tests", "Tests\GenshinCompanion.Modules.BannersModule.Tests\GenshinCompanion.Modules.BannersModule.Tests.csproj", "{E058444C-42F0-4CE1-9718-6DEA41BC75D0}"
EndProject
Expand All @@ -28,6 +31,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{265B4E1E-97A6-458A-BBAF-609D5F155D91}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
Global
Expand Down
12 changes: 6 additions & 6 deletions src/GenshinCompanion/GenshinCompanion.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
Expand All @@ -7,21 +8,20 @@
<AssemblyName>GenshinCompanion</AssemblyName>
<Version>1.2.1</Version>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release'">
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="4.4.0" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="4.4.0" />
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="5.0.3" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="5.0.3" />
<PackageReference Include="ModernWpfUI" Version="0.9.7-preview.2" />
<PackageReference Include="Prism.Unity" Version="8.1.97" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\GenshinCompanion.ApplicationUpdater\GenshinCompanion.ApplicationUpdater.csproj" />
<ProjectReference Include="..\GenshinCompanion.Core\GenshinCompanion.Core.csproj" />
<ProjectReference Include="..\Modules\GenshinCompanion.Modules.BannersModule\GenshinCompanion.Modules.BannersModule.csproj" />
<ProjectReference Include="..\Services\GenshinCompanion.Services.Interfaces\GenshinCompanion.Services.Interfaces.csproj" />
<ProjectReference Include="..\Services\GenshinCompanion.Services\GenshinCompanion.Services.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<AssemblyName>GenshinCompanion.Modules.BannersModule</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release'">
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="LiteDB" Version="5.0.17" />
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="4.4.0" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="4.4.0" />
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="5.0.3" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="5.0.3" />
<PackageReference Include="ModernWpfUI" Version="0.9.7-preview.2" />
<PackageReference Include="Prism.Wpf" Version="8.1.97" />
<PackageReference Include="System.Text.Json" Version="5.0.2" />
<PackageReference Include="System.Text.Json" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\GenshinCompanion.Core\GenshinCompanion.Core.csproj" />
<ProjectReference Include="..\..\Services\GenshinCompanion.Services.Interfaces\GenshinCompanion.Services.Interfaces.csproj" />
<ProjectReference Include="..\..\Services\GenshinCompanion.Services\GenshinCompanion.Services.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Update="Views\BannerControlProperty.xaml.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,5 @@
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release'">
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release'">
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Prism.Core" Version="8.1.97" />
<PackageReference Include="System.Text.Json" Version="5.0.2" />
<PackageReference Include="System.Text.Json" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\GenshinCompanion.CoreStandard\GenshinCompanion.CoreStandard.csproj" />
<ProjectReference Include="..\GenshinCompanion.Services.Interfaces\GenshinCompanion.Services.Interfaces.csproj" />
Expand Down
27 changes: 27 additions & 0 deletions src/Tests/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<Project>

<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release'">
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,28 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release'">
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="1.2.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<ProjectReference Include="..\..\Modules\GenshinCompanion.Modules.BannersModule\GenshinCompanion.Modules.BannersModule.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
using GenshinCompanion.Modules.BannersModule.ViewModels;
using GenshinCompanion.Services.Interfaces;
using Moq;
using NSubstitute;
using Prism.Regions;
using Xunit;

namespace GenshinCompanion.Modules.BannersModule.Tests.ViewModels
{
public class CharacterBannerViewModelFixture
{
private readonly Mock<IMessageService> _messageServiceMock;
private readonly Mock<IRegionManager> _regionManagerMock;
//private const string MessageServiceDefaultMessage = "Some Value";
private readonly IMessageService _messageServiceMock;
private readonly IRegionManager _regionManagerMock;

public CharacterBannerViewModelFixture()
{
var messageService = new Mock<IMessageService>();
//messageService.Setup(x => x.GetMessage()).Returns(MessageServiceDefaultMessage);
_messageServiceMock = messageService;

_regionManagerMock = new Mock<IRegionManager>();
_messageServiceMock = Substitute.For<IMessageService>();
_regionManagerMock = Substitute.For<IRegionManager>();
}

[Fact]
public void MessagePropertyValueUpdated()
{
var vm = new BannersViewModel(_regionManagerMock.Object, _messageServiceMock.Object);
var vm = new BannersViewModel(_regionManagerMock, _messageServiceMock);

//_messageServiceMock.Verify(x => x.GetMessage(), Times.Once);
// Assuming GetMessage() returns a string
//_messageServiceMock.Received(1).GetMessage();

// Assuming Message is a property
//Assert.Equal(MessageServiceDefaultMessage, vm.Message);
}

[Fact]
public void MessageINotifyPropertyChangedCalled()
{
var vm = new BannersViewModel(_regionManagerMock.Object, _messageServiceMock.Object);
var vm = new BannersViewModel(_regionManagerMock, _messageServiceMock);

// Assuming Message is a property
//Assert.PropertyChanged(vm, nameof(vm.Message), () => vm.Message = "Changed");
}
}
Expand Down

0 comments on commit d38220e

Please sign in to comment.