максим карбышев пре 3 година
родитељ
комит
617f5e8d96

+ 6 - 0
CybersportTournament.sln

@@ -5,6 +5,8 @@ VisualStudioVersion = 17.0.31903.59
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CybersportTournament", "CybersportTournament\CybersportTournament.csproj", "{3154FEBB-F742-4A22-9C23-F76F3D47D16F}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\UnitTests.csproj", "{0F442F2D-5653-4056-82C1-E9C541BA624F}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -15,6 +17,10 @@ Global
 		{3154FEBB-F742-4A22-9C23-F76F3D47D16F}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{3154FEBB-F742-4A22-9C23-F76F3D47D16F}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{3154FEBB-F742-4A22-9C23-F76F3D47D16F}.Release|Any CPU.Build.0 = Release|Any CPU
+		{0F442F2D-5653-4056-82C1-E9C541BA624F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{0F442F2D-5653-4056-82C1-E9C541BA624F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{0F442F2D-5653-4056-82C1-E9C541BA624F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{0F442F2D-5653-4056-82C1-E9C541BA624F}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 45 - 27
CybersportTournament/AddWindows/AddRoundWindow.xaml.cs

@@ -15,6 +15,11 @@ namespace CybersportTournament.AddWindows
     {
         Match match;
 
+        public AddRoundWindow()
+        {
+            InitializeComponent();
+        }
+
         public AddRoundWindow(int IDMatch)
         {
             InitializeComponent();
@@ -54,39 +59,15 @@ namespace CybersportTournament.AddWindows
             {
                 int index = Period.Text.IndexOf(":");
                 round.Period = new TimeSpan(Convert.ToInt32(Period.Text.Substring(0, index)), Convert.ToInt32(Period.Text.Substring(index + 1, Period.Text.Length - index - 1)), 0);
-                TimeSpan matchPeriod = (TimeSpan)match.Period + (TimeSpan)round.Period;
-                match.Period = matchPeriod;
+                match.Period = MatchPeriod(Period.Text.ToString(), (TimeSpan)match.Period);
             }
             round.Result = "0:0";
             Connection.db.Rounds.Add(round);
             Connection.db.SaveChanges();
             if (Result.Text.ToString() != "")
             {
-                #region Авто изменение счёта матча
-                int length = Result.Text.IndexOf(':');
-                int firstTeamRoundScore = Convert.ToInt32(Result.Text.Substring(0, length));
-                int secondTeamRoundScore = Convert.ToInt32(Result.Text.Substring(length + 1, Result.Text.Length - length - 1));
-                length = match.Result.IndexOf(':');
-                int firstTeamMatchScore = Convert.ToInt32(match.Result.Substring(0, length));
-                int secondTeamMatchScore = Convert.ToInt32(match.Result.Substring(length + 1, match.Result.Length - length - 1));
-
-                if (firstTeamRoundScore == secondTeamRoundScore)
-                {
-                    ErrorWindow ew = new ErrorWindow("счёт не может быть одинаковым");
-                    ew.Show();
-                    return;
-                }
-                else if (firstTeamRoundScore > secondTeamRoundScore)
-                {
-                    firstTeamMatchScore += 1;
-                }
-                else
-                {
-                    secondTeamMatchScore += 1;
-                }
-                string matchResult = firstTeamMatchScore.ToString() + ":" + secondTeamMatchScore.ToString();
-                match.Result = matchResult;
-                #endregion
+                if (MatchResult(Result.Text.ToString(), match.Result.ToString()) != "ошибка")
+                    match.Result = MatchResult(Result.Text.ToString(), match.Result.ToString());
 
                 round.Result = Result.Text;
             }
@@ -132,5 +113,42 @@ namespace CybersportTournament.AddWindows
                 return true;
             #endregion
         }
+
+        public TimeSpan MatchPeriod(string roundPeriod, TimeSpan matchPeriod)
+        {
+            #region Авторасчёт длительности матча
+            int index = roundPeriod.IndexOf(":");
+            TimeSpan rp = new TimeSpan(Convert.ToInt32(roundPeriod.Substring(0, index)), Convert.ToInt32(roundPeriod.Substring(index + 1, roundPeriod.Length - index - 1)), 0);
+            return matchPeriod + rp;
+            #endregion
+        }
+
+        public string MatchResult(string score, string matchScore)
+        {
+            #region Авто изменение счёта матча
+            int length = score.IndexOf(':');
+            int firstTeamRoundScore = Convert.ToInt32(score.Substring(0, length));
+            int secondTeamRoundScore = Convert.ToInt32(score.Substring(length + 1, score.Length - length - 1));
+            length = matchScore.IndexOf(':');
+            int firstTeamMatchScore = Convert.ToInt32(matchScore.Substring(0, length));
+            int secondTeamMatchScore = Convert.ToInt32(matchScore.Substring(length + 1, matchScore.Length - length - 1));
+
+            if (firstTeamRoundScore == secondTeamRoundScore)
+            {
+                ErrorWindow ew = new ErrorWindow("счёт не может быть одинаковым");
+                ew.Show();
+                return "ошибка";
+            }
+            else if (firstTeamRoundScore > secondTeamRoundScore)
+            {
+                firstTeamMatchScore += 1;
+            }
+            else
+            {
+                secondTeamMatchScore += 1;
+            }
+            return firstTeamMatchScore.ToString() + ":" + secondTeamMatchScore.ToString();
+            #endregion
+        }
     }
 }

+ 1 - 1
CybersportTournament/AuthorizationWindow.xaml

@@ -9,7 +9,7 @@
     <Grid>
         <Label Name="LoginLab"  Content="Логин:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="388,329,0,0" Foreground="White" Height="60" Width="180" FontSize="36"/>
         <TextBox Name="Login" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="567,329,0,0" Height="60" Width="550" Background="White" FontSize="36"/>
-        <Label Content="Пароль" VerticalAlignment="Top" HorizontalAlignment="Left" Foreground="White" Margin="388,411,0,0" Height="60" Width="180" FontSize="36"/>
+        <Label Content="Пароль:" VerticalAlignment="Top" HorizontalAlignment="Left" Foreground="White" Margin="388,411,0,0" Height="60" Width="180" FontSize="36"/>
         <PasswordBox Name="Password" VerticalAlignment="Top" HorizontalAlignment="Left" Height="60" Width="550" Margin="567,411,0,0" FontSize="36"/>
         <Button Name="AuthorizeButton" Content="Войти" VerticalAlignment="Top" HorizontalAlignment="Left" Height="60" Width="360" Margin="350,746,0,0" Click="AuthorizationClick" FontSize="36"/>
         <Button Name="RegistrationButton" Content="Зарегистрироваться" VerticalAlignment="Top" HorizontalAlignment="Right" Height="60" Width="360" Margin="0,746,350,0" Click="RegistrationClick" FontSize="36"/>

+ 14 - 5
CybersportTournament/AuthorizationWindow.xaml.cs

@@ -17,26 +17,35 @@ namespace CybersportTournament
         private void AuthorizationClick(object sender, RoutedEventArgs e)
         {
             #region Авторизация
+            if (Authorization(Login.Text.ToString(), Password.Password.ToString()))
+            {
+                MainWindow mw = new MainWindow();
+                mw.Show();
+                this.Close();
+            }
+        }
+
+        public bool Authorization(string login, string password)
+        {
             if (Login.Text == "" || Password.Password == "")
             {
                 ErrorWindow ew = new ErrorWindow("пустые поля");
                 ew.Show();
-                return;
+                return false;
             }
             if (Connection.db.Users.Select(item => item.Login + " " + item.Password).Contains(Login.Text + " " + Encrypt.Hash(Password.Password)))
             {
                 int personID = Connection.db.Users.Where(users => users.Login == Login.Text).Select(users => users.IDPerson).FirstOrDefault();
-                int Role = Connection.db.Persons.Where(users => users.ID == personID).Select(users => users.Role).FirstOrDefault();
+                int Role = Connection.db.Persons.Where(users => users.ID == personID).Select(users => users.IDRole).FirstOrDefault();
                 User.Role = Role;
                 User.IDPerson = personID;
-                MainWindow mw = new MainWindow();
-                mw.Show();
-                this.Close();
+                return true;
             }
             else
             {
                 ErrorWindow ew = new ErrorWindow("неверный логин/пароль");
                 ew.Show();
+                return false;
             }
             #endregion
         }

+ 1 - 6
CybersportTournament/ElementsWindows/MatchWindow.xaml

@@ -22,13 +22,8 @@
         <Label Name="Result" HorizontalAlignment="Left" Margin="676,368,0,0" VerticalAlignment="Top" Height="60" Width="450" FontSize="36" Foreground="#FF54E4FF"/>
         <DataGrid Name="RoundsList" AutoGenerateColumns="False" Height="295" Margin="0,455,0,0" VerticalAlignment="Top" HorizontalAlignment="Center" Width="1340"
                    RowHeaderStyle="{StaticResource RowHeaderStyle}" ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}">
-            <DataGrid.ItemContainerStyle>
-                <Style TargetType="DataGridRow">
-                    <EventSetter Event="MouseDoubleClick" Handler="RoundsListMouseDoubleClick"/>
-                </Style>
-            </DataGrid.ItemContainerStyle>
             <DataGrid.Columns>
-                <DataGridTextColumn Binding="{Binding Rounds.Name}" Header="Турнир"  Width="500" IsReadOnly="True"/>
+                <DataGridTextColumn Binding="{Binding Rounds.Name}" Header="Раунд"  Width="500" IsReadOnly="True"/>
                 <DataGridTextColumn Binding="{Binding Rounds.Period}" Header="Длительность"  Width="500" IsReadOnly="True"/>
                 <DataGridTextColumn Binding="{Binding Rounds.Result}" Header="Результат"  Width="250" IsReadOnly="True"/>
             </DataGrid.Columns>

+ 0 - 8
CybersportTournament/ElementsWindows/MatchWindow.xaml.cs

@@ -35,14 +35,6 @@ namespace CybersportTournament.ElementsWindows
             this.Close();
         }
 
