Skip to content

Commit

Permalink
Adding unit tests back into the solution.
Browse files Browse the repository at this point in the history
  • Loading branch information
brentedwards committed Oct 2, 2014
1 parent 35b9950 commit 991386e
Show file tree
Hide file tree
Showing 40 changed files with 2,190 additions and 1 deletion.
54 changes: 54 additions & 0 deletions Charmed.Sample.Universal.sln
Expand Up @@ -19,6 +19,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Charmed.Universal.Windows",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Charmed.Universal.WindowsPhone", "Charmed.Universal\Charmed.Universal.WindowsPhone\Charmed.Universal.WindowsPhone.csproj", "{2B0CDD56-7DB9-46AA-85B8-54C07DC3921B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Charmed.Sample.Universal.Tests", "Charmed.Sample.Universal\Charmed.Sample.Universal.Tests\Charmed.Sample.Universal.Tests.csproj", "{7F2C3442-A0B6-4235-8ACA-113AB63480ED}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Charmed.Universal.Tests", "Charmed.Universal\Charmed.Universal.Tests\Charmed.Universal.Tests.csproj", "{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Charmed.Sample.Universal\Charmed.Sample.Universal.Shared\Charmed.Sample.Universal.Shared.projitems*{7a7cff9f-c3c3-440f-ad9f-18ec15cbb145}*SharedItemsImports = 13
Expand Down Expand Up @@ -113,6 +117,54 @@ Global
{2B0CDD56-7DB9-46AA-85B8-54C07DC3921B}.Release|x64.ActiveCfg = Release|Any CPU
{2B0CDD56-7DB9-46AA-85B8-54C07DC3921B}.Release|x86.ActiveCfg = Release|x86
{2B0CDD56-7DB9-46AA-85B8-54C07DC3921B}.Release|x86.Build.0 = Release|x86
{7F2C3442-A0B6-4235-8ACA-113AB63480ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7F2C3442-A0B6-4235-8ACA-113AB63480ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7F2C3442-A0B6-4235-8ACA-113AB63480ED}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{7F2C3442-A0B6-4235-8ACA-113AB63480ED}.Debug|ARM.ActiveCfg = Debug|ARM
{7F2C3442-A0B6-4235-8ACA-113AB63480ED}.Debug|ARM.Build.0 = Debug|ARM
{7F2C3442-A0B6-4235-8ACA-113AB63480ED}.Debug|ARM.Deploy.0 = Debug|ARM
{7F2C3442-A0B6-4235-8ACA-113AB63480ED}.Debug|x64.ActiveCfg = Debug|x64
{7F2C3442-A0B6-4235-8ACA-113AB63480ED}.Debug|x64.Build.0 = Debug|x64
{7F2C3442-A0B6-4235-8ACA-113AB63480ED}.Debug|x64.Deploy.0 = Debug|x64
{7F2C3442-A0B6-4235-8ACA-113AB63480ED}.Debug|x86.ActiveCfg = Debug|x86
{7F2C3442-A0B6-4235-8ACA-113AB63480ED}.Debug|x86.Build.0 = Debug|x86
{7F2C3442-A0B6-4235-8ACA-113AB63480ED}.Debug|x86.Deploy.0 = Debug|x86
{7F2C3442-A0B6-4235-8ACA-113AB63480ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7F2C3442-A0B6-4235-8ACA-113AB63480ED}.Release|Any CPU.Build.0 = Release|Any CPU
{7F2C3442-A0B6-4235-8ACA-113AB63480ED}.Release|Any CPU.Deploy.0 = Release|Any CPU
{7F2C3442-A0B6-4235-8ACA-113AB63480ED}.Release|ARM.ActiveCfg = Release|ARM
{7F2C3442-A0B6-4235-8ACA-113AB63480ED}.Release|ARM.Build.0 = Release|ARM
{7F2C3442-A0B6-4235-8ACA-113AB63480ED}.Release|ARM.Deploy.0 = Release|ARM
{7F2C3442-A0B6-4235-8ACA-113AB63480ED}.Release|x64.ActiveCfg = Release|x64
{7F2C3442-A0B6-4235-8ACA-113AB63480ED}.Release|x64.Build.0 = Release|x64
{7F2C3442-A0B6-4235-8ACA-113AB63480ED}.Release|x64.Deploy.0 = Release|x64
{7F2C3442-A0B6-4235-8ACA-113AB63480ED}.Release|x86.ActiveCfg = Release|x86
{7F2C3442-A0B6-4235-8ACA-113AB63480ED}.Release|x86.Build.0 = Release|x86
{7F2C3442-A0B6-4235-8ACA-113AB63480ED}.Release|x86.Deploy.0 = Release|x86
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}.Debug|ARM.ActiveCfg = Debug|ARM
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}.Debug|ARM.Build.0 = Debug|ARM
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}.Debug|ARM.Deploy.0 = Debug|ARM
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}.Debug|x64.ActiveCfg = Debug|x64
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}.Debug|x64.Build.0 = Debug|x64
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}.Debug|x64.Deploy.0 = Debug|x64
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}.Debug|x86.ActiveCfg = Debug|x86
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}.Debug|x86.Build.0 = Debug|x86
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}.Debug|x86.Deploy.0 = Debug|x86
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}.Release|Any CPU.Build.0 = Release|Any CPU
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}.Release|Any CPU.Deploy.0 = Release|Any CPU
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}.Release|ARM.ActiveCfg = Release|ARM
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}.Release|ARM.Build.0 = Release|ARM
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}.Release|ARM.Deploy.0 = Release|ARM
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}.Release|x64.ActiveCfg = Release|x64
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}.Release|x64.Build.0 = Release|x64
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}.Release|x64.Deploy.0 = Release|x64
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}.Release|x86.ActiveCfg = Release|x86
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}.Release|x86.Build.0 = Release|x86
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4}.Release|x86.Deploy.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -124,5 +176,7 @@ Global
{4ED055D7-6718-4FAA-8871-57D9501D5C49} = {FB99FFA2-BED1-43D0-BA03-2D4AB8821DF8}
{46FE6513-8712-4090-950B-3BD225BA80FC} = {FB99FFA2-BED1-43D0-BA03-2D4AB8821DF8}
{2B0CDD56-7DB9-46AA-85B8-54C07DC3921B} = {FB99FFA2-BED1-43D0-BA03-2D4AB8821DF8}
{7F2C3442-A0B6-4235-8ACA-113AB63480ED} = {000EDA9C-A380-4C4D-8454-1BAEB0076053}
{3F803A2B-3F13-4C8E-BEE4-AAA802893CD4} = {FB99FFA2-BED1-43D0-BA03-2D4AB8821DF8}
EndGlobalSection
EndGlobal
@@ -0,0 +1,183 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<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>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{7F2C3442-A0B6-4235-8ACA-113AB63480ED}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Charmed.Sample.Tests</RootNamespace>
<AssemblyName>Charmed.Sample.Universal.Tests</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformVersion>8.1</TargetPlatformVersion>
<MinimumVisualStudioVersion>12</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<PackageCertificateKeyFile>Charmed.Sample.Universal.Tests_TemporaryKey.pfx</PackageCertificateKeyFile>
<AppxBundle>Never</AppxBundle>
<AllowCrossPlatformRetargeting>False</AllowCrossPlatformRetargeting>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE</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;NETFX_CORE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<AppXPackage>True</AppXPackage>
<AppxPackageIncludePrivateSymbols>true</AppxPackageIncludePrivateSymbols>
</PropertyGroup>
<ItemGroup>
<!--A reference to the entire .Net Framework and Windows SDK are automatically included-->
<SDKReference Include="MSTestFramework, Version=11.0" />
<SDKReference Include="TestPlatform, Version=11.0" />
</ItemGroup>
<ItemGroup>
<Compile Include="Mocks\MessageBusMock.cs" />
<Compile Include="Mocks\MockHelper.cs" />
<Compile Include="Mocks\NavigatorMock.cs" />
<Compile Include="Mocks\RssFeedServiceMock.cs" />
<Compile Include="Mocks\SecondaryPinnerMock.cs" />
<Compile Include="Mocks\SerializerMock.cs" />
<Compile Include="Mocks\SettingsManagerMock.cs" />
<Compile Include="Mocks\SettingsMock.cs" />
<Compile Include="Mocks\ShareManagerMock.cs" />
<Compile Include="Mocks\StorageMock.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ViewModels\FeedItemViewModelTests.cs" />
<Compile Include="ViewModels\MainViewModelTests.cs" />
<Compile Include="ViewModels\SettingsViewModelTests.cs" />
<Compile Include="ViewModels\ShellViewModelTests.cs" />
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
<None Include="Charmed.Sample.Universal.Tests_TemporaryKey.pfx" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="Images\UnitTestLogo.scale-100.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\UnitTestSmallLogo.scale-100.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\UnitTestSplashScreen.scale-100.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\UnitTestStoreLogo.scale-100.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Charmed.Universal\Charmed.Universal.Windows\Charmed.Universal.Windows.csproj">
<Project>{46fe6513-8712-4090-950b-3bd225ba80fc}</Project>
<Name>Charmed.Universal.Windows</Name>
</ProjectReference>
<ProjectReference Include="..\Charmed.Sample.Universal.Windows\Charmed.Sample.Universal.Windows.csproj">
<Project>{a5b33b78-139e-44c4-bd00-a383844d16b6}</Project>
<Name>Charmed.Sample.Universal.Windows</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '12.0' ">
<VisualStudioVersion>12.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable 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('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,35 @@
using Charmed.Messaging;
using System;

namespace Charmed.Sample.Tests.Mocks
{
public class MessageBusMock : IMessageBus
{
public Action<object> SubscribeDelegate { get; set; }
public void Subscribe<TMessage>(Action<TMessage> handler)
{
if (SubscribeDelegate != null)
{
SubscribeDelegate(handler);
}
}

public Action<object> UnsubscribeDelegate { get; set; }
public void Unsubscribe<TMessage>(Action<TMessage> handler)
{
if (UnsubscribeDelegate != null)
{
UnsubscribeDelegate(handler);
}
}

public Action<object> PublishDelegate { get; set; }
public void Publish<TMessage>(TMessage message)
{
if (PublishDelegate != null)
{
PublishDelegate(message);
}
}
}
}

0 comments on commit 991386e

Please sign in to comment.