Add a basic ControlPanel test to reference it for coverage

This commit is contained in:
Cyberboss
2017-11-11 17:07:20 -05:00
parent f0e6f36922
commit cf491cd947
2 changed files with 31 additions and 0 deletions
@@ -0,0 +1,29 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using System.Collections.Generic;
using TGServiceInterface;
using TGServiceInterface.Components;
namespace TGControlPanel.Tests
{
/// <summary>
/// Tests for <see cref="InstanceSelector"/>
/// </summary>
[TestClass]
public class TestInstanceSelector
{
/// <summary>
/// Test that an <see cref="InstanceSelector"/> can be created without issue
/// </summary>
[TestMethod]
public void TestInstatiation()
{
var mockLanding = new Mock<ITGLanding>();
mockLanding.Setup(x => x.ListInstances()).Returns(new List<InstanceMetadata>());
var mockInter = new Mock<IInterface>();
mockInter.Setup(x => x.GetComponent<ITGLanding>()).Returns(mockLanding.Object);
new InstanceSelector(mockInter.Object).Dispose();
}
}
}
+2
View File
@@ -57,11 +57,13 @@
<Reference Include="System.Configuration" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<Compile Include="CommandLine\Commands\Repository\RepositoryCommandTest.cs" />
<Compile Include="CommandLine\Commands\Repository\TestRepoSetPushTestmergeCommitsCommand.cs" />
<Compile Include="CommandLine\Commands\Repository\TestRepoStatusCommand.cs" />
<Compile Include="ControlPanel\TestInstanceSelector.cs" />
<Compile Include="Interface\TestHelpers.cs" />
<Compile Include="Interface\TestInterface.cs" />
<Compile Include="OutputProcOverriderTest.cs" />