ToolPack1
Changes
.gitignore 7(+7 -0)
Build/ConfigurationTool.dll 0(+0 -0)
Build/ConfigurationTool.pdb 0(+0 -0)
ToolPack1/ConfigurationTool/EnumFormat.cs 13(+13 -0)
ToolPack1/Console/Program.cs 27(+4 -23)
ToolPack1/ToolPack1.sln 14(+14 -0)
Details
.gitignore 7(+7 -0)
diff --git a/.gitignore b/.gitignore
index a94c31b..75619a0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,3 +17,10 @@ ToolPack1/SimpleBenchmark/obj/
ToolPack1/RW_Tool/bin/
ToolPack1/RW_Tool/obj/
+
+
+ToolPack1/Test_ConfigurationTool/bin/
+ToolPack1/Test_ConfigurationTool/obj/
+
+ToolPack1/Test_SingletonTool/bin/
+ToolPack1/Test_SingletonTool/obj/
Build/ConfigurationTool.dll 0(+0 -0)
diff --git a/Build/ConfigurationTool.dll b/Build/ConfigurationTool.dll
index bb9cb84..02dc7a5 100644
Binary files a/Build/ConfigurationTool.dll and b/Build/ConfigurationTool.dll differ
Build/ConfigurationTool.pdb 0(+0 -0)
diff --git a/Build/ConfigurationTool.pdb b/Build/ConfigurationTool.pdb
index f34c55a..364588b 100644
Binary files a/Build/ConfigurationTool.pdb and b/Build/ConfigurationTool.pdb differ
diff --git a/ToolPack1/ConfigurationTool/Config/ConfigParams.cs b/ToolPack1/ConfigurationTool/Config/ConfigParams.cs
index 77567ca..8b462dc 100644
--- a/ToolPack1/ConfigurationTool/Config/ConfigParams.cs
+++ b/ToolPack1/ConfigurationTool/Config/ConfigParams.cs
@@ -8,13 +8,7 @@ using System.IO;
using System.Windows.Forms;
namespace ConfigurationTool.Config
-{
- public enum EnumFormat
- {
- XML,
- Binary
- }
-
+{
//Базовые параметры конфига
public class ConfigParams
{
diff --git a/ToolPack1/ConfigurationTool/Config/ConfigurationManager.cs b/ToolPack1/ConfigurationTool/Config/ConfigurationManager.cs
index 797a05f..8e0ac98 100644
--- a/ToolPack1/ConfigurationTool/Config/ConfigurationManager.cs
+++ b/ToolPack1/ConfigurationTool/Config/ConfigurationManager.cs
@@ -4,6 +4,8 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using System.IO;
+
using SingletonTool;
namespace ConfigurationTool.Config
@@ -15,7 +17,11 @@ namespace ConfigurationTool.Config
//Конфиг
private ConfigEntity<T> Config => SignlethonWithParams<ConfigEntity<T>, ConfigParams>.Get();
//Данные конфига
- public T Data => Config.Data;
+ public T Data
+ {
+ set => Config.Data = value;
+ get => Config.Data;
+ }
//При первом обращении необходимо использовать данный конструктор для иницилизации параметров конфига
public ConfigurationManager(ConfigParams param)
@@ -43,5 +49,11 @@ namespace ConfigurationTool.Config
Config.Export();
}
+ public bool Exist() => File.Exists(Config.Params.ConfigPath);
+ public void Delete()
+ {
+ if (Exist())
+ File.Delete(Config.Params.ConfigPath);
+ }
}
}
diff --git a/ToolPack1/ConfigurationTool/ConfigMultiple/ConfigParams.cs b/ToolPack1/ConfigurationTool/ConfigMultiple/ConfigParams.cs
index cc73071..1577e14 100644
--- a/ToolPack1/ConfigurationTool/ConfigMultiple/ConfigParams.cs
+++ b/ToolPack1/ConfigurationTool/ConfigMultiple/ConfigParams.cs
@@ -9,14 +9,8 @@ using System.Windows.Forms;
namespace ConfigurationTool.ConfigMultiple
{
- public enum EnumFormat
- {
- XML,
- Binary
- }
-
//Базовые параметры конфига
- public class ConfigParams
+ public class MConfigParams
{
//Папка, в которой будут храниться конфиги
public string ConfigDirectory { set; get; }
diff --git a/ToolPack1/ConfigurationTool/ConfigurationTool.csproj b/ToolPack1/ConfigurationTool/ConfigurationTool.csproj
index 3e54a23..5e06b78 100644
--- a/ToolPack1/ConfigurationTool/ConfigurationTool.csproj
+++ b/ToolPack1/ConfigurationTool/ConfigurationTool.csproj
@@ -43,14 +43,15 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
- <Compile Include="ConfigMultiple\ConfigEntity.cs" />
+ <Compile Include="ConfigMultiple\MConfigEntity.cs" />
<Compile Include="ConfigMultiple\ConfigParams.cs" />
- <Compile Include="ConfigMultiple\ConfigurationManager.cs" />
+ <Compile Include="ConfigMultiple\MConfigurationManager.cs" />
<Compile Include="CustomSerializer\BaseCustomSerialazible.cs" />
<Compile Include="Config\ConfigEntity.cs" />
<Compile Include="Config\ConfigParams.cs" />
<Compile Include="Config\ConfigurationManager.cs" />
<Compile Include="CustomSerializer\ICustomSerialazible.cs" />
+ <Compile Include="EnumFormat.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RW\Bin\Bin_Reader.cs" />
<Compile Include="RW\Bin\Bin_Writer.cs" />
ToolPack1/ConfigurationTool/EnumFormat.cs 13(+13 -0)
diff --git a/ToolPack1/ConfigurationTool/EnumFormat.cs b/ToolPack1/ConfigurationTool/EnumFormat.cs
new file mode 100644
index 0000000..90a0b04
--- /dev/null
+++ b/ToolPack1/ConfigurationTool/EnumFormat.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace ConfigurationTool
+{
+ public enum EnumFormat
+ {
+ XML,
+ Binary
+ }
+}
ToolPack1/Console/Program.cs 27(+4 -23)
diff --git a/ToolPack1/Console/Program.cs b/ToolPack1/Console/Program.cs
index a088854..6bfec1a 100644
--- a/ToolPack1/Console/Program.cs
+++ b/ToolPack1/Console/Program.cs
@@ -4,7 +4,8 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
-//using ConfigurationTool.Config;
+using ConfigurationTool;
+using ConfigurationTool.Config;
using ConfigurationTool.ConfigMultiple;
using ConfigurationTool.CustomSerializer;
@@ -63,12 +64,7 @@ namespace Console
// }
//}
- public class ConfigItem
- {
- public int ID { set; get; }
- public string Name { set; get; }
- public DateTime Date { set; get; }
- }
+
class Program
{
@@ -81,22 +77,7 @@ namespace Console
// UseApplicationPathPrefix = true
//});
- var conf = new ConfigurationManager<ConfigItem>(new ConfigParams()
- {
- ConfigDirectory = "ConfigsItems",
- Format = EnumFormat.XML,
- UseApplicationPathPrefix= true
- });
-
- for (int i = 0; i < 2; i++)
- {
- conf.Add(i.ToString(), new ConfigItem()
- {
- ID = i,
- Name = "name" + i,
- Date = DateTime.Now
- });
- }
+
}
}
}
diff --git a/ToolPack1/Test_ConfigurationTool/ConfigurationTest.cs b/ToolPack1/Test_ConfigurationTool/ConfigurationTest.cs
new file mode 100644
index 0000000..80ec576
--- /dev/null
+++ b/ToolPack1/Test_ConfigurationTool/ConfigurationTest.cs
@@ -0,0 +1,98 @@
+using System;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+using ConfigurationTool;
+using ConfigurationTool.Config;
+using ConfigurationTool.ConfigMultiple;
+
+using Test_ConfigurationTool.Entities;
+
+namespace Test_ConfigurationTool
+{
+ [TestClass]
+ public class ConfigurationTest
+ {
+ /// <summary>
+ /// Проверка базового конфига
+ /// </summary>
+ [TestMethod]
+ public void Test1()
+ {
+ string file = @"Config.xml";
+
+ var conf = new ConfigurationManager<Config1>(new ConfigParams()
+ {
+ ConfigFile = file,
+ Format = EnumFormat.XML,
+ UseApplicationPathPrefix = false
+ });
+
+ conf.Data = Config1.GetConfig_1();
+ conf.Export();
+ if (!conf.Exist())
+ throw new Exception();
+
+ conf.Import();
+ if (conf.Data != Config1.GetConfig_1())
+ throw new Exception();
+
+ conf.Delete();
+ }
+
+ /// <summary>
+ /// Проверка конфига с кастомным сериализатором
+ /// </summary>
+ [TestMethod]
+ public void Test2()
+ {
+ string file = @"Config2.xml";
+
+ var conf = new ConfigurationManager<Config2>(new ConfigParams()
+ {
+ ConfigFile = file,
+ Format = EnumFormat.XML,
+ UseApplicationPathPrefix = false
+ });
+
+ for (int i = 0; i < 2; i++)
+ {
+ conf.Data.Dictionary.Add(i, new SubEntity()
+ {
+ ID = i,
+ Name = "Name " + i
+ });
+ }
+
+ conf.Export();
+
+ conf.Delete();
+ }
+
+ /// <summary>
+ /// Проверка конфига с множественными файлами
+ /// </summary>
+ [TestMethod]
+ public void Test3()
+ {
+ var conf = new MConfigurationManager<Config3>(new MConfigParams()
+ {
+ ConfigDirectory = "Configs3",
+ Format = EnumFormat.XML,
+ UseApplicationPathPrefix = false
+ });
+
+ for (int i = 0; i < 2; i++)
+ {
+ conf.Add(i.ToString(), new Config3()
+ {
+ ID = i,
+ Name = "name" + i,
+ Date = DateTime.Now
+ });
+ }
+
+ conf.Delete();
+ }
+
+ }
+}
diff --git a/ToolPack1/Test_ConfigurationTool/Entities/Config1.cs b/ToolPack1/Test_ConfigurationTool/Entities/Config1.cs
new file mode 100644
index 0000000..1ea14da
--- /dev/null
+++ b/ToolPack1/Test_ConfigurationTool/Entities/Config1.cs
@@ -0,0 +1,50 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Test_ConfigurationTool.Entities
+{
+ public class Config1
+ {
+ public int IntProperty { set; get; }
+ public string StringProperty { set; get; }
+
+ public List<string> ListProperty { set; get; }
+
+ public static Config1 GetConfig_1() =>
+ new Config1()
+ {
+ IntProperty = 10,
+ StringProperty = "10",
+ ListProperty = new List<string>()
+ {
+ "A10",
+ "B20"
+ }
+ };
+
+ public static bool operator ==(Config1 c1, Config1 c2)
+ {
+ if (c1.IntProperty != c2.IntProperty)
+ return false;
+
+ if (c1.StringProperty != c2.StringProperty)
+ return false;
+
+ if (c1.ListProperty.Count != c2.ListProperty.Count)
+ return false;
+
+ for (int i = 0; i < c1.ListProperty.Count; i++)
+ if (c1.ListProperty[i] != c2.ListProperty[i])
+ return false;
+
+ return true;
+ }
+ public static bool operator !=(Config1 c1, Config1 c2)
+ {
+ return !(c1 == c2);
+ }
+ }
+}
diff --git a/ToolPack1/Test_ConfigurationTool/Entities/Config2.cs b/ToolPack1/Test_ConfigurationTool/Entities/Config2.cs
new file mode 100644
index 0000000..8f01b6b
--- /dev/null
+++ b/ToolPack1/Test_ConfigurationTool/Entities/Config2.cs
@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using ConfigurationTool.CustomSerializer;
+
+namespace Test_ConfigurationTool.Entities
+{
+
+ public class SubEntity
+ {
+ public int ID { set; get; }
+ public string Name { set; get; }
+ }
+
+
+ public class Config2 : BaseCustomSerialazible<Config2_Serial>
+ {
+ public Dictionary<int, SubEntity> Dictionary { set; get; }
+ = new Dictionary<int, SubEntity>();
+
+ public override Config2_Serial Export()
+ => new Config2_Serial()
+ {
+ Dictionary = Dictionary
+ .Values
+ .ToList()
+ };
+
+ public override void Import(Config2_Serial obj)
+ {
+ Dictionary = obj
+ .Dictionary
+ .ToDictionary(e => e.ID);
+ }
+ }
+
+ public class Config2_Serial
+ {
+ public List<SubEntity> Dictionary { set; get; } = new List<SubEntity>();
+ }
+}
diff --git a/ToolPack1/Test_ConfigurationTool/Entities/Config3.cs b/ToolPack1/Test_ConfigurationTool/Entities/Config3.cs
new file mode 100644
index 0000000..22c1bd0
--- /dev/null
+++ b/ToolPack1/Test_ConfigurationTool/Entities/Config3.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Test_ConfigurationTool.Entities
+{
+ public class Config3
+ {
+ public int ID { set; get; }
+ public string Name { set; get; }
+ public DateTime Date { set; get; }
+ }
+}
diff --git a/ToolPack1/Test_ConfigurationTool/packages.config b/ToolPack1/Test_ConfigurationTool/packages.config
new file mode 100644
index 0000000..d2da0eb
--- /dev/null
+++ b/ToolPack1/Test_ConfigurationTool/packages.config
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="MSTest.TestAdapter" version="1.3.2" targetFramework="net45" />
+ <package id="MSTest.TestFramework" version="1.3.2" targetFramework="net45" />
+</packages>
\ No newline at end of file
diff --git a/ToolPack1/Test_ConfigurationTool/Properties/AssemblyInfo.cs b/ToolPack1/Test_ConfigurationTool/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..57443bb
--- /dev/null
+++ b/ToolPack1/Test_ConfigurationTool/Properties/AssemblyInfo.cs
@@ -0,0 +1,20 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("Test_ConfigurationTool")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Test_ConfigurationTool")]
+[assembly: AssemblyCopyright("Copyright © 2019")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+[assembly: ComVisible(false)]
+
+[assembly: Guid("63854c73-461c-4aad-b017-4f128047b1a7")]
+
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/ToolPack1/Test_ConfigurationTool/Test_ConfigurationTool.csproj b/ToolPack1/Test_ConfigurationTool/Test_ConfigurationTool.csproj
new file mode 100644
index 0000000..5cae744
--- /dev/null
+++ b/ToolPack1/Test_ConfigurationTool/Test_ConfigurationTool.csproj
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props')" />
+ <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>
+ <ProjectGuid>{63854C73-461C-4AAD-B017-4F128047B1A7}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Test_ConfigurationTool</RootNamespace>
+ <AssemblyName>Test_ConfigurationTool</AssemblyName>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.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>
+ <NuGetPackageImportStamp>
+ </NuGetPackageImportStamp>
+ </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="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="ConfigurationTest.cs" />
+ <Compile Include="Entities\Config1.cs" />
+ <Compile Include="Entities\Config2.cs" />
+ <Compile Include="Entities\Config3.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\ConfigurationTool\ConfigurationTool.csproj">
+ <Project>{e8a983a0-ff7d-4e9a-9234-3f19ccb93700}</Project>
+ <Name>ConfigurationTool</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+ <PropertyGroup>
+ <ErrorText>Данный проект ссылается на пакеты NuGet, отсутствующие на этом компьютере. Используйте восстановление пакетов NuGet, чтобы скачать их. Дополнительную информацию см. по адресу: http://go.microsoft.com/fwlink/?LinkID=322105. Отсутствует следующий файл: {0}.</ErrorText>
+ </PropertyGroup>
+ <Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props'))" />
+ <Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.targets'))" />
+ </Target>
+ <Import Project="..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.targets')" />
+</Project>
\ No newline at end of file
diff --git a/ToolPack1/Test_SingletonTool/packages.config b/ToolPack1/Test_SingletonTool/packages.config
new file mode 100644
index 0000000..d2da0eb
--- /dev/null
+++ b/ToolPack1/Test_SingletonTool/packages.config
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="MSTest.TestAdapter" version="1.3.2" targetFramework="net45" />
+ <package id="MSTest.TestFramework" version="1.3.2" targetFramework="net45" />
+</packages>
\ No newline at end of file
diff --git a/ToolPack1/Test_SingletonTool/Properties/AssemblyInfo.cs b/ToolPack1/Test_SingletonTool/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..643d2c0
--- /dev/null
+++ b/ToolPack1/Test_SingletonTool/Properties/AssemblyInfo.cs
@@ -0,0 +1,20 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("Test_SingletonTool")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Test_SingletonTool")]
+[assembly: AssemblyCopyright("Copyright © 2019")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+[assembly: ComVisible(false)]
+
+[assembly: Guid("2c94d5e5-08d3-46e1-a38e-f053d72b9389")]
+
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/ToolPack1/Test_SingletonTool/SingletonTest.cs b/ToolPack1/Test_SingletonTool/SingletonTest.cs
new file mode 100644
index 0000000..2e57f7d
--- /dev/null
+++ b/ToolPack1/Test_SingletonTool/SingletonTest.cs
@@ -0,0 +1,47 @@
+using System;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+using SingletonTool;
+
+namespace Test_SingletonTool
+{
+ class SingleEntity : ISignlethonWithParams<SingleParams>
+ {
+ public string Name { set; get; }
+
+ public void SetParams(SingleParams param)
+ {
+ this.Name = param.name;
+ }
+ }
+
+ class SingleParams
+ {
+ public string name { set; get; }
+ }
+
+
+ [TestClass]
+ public class SingletonTest
+ {
+ [TestMethod]
+ public void Test1()
+ {
+ var sing = Signlethon<SingleEntity>.Get();
+
+
+ }
+
+ [TestMethod]
+ public void Test2()
+ {
+ var sing = SingletonTool.SignlethonWithParams<SingleEntity, SingleParams>.Create(new SingleParams()
+ {
+ name = "Name"
+ });
+
+ if (sing.Name != "Name")
+ throw new Exception();
+ }
+ }
+}
diff --git a/ToolPack1/Test_SingletonTool/Test_SingletonTool.csproj b/ToolPack1/Test_SingletonTool/Test_SingletonTool.csproj
new file mode 100644
index 0000000..50e6250
--- /dev/null
+++ b/ToolPack1/Test_SingletonTool/Test_SingletonTool.csproj
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props')" />
+ <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>
+ <ProjectGuid>{2C94D5E5-08D3-46E1-A38E-F053D72B9389}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Test_SingletonTool</RootNamespace>
+ <AssemblyName>Test_SingletonTool</AssemblyName>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.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>
+ <NuGetPackageImportStamp>
+ </NuGetPackageImportStamp>
+ </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="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="SingletonTest.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\SingletonTool\SingletonTool.csproj">
+ <Project>{e69e7d23-3595-4742-ad69-9b245ce9c7b8}</Project>
+ <Name>SingletonTool</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+ <PropertyGroup>
+ <ErrorText>Данный проект ссылается на пакеты NuGet, отсутствующие на этом компьютере. Используйте восстановление пакетов NuGet, чтобы скачать их. Дополнительную информацию см. по адресу: http://go.microsoft.com/fwlink/?LinkID=322105. Отсутствует следующий файл: {0}.</ErrorText>
+ </PropertyGroup>
+ <Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props'))" />
+ <Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.targets'))" />
+ </Target>
+ <Import Project="..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.targets')" />
+</Project>
\ No newline at end of file
ToolPack1/ToolPack1.sln 14(+14 -0)
diff --git a/ToolPack1/ToolPack1.sln b/ToolPack1/ToolPack1.sln
index e6682f6..c43679d 100644
--- a/ToolPack1/ToolPack1.sln
+++ b/ToolPack1/ToolPack1.sln
@@ -17,6 +17,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleBenchmark", "SimpleBe
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RW_Tool", "RW_Tool\RW_Tool.csproj", "{78207C90-5CFA-4DED-A047-CF711CBA3F86}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test_ConfigurationTool", "Test_ConfigurationTool\Test_ConfigurationTool.csproj", "{63854C73-461C-4AAD-B017-4F128047B1A7}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test_SingletonTool", "Test_SingletonTool\Test_SingletonTool.csproj", "{2C94D5E5-08D3-46E1-A38E-F053D72B9389}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -43,6 +47,14 @@ Global
{78207C90-5CFA-4DED-A047-CF711CBA3F86}.Debug|Any CPU.Build.0 = Debug|Any CPU
{78207C90-5CFA-4DED-A047-CF711CBA3F86}.Release|Any CPU.ActiveCfg = Release|Any CPU
{78207C90-5CFA-4DED-A047-CF711CBA3F86}.Release|Any CPU.Build.0 = Release|Any CPU
+ {63854C73-461C-4AAD-B017-4F128047B1A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {63854C73-461C-4AAD-B017-4F128047B1A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {63854C73-461C-4AAD-B017-4F128047B1A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {63854C73-461C-4AAD-B017-4F128047B1A7}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2C94D5E5-08D3-46E1-A38E-F053D72B9389}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2C94D5E5-08D3-46E1-A38E-F053D72B9389}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2C94D5E5-08D3-46E1-A38E-F053D72B9389}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2C94D5E5-08D3-46E1-A38E-F053D72B9389}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -53,6 +65,8 @@ Global
{E8A983A0-FF7D-4E9A-9234-3F19CCB93700} = {9FC03DF2-3AFE-4A62-B380-B9CBFF6486D1}
{F862BC1F-ABC5-4C80-9210-1722DA94A04C} = {9FC03DF2-3AFE-4A62-B380-B9CBFF6486D1}
{78207C90-5CFA-4DED-A047-CF711CBA3F86} = {9FC03DF2-3AFE-4A62-B380-B9CBFF6486D1}
+ {63854C73-461C-4AAD-B017-4F128047B1A7} = {ABC5281A-6B36-4D11-AFED-3E2EF981AA49}
+ {2C94D5E5-08D3-46E1-A38E-F053D72B9389} = {ABC5281A-6B36-4D11-AFED-3E2EF981AA49}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {408C4B5A-5AF0-418D-A722-B2B253B5F831}