Саша Лебедева 2 years ago
parent
commit
fd15829a9c

+ 6 - 0
Examen31P_LebedevaAF.sln

@@ -5,6 +5,8 @@ VisualStudioVersion = 17.2.32526.322
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Examen31P_LebedevaAF", "Examen31P_LebedevaAF\Examen31P_LebedevaAF.csproj", "{A97F3C4B-CCA7-46D1-A1D8-84709CC25FFA}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTestProject1", "UnitTestProject1\UnitTestProject1.csproj", "{9F912C33-201C-4307-9808-C2158C64B9B6}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -15,6 +17,10 @@ Global
 		{A97F3C4B-CCA7-46D1-A1D8-84709CC25FFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{A97F3C4B-CCA7-46D1-A1D8-84709CC25FFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{A97F3C4B-CCA7-46D1-A1D8-84709CC25FFA}.Release|Any CPU.Build.0 = Release|Any CPU
+		{9F912C33-201C-4307-9808-C2158C64B9B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{9F912C33-201C-4307-9808-C2158C64B9B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{9F912C33-201C-4307-9808-C2158C64B9B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{9F912C33-201C-4307-9808-C2158C64B9B6}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 66 - 0
Examen31P_LebedevaAF/Brak.cs

@@ -0,0 +1,66 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.IO;
+using System.Threading.Tasks;
+
+namespace Examen31P_LebedevaAF
+{
+   public class Brak
+    {
+        /// <summary>
+        /// подсчет погрешности длины
+        /// </summary>
+        /// <returns></returns>
+        public int Dlina ()
+        {
+            int dlprover = 0;
+            dlprover = 4000 / 100 * 1; // один процент допустимой погрешности длины 
+            return dlprover;
+        }
+        public int PN10()
+        {
+            int PN = 0;
+            PN = 4000 / 100 * 1; // один процент допустимой погрешности длины 
+            return PN;
+        }
+
+        public void Prov(string[] m)
+        {
+            double dlina = 0;
+            double diam = 0;
+            double tols = 0;
+            double min = 0;
+            double max = 0;
+            string line = "";
+
+            //значения для проверки выхода за внешний диаметр
+            double minD1 = diam / 100 * 10;
+            double maxD1 = diam / 100 * 11;
+
+
+            //Program obj = new Program();
+            //string l = "";
+            //string[] checking = m[0].Split(';');
+            //for (int i = 0; i < m.Length; i++)
+            //{
+            //    checking = m[i].Split(';');
+            //    if (4000 - m[i, 1] > Dlina) ;
+            //}
+
+        }
+
+        //public void hiojhi(string[] m)
+        //{
+        //    Program obj = new Program();
+        //    string l = "";
+        //    string[] checking = m[0].Split(';');
+        //    for (int i = 0; i < m.Length; i++)
+        //    {
+        //        checking = m[i].Split(';');
+        //        obj.CheckBrak(checking);//проверка на брак
+        //    }
+        //}
+    }
+}

+ 5 - 2
Examen31P_LebedevaAF/Debug.cs

@@ -8,9 +8,12 @@ using System.IO;
 
 namespace Examen31P_LebedevaAF
 {
-    internal class Debugg
+    public class Debugg
     {
-        public static void DebTr()
+        /// <summary>
+        /// Отладочная информации о дате запуска программы в окно отладки и текстовый файл
+        /// </summary>
+        public void DebTr()
         {
             Trace.Listeners.Add(new TextWriterTraceListener("Debug.txt"));
             Debug.Indent();

+ 24 - 2
Examen31P_LebedevaAF/Program.cs

@@ -2,11 +2,33 @@
 using System;
 using System.Diagnostics;
 using System.IO;
+using System.Threading.Tasks;
+using System.Text;
+using System.Collections.Generic;
 
-class Program
+namespace Examen31P_LebedevaAF
 {
-    public static void Main()
+     public class Program
     {
+        public static void Main()
+        {
+            Debugg d = new Debugg();
+            d.DebTr();
+            Brak B = new Brak();
+
+
+            Console.WriteLine("Вывод информации из файла:");
+            string path = "data.txt";
+            var m = File.ReadAllLines(path);
+            
+            for (int i = 0; i < m.Length; i++)
+            {
+                Console.WriteLine(m[i]);
+            }
+            Console.WriteLine();
+           
+
+        }
     }
 }
 

+ 100 - 0
Examen31P_LebedevaAF/data.txt

@@ -0,0 +1,100 @@
+PN10;3982;24,946;2,866;
+PN10;3971;50,237;5,591;
+PN10;4059;32,287;3,503;
+PN10;4036;32,329;3,054;
+PN10;3930;49,398;5,054;
+PN10;4053;31,841;3,390;
+PN10;3975;19,860;1,904;A
+PN10;3996;32,038;3,360;
+PN10;4003;63,514;7,145;
+PN10;4035;19,809;2,126;
+PN10;4063;49,845;4,863;
+PN10;3979;62,848;6,840;
+PN10;4034;32,467;3,066;
+PN10;3979;20,197;2,242;
+PN10;3955;25,175;2,536;
+PN10;3950;31,645;3,587;
+PN10;3953;63,040;6,837;
+PN10;3966;62,289;6,019;A
+PN10;3938;63,430;6,548;
+PN10;3963;25,099;2,760;
+PN10;3935;25,112;2,570;
+PN10;4043;40,271;3,814;
+PN10;3930;39,825;4,400;
+PN10;3947;63,851;6,244;
+PN10;4077;40,122;5,336;
+PN16;3945;20,147;2,798;
+PN16;4008;32,244;4,199;A
+PN16;3977;40,566;5,766;
+PN16;4066;31,698;4,168;
+PN16;3959;19,926;2,722;A
+PN16;3948;49,281;6,683;A
+PN16;3927;32,341;4,608;
+PN16;3923;20,085;2,630;
+PN16;3924;24,776;3,313;A
+PN16;3933;63,627;8,763;
+PN16;4004;20,153;2,636;
+PN16;4030;40,450;5,399;A
+PN16;3967;62,660;8,472;
+PN16;3997;32,065;4,392;
+PN16;4074;49,710;6,718;
+PN16;3939;40,478;5,393;
+PN16;4014;49,741;7,087;A
+PN16;3988;25,238;3,485;
+PN16;4071;19,844;2,820;
+PN16;3952;39,952;5,444;A
+PN16;3974;25,190;3,532;
+PN16;3945;19,954;2,697;
+PN16;4023;50,311;6,753;
+PN16;3999;32,144;4,400;
+PN16;3926;63,346;8,967;
+PN20;4061;40,244;6,991;
+PN20;4065;39,744;6,842;
+PN20;4011;32,118;5,295;
+PN20;4048;49,696;8,317;A
+PN20;3954;24,901;4,139;
+PN20;3979;19,954;3,461;A
+PN20;4009;39,960;6,866;A
+PN20;4025;20,065;3,358;
+PN20;3952;20,114;3,440;
+PN20;3946;25,151;4,139;A
+PN20;3992;19,838;3,250;
+PN20;3951;39,593;6,758;A
+PN20;3963;40,522;6,765;
+PN20;4058;32,173;5,121;A
+PN20;3952;20,286;3,433;A
+PN20;3954;20,150;3,209;
+PN20;4005;25,219;4,198;
+PN20;3940;40,372;6,450;A
+PN20;4036;50,312;8,037;
+PN20;4069;63,485;10,198;
+PN20;4004;49,382;7,971;
+PN20;4029;62,439;10,519;
+PN20;3961;50,727;8,643;
+PN20;3968;40,554;6,839;A
+PN20;4080;20,031;3,411;
+PN25;4021;20,100;3,486;A
+PN25;4038;39,752;6,413;A
+PN25;3945;49,263;8,299;A
+PN25;4065;19,932;3,435;A
+PN25;4060;25,072;4,340;A
+PN25;4063;31,867;5,473;A
+PN25;3959;20,230;3,441;A
+PN25;3938;50,223;8,548;A
+PN25;4004;62,309;10,537;A
+PN25;3979;20,153;3,206;A
+PN25;3994;31,655;5,557;A
+PN25;4035;25,200;4,150;A
+PN25;3997;49,295;8,051;
+PN25;3991;32,478;5,502;A
+PN25;3944;39,493;6,638;A
+PN25;4068;19,821;3,304;
+PN25;3934;20,039;3,417;A
+PN25;4033;63,017;10,910;
+PN25;3968;20,046;3,350;A
+PN25;4014;62,603;10,080;A
+PN25;4057;24,791;4,117;A
+PN25;3977;40,109;6,970;A
+PN25;4012;49,395;8,121;A
+PN25;3922;19,843;3,371;A
+PN25;3940;25,350;4,168;A

+ 20 - 0
UnitTestProject1/Properties/AssemblyInfo.cs

@@ -0,0 +1,20 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("UnitTestProject1")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("UnitTestProject1")]
+[assembly: AssemblyCopyright("Copyright ©  2022")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+[assembly: ComVisible(false)]
+
+[assembly: Guid("9f912c33-201c-4307-9808-c2158c64b9b6")]
+
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 17 - 0
UnitTestProject1/UnitTest1.cs

@@ -0,0 +1,17 @@
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Examen31P_LebedevaAF;
+
+namespace UnitTestProject1
+{
+    [TestClass]
+    public class UnitTest1
+    {
+        [TestMethod]
+        public void TestMethod1()
+        {
+            int x = 4000;
+            int y = 4500;
+            
+        }
+    }
+}

+ 74 - 0
UnitTestProject1/UnitTestProject1.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.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>{9F912C33-201C-4307-9808-C2158C64B9B6}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>UnitTestProject1</RootNamespace>
+    <AssemblyName>UnitTestProject1</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="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="System" />
+    <Reference Include="System.Core" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="UnitTest1.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\Examen31P_LebedevaAF\Examen31P_LebedevaAF.csproj">
+      <Project>{a97f3c4b-cca7-46d1-a1d8-84709cc25ffa}</Project>
+      <Name>Examen31P_LebedevaAF</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.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>

+ 5 - 0
UnitTestProject1/packages.config

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

+ 100 - 0
data.txt

@@ -0,0 +1,100 @@
+PN10;3982;24,946;2,866;
+PN10;3971;50,237;5,591;
+PN10;4059;32,287;3,503;
+PN10;4036;32,329;3,054;
+PN10;3930;49,398;5,054;
+PN10;4053;31,841;3,390;
+PN10;3975;19,860;1,904;A
+PN10;3996;32,038;3,360;
+PN10;4003;63,514;7,145;
+PN10;4035;19,809;2,126;
+PN10;4063;49,845;4,863;
+PN10;3979;62,848;6,840;
+PN10;4034;32,467;3,066;
+PN10;3979;20,197;2,242;
+PN10;3955;25,175;2,536;
+PN10;3950;31,645;3,587;
+PN10;3953;63,040;6,837;
+PN10;3966;62,289;6,019;A
+PN10;3938;63,430;6,548;
+PN10;3963;25,099;2,760;
+PN10;3935;25,112;2,570;
+PN10;4043;40,271;3,814;
+PN10;3930;39,825;4,400;
+PN10;3947;63,851;6,244;
+PN10;4077;40,122;5,336;
+PN16;3945;20,147;2,798;
+PN16;4008;32,244;4,199;A
+PN16;3977;40,566;5,766;
+PN16;4066;31,698;4,168;
+PN16;3959;19,926;2,722;A
+PN16;3948;49,281;6,683;A
+PN16;3927;32,341;4,608;
+PN16;3923;20,085;2,630;
+PN16;3924;24,776;3,313;A
+PN16;3933;63,627;8,763;
+PN16;4004;20,153;2,636;
+PN16;4030;40,450;5,399;A
+PN16;3967;62,660;8,472;
+PN16;3997;32,065;4,392;
+PN16;4074;49,710;6,718;
+PN16;3939;40,478;5,393;
+PN16;4014;49,741;7,087;A
+PN16;3988;25,238;3,485;
+PN16;4071;19,844;2,820;
+PN16;3952;39,952;5,444;A
+PN16;3974;25,190;3,532;
+PN16;3945;19,954;2,697;
+PN16;4023;50,311;6,753;
+PN16;3999;32,144;4,400;
+PN16;3926;63,346;8,967;
+PN20;4061;40,244;6,991;
+PN20;4065;39,744;6,842;
+PN20;4011;32,118;5,295;
+PN20;4048;49,696;8,317;A
+PN20;3954;24,901;4,139;
+PN20;3979;19,954;3,461;A
+PN20;4009;39,960;6,866;A
+PN20;4025;20,065;3,358;
+PN20;3952;20,114;3,440;
+PN20;3946;25,151;4,139;A
+PN20;3992;19,838;3,250;
+PN20;3951;39,593;6,758;A
+PN20;3963;40,522;6,765;
+PN20;4058;32,173;5,121;A
+PN20;3952;20,286;3,433;A
+PN20;3954;20,150;3,209;
+PN20;4005;25,219;4,198;
+PN20;3940;40,372;6,450;A
+PN20;4036;50,312;8,037;
+PN20;4069;63,485;10,198;
+PN20;4004;49,382;7,971;
+PN20;4029;62,439;10,519;
+PN20;3961;50,727;8,643;
+PN20;3968;40,554;6,839;A
+PN20;4080;20,031;3,411;
+PN25;4021;20,100;3,486;A
+PN25;4038;39,752;6,413;A
+PN25;3945;49,263;8,299;A
+PN25;4065;19,932;3,435;A
+PN25;4060;25,072;4,340;A
+PN25;4063;31,867;5,473;A
+PN25;3959;20,230;3,441;A
+PN25;3938;50,223;8,548;A
+PN25;4004;62,309;10,537;A
+PN25;3979;20,153;3,206;A
+PN25;3994;31,655;5,557;A
+PN25;4035;25,200;4,150;A
+PN25;3997;49,295;8,051;
+PN25;3991;32,478;5,502;A
+PN25;3944;39,493;6,638;A
+PN25;4068;19,821;3,304;
+PN25;3934;20,039;3,417;A
+PN25;4033;63,017;10,910;
+PN25;3968;20,046;3,350;A
+PN25;4014;62,603;10,080;A
+PN25;4057;24,791;4,117;A
+PN25;3977;40,109;6,970;A
+PN25;4012;49,395;8,121;A
+PN25;3922;19,843;3,371;A
+PN25;3940;25,350;4,168;A