-        private void RoundsListMouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
-        {
-            int id = ((Rounds)RoundsList.SelectedItem).ID;
-            MatchWindow mw = new MatchWindow(id);
-            mw.Show();
-            this.Hide();
-        }
-
         private void AddRoundClick(object sender, RoutedEventArgs e)
         {
             AddRoundWindow arw = new AddRoundWindow(match.ID);

+ 1 - 1
CybersportTournament/Encrypt.cs

@@ -3,7 +3,7 @@ using System.Text;
 
 namespace CybersportTournament
 {
-    internal class Encrypt
+    public class Encrypt
     {
         public static string Hash(string password)
         {

+ 23 - 12
CybersportTournament/RegistrationWindow.xaml.cs

@@ -18,24 +18,43 @@ namespace CybersportTournament
 
         private void RegistrationClick(object sender, RoutedEventArgs e)
         {
+            #region Регистрация
+            bool regRes = Registration(Login.Text.ToString(), Password.Password.ToString(), FirstName.Text.ToString(),
+                                        SecondName.Text.ToString(), MiddleName.Text.ToString(), Email.Text.ToString());
+
+            if (regRes)
+            {
+                #region Результат и переход на окно авторизации
+                RegitrationConfirmedWindow rcw = new RegitrationConfirmedWindow();
+                rcw.Show();
+
+                AuthorizationWindow aw = new AuthorizationWindow();
+                aw.Show();
+                this.Close();
+                #endregion
+            }
+        }
+
+        public bool Registration(string login, string password, string Fname, string Sname, string Mname, string email)
+        {
             #region Валидация
             if (Login.Text == "" || Password.Password == "" || FirstName.Text == "" || SecondName.Text == "" || Email.Text == "")
             {
                 ErrorWindow ew = new ErrorWindow("пустые поля");
                 ew.Show();
-                return;
+                return false;
             }
             if (Connection.db.Users.Select(item => item.Login).Contains(Login.Text))
             {
                 ErrorWindow ew = new ErrorWindow("такой пользователь уже существует");
                 ew.Show();
-                return;
+                return false;
             }
             if (!IsValidEmail(Email.Text))
             {
                 ErrorWindow ew = new ErrorWindow("неверный формат почты");
                 ew.Show();
-                return;
+                return false;
             }
             #endregion
 
@@ -65,16 +84,8 @@ namespace CybersportTournament
 
             Connection.db.Users.Add(user);
             Connection.db.SaveChanges();
+            return true;
             #endregion
-
-
-            #region Результат и переход на окно авторизации
-            RegitrationConfirmedWindow rcw = new RegitrationConfirmedWindow();
-            rcw.Show();
-
-            AuthorizationWindow aw = new AuthorizationWindow();
-            aw.Show();
-            this.Close();
             #endregion
         }
 

+ 20 - 0
UnitTests/App.Config

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <configSections>
+    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
+    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+  </configSections>
+  <connectionStrings>
+    <add name="CybersportTournamentsEntities" connectionString="metadata=res://*/CybersportTournamentModel.csdl|res://*/CybersportTournamentModel.ssdl|res://*/CybersportTournamentModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=TRIPS;initial catalog=CybersportTournaments;integrated security=True;multipleactiveresultsets=True;application name=EntityFramework&quot;" providerName="System.Data.EntityClient" />
+  </connectionStrings>
+  <entityFramework>
+    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
+      <parameters>
+        <parameter value="mssqllocaldb" />
+      </parameters>
+    </defaultConnectionFactory>
+    <providers>
+      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
+    </providers>
+  </entityFramework>
+</configuration>

+ 20 - 0
UnitTests/Properties/AssemblyInfo.cs

@@ -0,0 +1,20 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("UnitTests")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("UnitTests")]
+[assembly: AssemblyCopyright("Copyright ©  2021")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+[assembly: ComVisible(false)]
+
+[assembly: Guid("0f442f2d-5653-4056-82c1-e9c541ba624f")]
+
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 67 - 0
UnitTests/UnitTest1.cs

@@ -0,0 +1,67 @@
+using CybersportTournament;
+using CybersportTournament.AddWindows;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System;
+
+namespace UnitTests
+{
+    [TestClass]
+    public class UnitTest
+    {
+        [TestMethod]
+        public void TestRegistration()
+        {
+            var page = new RegistrationWindow();
+
+            Assert.IsTrue(page.Registration("TriPS1", "123", "Максим", "Карбышев", "Евгеньевич", "kmacksim@yandex.ru"));
+            Assert.IsFalse(page.Registration("", "123", "Максим", "Карбышев", "Евгеньевич", "kmacksim@yandex.ru"));
+            Assert.IsFalse(page.Registration("TriPS1", "", "Максим", "Карбышев", "Евгеньевич", "kmacksim@yandex.ru"));
+            Assert.IsFalse(page.Registration("TriPS1", "123", "", "Карбышев", "Евгеньевич", "kmacksim@yandex.ru"));
+            Assert.IsFalse(page.Registration("TriPS1", "123", "Максим", "", "Евгеньевич", "kmacksim@yandex.ru"));
+            Assert.IsTrue(page.Registration("TriPS1", "123", "Максим", "Карбышев", "", "kmacksim@yandex.ru"));
+            Assert.IsFalse(page.Registration("TriPS1", "123", "Максим", "Карбышев", "Евгеньевич", ""));
+            Assert.IsFalse(page.Registration("TriPS1", "123", "Максим", "Карбышев", "Евгеньевич", "15463"));
+        }
+
+        [TestMethod]
+        public void TestAuthorization()
+        {
+            var page = new AuthorizationWindow();
+
+            Assert.IsTrue(page.Authorization("TriPS", "123"));
+            Assert.IsFalse(page.Authorization("", "123"));
+            Assert.IsFalse(page.Authorization("TriPS", ""));
+            Assert.IsFalse(page.Authorization("TriPS", "1156415"));
+        }
+
+        [TestMethod]
+        public void TestMatchPeriod()
+        {
+            var page = new AddRoundWindow();
+            TimeSpan matchPeriod = new TimeSpan(0, 0, 0);
+            TimeSpan result = new TimeSpan(1, 30, 00);
+
+            Assert.AreEqual(page.MatchPeriod("1:30", matchPeriod), result);
+        }
+
+        [TestMethod]
+        public void TestMatchResult()
+        {
+            var page = new AddRoundWindow();
+
+            Assert.AreEqual(page.MatchResult("16:0", "0:0"), "1:0");
+            Assert.AreEqual(page.MatchResult("0:16", "0:0"), "0:1");
+            Assert.AreEqual(page.MatchResult("16:16", "0:0"), "ошибка");
+            Assert.AreEqual(page.MatchResult("16:0", "1:0"), "2:0");
+            Assert.AreEqual(page.MatchResult("0:16", "1:0"), "1:1");
+            Assert.AreEqual(page.MatchResult("16:0", "0:1"), "1:1");
+            Assert.AreEqual(page.MatchResult("0:16", "0:1"), "0:2");
+        }
+
+        [TestMethod]
+        public void TestHash()
+        {
+            Assert.AreEqual(Encrypt.Hash("123"), "5fa285e1bebe0a6623e33afc04a1fbd5");
+        }
+    }
+}

+ 92 - 0
UnitTests/UnitTests.csproj

@@ -0,0 +1,92 @@
+<?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.2.2.7\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.2.2.7\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>{0F442F2D-5653-4056-82C1-E9C541BA624F}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>UnitTests</RootNamespace>
+    <AssemblyName>UnitTests</AssemblyName>
+    <TargetFrameworkVersion>v4.7.2</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="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
+      <HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll</HintPath>
+    </Reference>
+    <Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
+      <HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\MSTest.TestFramework.2.2.7\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.2.2.7\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
+    </Reference>
+    <Reference Include="PresentationCore" />
+    <Reference Include="PresentationFramework" />
+    <Reference Include="System" />
+    <Reference Include="System.ComponentModel.DataAnnotations" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Runtime.Serialization" />
+    <Reference Include="System.Security" />
+    <Reference Include="System.Xml" />
+    <Reference Include="WindowsBase" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="UnitTest1.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.Config" />
+    <None Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\CybersportTournament\CybersportTournament.csproj">
+      <Project>{3154febb-f742-4a22-9c23-f76f3d47d16f}</Project>
+      <Name>CybersportTournament</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
+  </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.2.2.7\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.2.7\build\net45\MSTest.TestAdapter.props'))" />
+    <Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.2.7\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.2.7\build\net45\MSTest.TestAdapter.targets'))" />
+  </Target>
+  <Import Project="..\packages\MSTest.TestAdapter.2.2.7\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.2.2.7\build\net45\MSTest.TestAdapter.targets')" />
+</Project>

+ 7 - 0
UnitTests/packages.config

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="EntityFramework" version="6.2.0" targetFramework="net472" />
+  <package id="EntityFramework.ru" version="6.2.0" targetFramework="net472" />
+  <package id="MSTest.TestAdapter" version="2.2.7" targetFramework="net472" />
+  <package id="MSTest.TestFramework" version="2.2.7" targetFramework="net472" />
+</packages>