Skip to content

Commit

Permalink
Tried adding Unit Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
modiholodri committed Feb 1, 2017
1 parent ad98e50 commit 4a5998f
Show file tree
Hide file tree
Showing 10 changed files with 333 additions and 17 deletions.
24 changes: 21 additions & 3 deletions Movie File Merger.sln
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
# SharpDevelop 5.1
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 14 for Windows Desktop
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Movie File Merger", "Movie File Merger\Movie File Merger.csproj", "{58266960-EA2C-447E-9084-40D36650E7A7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Movie File MergerTests", "Movie File MergerTests\Movie File MergerTests.csproj", "{CE40EB5C-69A1-40BB-8A53-45A61BAD7EBB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{58266960-EA2C-447E-9084-40D36650E7A7}.Debug|Any CPU.ActiveCfg = Debug|x86
{58266960-EA2C-447E-9084-40D36650E7A7}.Debug|x86.ActiveCfg = Debug|x86
{58266960-EA2C-447E-9084-40D36650E7A7}.Debug|x86.Build.0 = Debug|x86
{58266960-EA2C-447E-9084-40D36650E7A7}.Release|Any CPU.ActiveCfg = Release|x86
{58266960-EA2C-447E-9084-40D36650E7A7}.Release|x86.ActiveCfg = Release|x86
{58266960-EA2C-447E-9084-40D36650E7A7}.Release|x86.Build.0 = Release|x86
{CE40EB5C-69A1-40BB-8A53-45A61BAD7EBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CE40EB5C-69A1-40BB-8A53-45A61BAD7EBB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CE40EB5C-69A1-40BB-8A53-45A61BAD7EBB}.Debug|x86.ActiveCfg = Debug|Any CPU
{CE40EB5C-69A1-40BB-8A53-45A61BAD7EBB}.Debug|x86.Build.0 = Debug|Any CPU
{CE40EB5C-69A1-40BB-8A53-45A61BAD7EBB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CE40EB5C-69A1-40BB-8A53-45A61BAD7EBB}.Release|Any CPU.Build.0 = Release|Any CPU
{CE40EB5C-69A1-40BB-8A53-45A61BAD7EBB}.Release|x86.ActiveCfg = Release|Any CPU
{CE40EB5C-69A1-40BB-8A53-45A61BAD7EBB}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
4 changes: 2 additions & 2 deletions Movie File Merger/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions Movie File Merger/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace Movie_File_Merger
/// <summary>
/// Application to selectively combine collections on hard disks.
/// </summary>
public partial class MainForm : Form {
public partial class MFMForm : Form {
ListView lvDragSource = null; // the list view from which has been dragged
Color DragColor = Color.Red; // the color of the item which has been dragged
string[] saCollections = { "Miscellaneous", "Adults", "Movies", "Documentaries", "Series", "Clips" }; // all collections
Expand Down Expand Up @@ -94,7 +94,7 @@ public partial class MainForm : Form {
/// <summary>
/// MFM main form to selectivley combine video collections
/// </summary>
public MainForm( )
public MFMForm( )
{
InitializeComponent( );
LogInfo( "Initializing Movie File Merger..." );
Expand Down Expand Up @@ -182,25 +182,25 @@ public MainForm( )
/// <summary>
/// Converts a datetime to the standard date format yyyy-mm-dd.
/// </summary>
/// <param name="dtToSStandardize">The date time to standardize.</param>
/// <param name="dtToStandardize">The date time to standardize.</param>
/// <returns>The standzadized date string.</returns>
string StandardizeDate( DateTime dtToSStandardize )
public string StandardizeDate( DateTime dtToStandardize )
{
return dtToSStandardize.Year.ToString( "D4" ) + "-" +
dtToSStandardize.Month.ToString( "D2" ) + "-" +
dtToSStandardize.Day.ToString( "D2" );
return dtToStandardize.Year.ToString( "D4" ) + "-" +
dtToStandardize.Month.ToString( "D2" ) + "-" +
dtToStandardize.Day.ToString( "D2" );
}

/// <summary>
/// Converts a datetime to the standard time format hh:mm:ss.
/// </summary>
/// <param name="dtToSStandardize">The date time to standardize.</param>
/// <returns>The standzadized time string.</returns>
string StandardizeTime( DateTime dtToSStandardize )
string StandardizeTime( DateTime dtToStandardize )
{
return dtToSStandardize.Hour.ToString( "D2" ) + "-" +
dtToSStandardize.Minute.ToString( "D2" ) + "-" +
dtToSStandardize.Second.ToString( "D2" );
return dtToStandardize.Hour.ToString( "D2" ) + "-" +
dtToStandardize.Minute.ToString( "D2" ) + "-" +
dtToStandardize.Second.ToString( "D2" );
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Movie File Merger/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ private static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
Application.Run(new MFMForm());
}

}
Expand Down
17 changes: 17 additions & 0 deletions Movie File MergerTests/MFMFormTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Movie_File_Merger;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Movie_File_Merger.Tests {
[TestClass( )]
public class MFMFormTests {
[TestMethod( )]
public void StandardizeDateTest( )
{

}
}
}
90 changes: 90 additions & 0 deletions Movie File MergerTests/Movie File MergerTests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{CE40EB5C-69A1-40BB-8A53-45A61BAD7EBB}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Movie_File_MergerTests</RootNamespace>
<AssemblyName>Movie File MergerTests</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.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>
<TargetFrameworkProfile />
</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="System" />
</ItemGroup>
<Choose>
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
</ItemGroup>
</Otherwise>
</Choose>
<ItemGroup>
<Compile Include="MFMFormTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Movie File Merger\Movie File Merger.csproj">
<Project>{58266960-EA2C-447E-9084-40D36650E7A7}</Project>
<Name>Movie File Merger</Name>
</ProjectReference>
</ItemGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
</ItemGroup>
</When>
</Choose>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- 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>
36 changes: 36 additions & 0 deletions Movie File MergerTests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle( "Movie File MergerTests" )]
[assembly: AssemblyDescription( "" )]
[assembly: AssemblyConfiguration( "" )]
[assembly: AssemblyCompany( "" )]
[assembly: AssemblyProduct( "Movie File MergerTests" )]
[assembly: AssemblyCopyright( "Copyright © 2017" )]
[assembly: AssemblyTrademark( "" )]
[assembly: AssemblyCulture( "" )]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible( false )]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid( "ce40eb5c-69a1-40bb-8a53-45a61bad7ebb" )]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "1.0.0.0" )]
[assembly: AssemblyFileVersion( "1.0.0.0" )]
90 changes: 90 additions & 0 deletions MovieFileMergerTest/Movie File Merger Test.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0E1265E4-8AFF-46B2-9A69-04588917C568}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MovieFileMergerTest</RootNamespace>
<AssemblyName>MovieFileMergerTest</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.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>
</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="System" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<Choose>
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
</ItemGroup>
</Otherwise>
</Choose>
<ItemGroup>
<Compile Include="UnitTestBasics.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Movie File Merger\Movie File Merger.csproj">
<Project>{58266960-ea2c-447e-9084-40d36650e7a7}</Project>
<Name>Movie File Merger</Name>
</ProjectReference>
</ItemGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
</ItemGroup>
</When>
</Choose>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- 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>
36 changes: 36 additions & 0 deletions MovieFileMergerTest/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle( "MovieFileMergerTest" )]
[assembly: AssemblyDescription( "" )]
[assembly: AssemblyConfiguration( "" )]
[assembly: AssemblyCompany( "" )]
[assembly: AssemblyProduct( "MovieFileMergerTest" )]
[assembly: AssemblyCopyright( "Copyright © 2017" )]
[assembly: AssemblyTrademark( "" )]
[assembly: AssemblyCulture( "" )]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible( false )]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid( "0e1265e4-8aff-46b2-9a69-04588917c568" )]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "1.0.0.0" )]
[assembly: AssemblyFileVersion( "1.0.0.0" )]
Loading

0 comments on commit 4a5998f

Please sign in to comment.