Commits

Christian Specht committed 8ba437a Draft

add first test for WPF launcher app

  • Participants
  • Parent commits baaf7bc

Comments (0)

Files changed (2)

File src/MissileSharp.Tests/Launcher/MainWindowViewModelTests.cs

+using MissileSharp.Launcher.ViewModels;
+using NUnit.Framework;
+
+namespace MissileSharp.Tests.Launcher
+{
+    [TestFixture]
+    public class MainWindowViewModelTests
+    {
+        private MainWindowViewModel viewmodel;
+        
+        [SetUp]
+        public void Setup()
+        {
+            var config = new string[]
+            {
+                "[name1]",
+                "up,5",
+                "[name2]",
+                "up,5"
+            };
+
+            viewmodel = new MainWindowViewModel(config);
+        }
+
+        [Test]
+        public void Constructor_ConfigWithTwoCommandSets_ObservableCollectionContainsTwoNames()
+        {
+            Assert.AreEqual(2, viewmodel.CommandSets.Count);
+        }
+    }
+}

File src/MissileSharp.Tests/MissileSharp.Tests.csproj

       <SubType>Code</SubType>
     </Compile>
     <Compile Include="LauncherCommandTests.cs" />
+    <Compile Include="Launcher\MainWindowViewModelTests.cs" />
     <Compile Include="MockHidDevice.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="StubMissileLauncher.cs" />
     <None Include="packages.config" />
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\MissileSharp.Launcher\MissileSharp.Launcher.csproj">
+      <Project>{84C01C0B-3CBA-423B-B5EF-0235C40BBA61}</Project>
+      <Name>MissileSharp.Launcher</Name>
+    </ProjectReference>
     <ProjectReference Include="..\MissileSharp\MissileSharp.csproj">
       <Project>{5B260FC8-DD55-40F3-A545-727BB7B6221B}</Project>
       <Name>MissileSharp</Name>