batch commit
This commit is contained in:
@ -0,0 +1 @@
|
||||
{"RootPath":"D:\\Documents\\Old Projects-School\\School\\Projects\\GameOfLifeFactory\\Unittest_GameofLife","ProjectFileName":"Unittest_GameofLife.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"UnitTest1.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.5.2.AssemblyAttributes.cs"}],"References":[{"Reference":"D:\\Documents\\Old Projects-School\\School\\Projects\\GameOfLifeFactory\\GameOfLifeFactory\\bin\\Debug\\GameOfLifeFactory.exe","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\PublicAssemblies\\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\WINDOWS\\Microsoft.NET\\Framework\\v4.0.30319\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Core\\v4.0_4.0.0.0__b77a5c561934e089\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System\\v4.0_4.0.0.0__b77a5c561934e089\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"D:\\Documents\\Old Projects-School\\School\\Projects\\GameOfLifeFactory\\Unittest_GameofLife\\bin\\Debug\\Unittest_GameofLife.dll","OutputItemRelativePath":"Unittest_GameofLife.dll"},{"OutputItemFullPath":"D:\\Documents\\Old Projects-School\\School\\Projects\\GameOfLifeFactory\\Unittest_GameofLife\\bin\\Debug\\Unittest_GameofLife.pdb","OutputItemRelativePath":"Unittest_GameofLife.pdb"}],"CopyToOutputEntries":[]}
|
@ -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("Unittest_GameofLife")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Unittest_GameofLife")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[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("75f9d7d1-700d-4e3f-abae-73545125882e")]
|
||||
|
||||
// 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")]
|
220
GameOfLife - C#/Unittest_GameofLife/UnitTest1.cs
Normal file
220
GameOfLife - C#/Unittest_GameofLife/UnitTest1.cs
Normal file
@ -0,0 +1,220 @@
|
||||
using System;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using GameOfLifeFactory;
|
||||
|
||||
namespace Unittest_GameofLife
|
||||
{
|
||||
[TestClass]
|
||||
public class UnitTest1
|
||||
{
|
||||
[TestMethod]
|
||||
[TestCategory("CellCount")]
|
||||
public void CellFactoryArray_CellCount_Middle()
|
||||
{
|
||||
CellFactory CellFac = new CellFactoryArray(5,5);
|
||||
ICell _icell = CellFac.CreateCell();
|
||||
_icell.X = 1;
|
||||
_icell.Y = 2;
|
||||
_icell.IsAlive = true;
|
||||
CellFac.SetCell(_icell);
|
||||
ICell Holder = CellFac.CreateCell();
|
||||
Holder.X = 2; Holder.Y = 2;
|
||||
int NumberCell = CellFac.GetNeighborCount(Holder);
|
||||
Assert.AreEqual(NumberCell, 1);
|
||||
|
||||
}
|
||||
[TestMethod]
|
||||
[TestCategory("CellCount")]
|
||||
public void CellFactoryArray_CellCount_None()
|
||||
{
|
||||
CellFactory CellFac = new CellFactoryArray(5, 5);
|
||||
ICell Holder = CellFac.CreateCell();
|
||||
Holder.X = 2; Holder.Y = 2;
|
||||
int NumberCell = CellFac.GetNeighborCount(Holder);
|
||||
Assert.AreEqual(NumberCell, 0);
|
||||
|
||||
}
|
||||
[TestMethod]
|
||||
[TestCategory("CellCount")]
|
||||
public void CellFactoryArray_CellCount_TopLeft()
|
||||
{
|
||||
CellFactory CellFac = new CellFactoryArray(5, 5);
|
||||
ICell _icell = CellFac.CreateCell();
|
||||
_icell.X = 1;
|
||||
_icell.Y = 0;
|
||||
_icell.IsAlive = true;
|
||||
CellFac.SetCell(_icell);
|
||||
ICell Holder = CellFac.CreateCell();
|
||||
Holder.X = 0; Holder.Y = 0;
|
||||
Assert.AreEqual(CellFac.GetNeighborCount(Holder), 1);
|
||||
|
||||
}
|
||||
[TestMethod]
|
||||
[TestCategory("CellCount")]
|
||||
public void CellFactoryArray_CellCount_TopRight()
|
||||
{
|
||||
CellFactory CellFac = new CellFactoryArray(5, 5);
|
||||
ICell _icell = CellFac.CreateCell();
|
||||
_icell.X = 3;
|
||||
_icell.Y = 0;
|
||||
_icell.IsAlive = true;
|
||||
CellFac.SetCell(_icell);
|
||||
ICell Holder = CellFac.CreateCell();
|
||||
Holder.X = 4; Holder.Y = 0;
|
||||
int NumberCell = CellFac.GetNeighborCount(Holder);
|
||||
Assert.AreEqual(NumberCell, 1);
|
||||
|
||||
}
|
||||
[TestMethod]
|
||||
[TestCategory("CellCount")]
|
||||
public void CellFactoryArray_CellCount_Multiple()
|
||||
{
|
||||
CellFactory CellFac = new CellFactoryArray(5, 5);
|
||||
ICell _icell = CellFac.CreateCell();
|
||||
_icell.X = 0;
|
||||
_icell.Y = 0;
|
||||
_icell.IsAlive = true;
|
||||
CellFac.SetCell(_icell);
|
||||
_icell.X = 1;
|
||||
_icell.Y = 1;
|
||||
CellFac.SetCell(_icell);
|
||||
ICell Holder = CellFac.CreateCell();
|
||||
Holder.X = 0; Holder.Y = 1;
|
||||
int NumberCell = CellFac.GetNeighborCount(Holder);
|
||||
Assert.AreEqual(NumberCell, 2);
|
||||
|
||||
}
|
||||
[TestMethod]
|
||||
[TestCategory("SetCell")]
|
||||
public void CellFactoryArray_SetCell_inbounds()
|
||||
{
|
||||
CellFactory CellFac = new CellFactoryArray(5, 5);
|
||||
ICell _icell = CellFac.CreateCell();
|
||||
_icell.X = 0;
|
||||
_icell.Y = 0;
|
||||
_icell.IsAlive = true;
|
||||
CellFac.SetCell(_icell);
|
||||
Assert.AreEqual(CellFac.GetCell(0,0).IsAlive, true);
|
||||
}
|
||||
[TestMethod]
|
||||
[TestCategory("SetCell")]
|
||||
public void CellFactoryArray_SetCell_OutofboundsY()
|
||||
{
|
||||
CellFactory CellFac = new CellFactoryArray(5, 5);
|
||||
ICell _icell = CellFac.CreateCell();
|
||||
_icell.X = 0;
|
||||
_icell.Y = 5;
|
||||
_icell.IsAlive = true;
|
||||
CellFac.SetCell(_icell);
|
||||
Assert.IsTrue(true);
|
||||
}
|
||||
[TestMethod]
|
||||
[TestCategory("SetCell")]
|
||||
public void CellFactoryArray_SetCell_OutofboundsX()
|
||||
{
|
||||
CellFactory CellFac = new CellFactoryArray(5, 5);
|
||||
ICell _icell = CellFac.CreateCell();
|
||||
_icell.X = 5;
|
||||
_icell.Y = 0;
|
||||
_icell.IsAlive = true;
|
||||
CellFac.SetCell(_icell);
|
||||
Assert.IsTrue(true);
|
||||
}
|
||||
[TestMethod]
|
||||
[TestCategory("SetCell")]
|
||||
public void CellFactoryArray_SetCell_OutofboundsXY()
|
||||
{
|
||||
CellFactory CellFac = new CellFactoryArray(5, 5);
|
||||
ICell _icell = CellFac.CreateCell();
|
||||
_icell.X = 5;
|
||||
_icell.Y = 5;
|
||||
_icell.IsAlive = true;
|
||||
CellFac.SetCell(_icell);
|
||||
Assert.IsTrue(true);
|
||||
}
|
||||
[TestMethod]
|
||||
[TestCategory("GetCell")]
|
||||
public void CellFactoryArray_GetCell_Live()
|
||||
{
|
||||
CellFactory CellFac = new CellFactoryArray(5, 5);
|
||||
ICell _icell = CellFac.CreateCell();
|
||||
_icell.X = 0;
|
||||
_icell.Y = 0;
|
||||
_icell.IsAlive = true;
|
||||
CellFac.SetCell(_icell);
|
||||
Assert.AreEqual(CellFac.GetCell(0,0).IsAlive, true);
|
||||
}
|
||||
[TestMethod]
|
||||
[TestCategory("GetCell")]
|
||||
public void CellFactoryArray_GetCell_Dead()
|
||||
{
|
||||
CellFactory CellFac = new CellFactoryArray(5, 5);
|
||||
ICell _icell = CellFac.CreateCell();
|
||||
_icell.X = 0;
|
||||
_icell.Y = 0;
|
||||
_icell.IsAlive = false;
|
||||
CellFac.SetCell(_icell);
|
||||
Assert.AreEqual(CellFac.GetCell(0, 0).IsAlive, false);
|
||||
}
|
||||
[TestMethod]
|
||||
[TestCategory("GetCell")]
|
||||
public void CellFactoryArray_GetCell_OutofBounds()
|
||||
{
|
||||
CellFactory CellFac = new CellFactoryArray(5, 5);
|
||||
Assert.IsNull(CellFac.GetCell(5, 5));
|
||||
}
|
||||
[TestMethod]
|
||||
[TestCategory("CreateCell")]
|
||||
public void CellFactoryArray_CreatCell_Create()
|
||||
{
|
||||
CellFactory CellFac = new CellFactoryArray(5, 5);
|
||||
ICell temp = CellFac.CreateCell();
|
||||
Assert.IsTrue(true);
|
||||
}
|
||||
[TestMethod]
|
||||
[TestCategory("Clear")]
|
||||
public void CellFactoryArray_Clear_ClearBoard()
|
||||
{
|
||||
CellFactory CellFac = new CellFactoryArray(5, 5);
|
||||
CellFac.Clear();
|
||||
Assert.IsTrue(true);
|
||||
}
|
||||
[TestMethod]
|
||||
[TestCategory("NextGen")]
|
||||
public void CellFactoryArray_NextGen_TCell()
|
||||
{
|
||||
CellFactory CellFac = new CellFactoryArray(5, 5);
|
||||
ICell _icell = CellFac.CreateCell();
|
||||
_icell.X = 2;
|
||||
_icell.Y = 2;
|
||||
_icell.IsAlive = true;
|
||||
CellFac.SetCell(_icell);
|
||||
|
||||
_icell.X = 1;
|
||||
_icell.Y = 2;
|
||||
CellFac.SetCell(_icell);
|
||||
|
||||
_icell.X = 3;
|
||||
_icell.Y = 2;
|
||||
CellFac.SetCell(_icell);
|
||||
|
||||
CellFac.NextGeneration();
|
||||
Assert.AreEqual(CellFac.GetCell(2, 1).IsAlive, true);
|
||||
|
||||
}
|
||||
[TestMethod]
|
||||
[TestCategory("Default Constructor")]
|
||||
public void CellFactoryArray_Defaultconstructor()
|
||||
{
|
||||
CellFactoryArray Test = new CellFactoryArray();
|
||||
Assert.IsTrue(true);
|
||||
}
|
||||
[TestMethod]
|
||||
[TestCategory("Overloadded Constructor")]
|
||||
public void CellFactoryArray_Overloaddedconstructor()
|
||||
{
|
||||
CellFactoryArray Test = new CellFactoryArray(5,5);
|
||||
Assert.IsTrue(true);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
<?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>{75F9D7D1-700D-4E3F-ABAE-73545125882E}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Unittest_GameofLife</RootNamespace>
|
||||
<AssemblyName>Unittest_GameofLife</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</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="GameOfLifeFactory">
|
||||
<HintPath>..\GameOfLifeFactory\bin\Debug\GameOfLifeFactory.exe</HintPath>
|
||||
</Reference>
|
||||
<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="UnitTest1.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</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>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
|
||||
</startup>
|
||||
</configuration>
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5.2", FrameworkDisplayName = "")]
|
Reference in New Issue
Block a user