Saving initial MSTest configuration
First part of installing an MSTest suite. Included some config file to read in for testing the ShortcutRepository and the ProfileRepository. Had the data handy so it made sense to save it :)
@ -134,14 +134,25 @@ namespace HeliosPlus.Shared
|
||||
{
|
||||
get
|
||||
{
|
||||
IEnumerable<Display> currentDisplays = WindowsDisplayAPI.Display.GetDisplays();
|
||||
foreach (Display availableDisplay in currentDisplays)
|
||||
{
|
||||
if (availableDisplay.IsAvailable)
|
||||
Console.WriteLine("");
|
||||
}
|
||||
|
||||
// Find the list of TargetDisplays we currently have from the currentprofile
|
||||
List<string> availableDevicePaths = new List<string>();
|
||||
ProfileViewport[] availableViewports = ProfileRepository.CurrentProfile.Viewports;
|
||||
|
||||
foreach (ProfileViewport availableViewport in availableViewports)
|
||||
{
|
||||
PathInfo pathInfo = availableViewport.ToPathInfo();
|
||||
//pathInfo.TargetsInfo;
|
||||
foreach (ProfileViewportTargetDisplay realTD in availableViewport.TargetDisplays)
|
||||
{
|
||||
availableDevicePaths.Add(realTD.DevicePath);
|
||||
string devicePath = realTD.DevicePath;
|
||||
availableDevicePaths.Add(devicePath);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ namespace HeliosPlus.Shared
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Class Methods
|
||||
public static bool AddProfile(ProfileItem Profile)
|
||||
{
|
||||
@ -156,6 +156,7 @@ namespace HeliosPlus.Shared
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static bool RemoveProfile(ProfileItem Profile)
|
||||
{
|
||||
if (!(Profile is ProfileItem))
|
||||
|
BIN
HeliosPlus.Tests/Data/Profiles/DisplayProfiles_1.0.json
Normal file
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 35 KiB |
BIN
HeliosPlus.Tests/Data/Shortcuts/Shortcuts_1.0.json
Normal file
After Width: | Height: | Size: 53 KiB |
After Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 59 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 81 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 43 KiB |
78
HeliosPlus.Tests/HeliosPlus.Tests.csproj
Normal file
@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{D7AFD3CC-53BF-4991-ABFE-638A3F355310}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>HeliosPlus.Tests</RootNamespace>
|
||||
<AssemblyName>HeliosPlus.Tests</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
|
||||
<IsCodedUITest>False</IsCodedUITest>
|
||||
<TestProjectType>UnitTest</TestProjectType>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MSTest.TestFramework.2.1.1\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MSTest.TestFramework.2.1.1\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="UnitTest1.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\HeliosPlus.Shared\HeliosPlus.Shared.csproj">
|
||||
<Project>{1cacda43-01c7-4cd4-bf6e-9421a29510fc}</Project>
|
||||
<Name>HeliosPlus.Shared</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\HeliosPlus\HeliosPlus.csproj">
|
||||
<Project>{608d941a-b431-400c-a91d-c6f971c29577}</Project>
|
||||
<Name>HeliosPlus</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.props'))" />
|
||||
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.targets')" />
|
||||
</Project>
|
20
HeliosPlus.Tests/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyTitle("HeliosPlus.Tests")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("HeliosPlus.Tests")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
[assembly: Guid("d7afd3cc-53bf-4991-abfe-638a3f355310")]
|
||||
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
15
HeliosPlus.Tests/UnitTest1.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace HeliosPlus.Tests
|
||||
{
|
||||
[TestClass]
|
||||
public class UnitTest1
|
||||
{
|
||||
[TestMethod]
|
||||
public void TestMethod1()
|
||||
{
|
||||
Assert.IsTrue(true);
|
||||
}
|
||||
}
|
||||
}
|
5
HeliosPlus.Tests/packages.config
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="MSTest.TestAdapter" version="2.1.1" targetFramework="net472" />
|
||||
<package id="MSTest.TestFramework" version="2.1.1" targetFramework="net472" />
|
||||
</packages>
|
21
HeliosPlus.Tests1/HeliosPlus.Tests.csproj
Normal file
@ -0,0 +1,21 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="nunit" Version="3.12.0" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\HeliosPlus.Reporting\HeliosPlus.Reporting.csproj" />
|
||||
<ProjectReference Include="..\HeliosPlus.Shared\HeliosPlus.Shared.csproj" />
|
||||
<ProjectReference Include="..\HeliosPlus\HeliosPlus.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
20
HeliosPlus.Tests1/UnitTest1.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using NUnit.Framework;
|
||||
using System.IO;
|
||||
using System;
|
||||
|
||||
namespace HeliosPlus.Tests
|
||||
{
|
||||
public class Tests
|
||||
{
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test1()
|
||||
{
|
||||
Assert.Pass();
|
||||
}
|
||||
}
|
||||
}
|
@ -10,6 +10,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeliosPlus.Shared", "Helios
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeliosPlus.Reporting", "HeliosPlus.Reporting\HeliosPlus.Reporting.csproj", "{76DF2BCF-911B-4820-B63E-8F3468DB5E79}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeliosPlus.Tests", "HeliosPlus.Tests\HeliosPlus.Tests.csproj", "{D7AFD3CC-53BF-4991-ABFE-638A3F355310}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|AnyCPU = Debug|AnyCPU
|
||||
@ -32,6 +34,10 @@ Global
|
||||
{76DF2BCF-911B-4820-B63E-8F3468DB5E79}.Debug|AnyCPU.Build.0 = Debug|Any CPU
|
||||
{76DF2BCF-911B-4820-B63E-8F3468DB5E79}.Release|AnyCPU.ActiveCfg = Release|Any CPU
|
||||
{76DF2BCF-911B-4820-B63E-8F3468DB5E79}.Release|AnyCPU.Build.0 = Release|Any CPU
|
||||
{D7AFD3CC-53BF-4991-ABFE-638A3F355310}.Debug|AnyCPU.ActiveCfg = Debug|Any CPU
|
||||
{D7AFD3CC-53BF-4991-ABFE-638A3F355310}.Debug|AnyCPU.Build.0 = Debug|Any CPU
|
||||
{D7AFD3CC-53BF-4991-ABFE-638A3F355310}.Release|AnyCPU.ActiveCfg = Release|Any CPU
|
||||
{D7AFD3CC-53BF-4991-ABFE-638A3F355310}.Release|AnyCPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -685,6 +685,10 @@ namespace HeliosPlus
|
||||
if (ProfileRepository.IsActiveProfile(profile))
|
||||
return true;
|
||||
|
||||
// We need to check if the profile is valid
|
||||
if (!profile.IsPossible)
|
||||
return false;
|
||||
|
||||
var instanceStatus = IPCService.GetInstance().Status;
|
||||
|
||||
try
|
||||
|