-
Notifications
You must be signed in to change notification settings - Fork 23
Anastasija zajtseva #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: Anastasija_Zajtseva
Are you sure you want to change the base?
Changes from 13 commits
2a2c270
5e51ad0
57c8d90
04a2809
ee71a4c
9969670
c4a7f5d
fab3925
35c11ae
bc60700
292a21d
31b0eab
a06bf51
d794ab5
7ac8860
9974217
cd1209f
bb0b2a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>netcoreapp2.0</TargetFramework> | ||
| <TreatWarningsAsErrors>True</TreatWarningsAsErrors> | ||
| <NoWarn>1573,1591,1701;1702;1705</NoWarn> | ||
| <IsPackable>false</IsPackable> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" /> | ||
| <PackageReference Include="xunit" Version="2.4.0" /> | ||
| <PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" /> | ||
| <PackageReference Include="StyleCop.Analyzers" Version="1.0.2" PrivateAssets="all" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\CourseApp\CourseApp.csproj" /> | ||
| </ItemGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <CodeAnalysisRuleSet>../stylecop/stylecop.ruleset</CodeAnalysisRuleSet> | ||
| <GenerateFullPaths>true</GenerateFullPaths> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <AdditionalFiles Include="../stylecop/stylecop.json" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| using System; | ||
| using Xunit; | ||
|
|
||
| namespace CourseApp.Tests | ||
| { | ||
| public class DemoTest | ||
| { | ||
| [Fact] | ||
| public void Test1() | ||
| { | ||
| Assert.True(true); | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| namespace Test | ||
| { | ||
| using System; | ||
| using CourseApp; | ||
| using Xunit; | ||
|
|
||
| public class UnitTest1 | ||
| { | ||
| public object Assert { get; private set; } | ||
|
||
|
|
||
| [Fact] | ||
| public void Test1() | ||
| { | ||
| City ivanovo = new City(); | ||
| var rescountry = ivanovo.Country; | ||
| var respopulation = ivanovo.Population ; | ||
| var resname = ivanovo.Name; | ||
| Assert.Equal("������", rescountry); | ||
|
||
| Assert.Equal(316, respopulation); | ||
| Assert.Equal("�������", resname); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void Test2() | ||
| { | ||
| City moscow = new City("������","������"); | ||
| var rescountry = moscow.Country; | ||
| var respopulation = moscow.Population; | ||
| var resname = moscow.Name; | ||
| Assert.Equal("������", rescountry); | ||
| Assert.Equal(11000, respopulation); | ||
| Assert.Equal("������", resname); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void Test3() | ||
| { | ||
| City spb = new City("�����", "������", 9000); | ||
| var rescountry = spb.Country; | ||
| var respopulation = spb.Population; | ||
| var resname = spb.Name; | ||
| Assert.Equal("������", rescountry); | ||
| Assert.Equal(9000, respopulation); | ||
| Assert.Equal("�����", resname); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void Test4() | ||
| { | ||
| var res = Program.Formula(0.1, 0.5, 0.15); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Эти тесты должны быть в отдельном файле
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Это упорно игнорируете :( |
||
| Assert.Equal(0.001, res, 3); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void Test5() | ||
| { | ||
| var res = Program.Formula(0.0, 0.0, 0.1); | ||
| Assert.Equal(0.0, res, 3); | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| using System; | ||
|
|
||
| namespace CourseApp | ||
| { | ||
| public class City | ||
| { | ||
| private int population; | ||
|
|
||
| public City() | ||
| : this("Иваново", "Россия", 316) | ||
| { | ||
| } // 1 конструктор | ||
|
|
||
| public City(string name, string country) | ||
| : this(name, country, 11000) | ||
| { | ||
| } // 2 конструктор | ||
|
|
||
| public City(string name, string country, int population) | ||
| { | ||
| Name = name; | ||
| Country = country; | ||
| Population = population; | ||
| } // 3 конструктор | ||
|
|
||
| public string Country { get; set; } | ||
|
|
||
| public string Name { get; set; } | ||
|
|
||
| public int Population | ||
| { | ||
| get | ||
| { | ||
| return population; | ||
| } | ||
|
|
||
| set | ||
| { | ||
| if (value > 0) | ||
| { | ||
| this.population = value; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| public void GetInfo() | ||
| { | ||
| Console.WriteLine($"Название: {Name} Страна: {Country} Популяция: {population}"); | ||
| } | ||
|
|
||
| public void Addpopulation(int pop) | ||
|
||
| { | ||
| population += pop; | ||
| } | ||
|
|
||
| public string Dead() | ||
| { | ||
| return $"Всё население города {Name} вымерло из-за аварии на АЭС."; | ||
|
||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| | ||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio 15 | ||
| VisualStudioVersion = 15.0.27428.2037 | ||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CourseApp", "CourseApp.csproj", "{3F1471F2-2FB2-4B42-BC14-ECEA29012CB4}" | ||
| EndProject | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CourseApp.Tests", "..\CourseApp.Tests\CourseApp.Tests.csproj", "{5919BA31-3171-43C7-B452-E5EA9330F77A}" | ||
| EndProject | ||
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|Any CPU = Debug|Any CPU | ||
| Release|Any CPU = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| {3F1471F2-2FB2-4B42-BC14-ECEA29012CB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {3F1471F2-2FB2-4B42-BC14-ECEA29012CB4}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {3F1471F2-2FB2-4B42-BC14-ECEA29012CB4}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {3F1471F2-2FB2-4B42-BC14-ECEA29012CB4}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {5919BA31-3171-43C7-B452-E5EA9330F77A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {5919BA31-3171-43C7-B452-E5EA9330F77A}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {5919BA31-3171-43C7-B452-E5EA9330F77A}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {5919BA31-3171-43C7-B452-E5EA9330F77A}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(SolutionProperties) = preSolution | ||
| HideSolutionNode = FALSE | ||
| EndGlobalSection | ||
| GlobalSection(ExtensibilityGlobals) = postSolution | ||
| SolutionGuid = {0AB63177-0A3F-4523-9C64-57B9FF0F9AE0} | ||
| EndGlobalSection | ||
| EndGlobal |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1 @@ | ||
| # Course of c# | ||
|
|
||
| Please write your name and surname here | ||
| ��������� ������� | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Можо каким-то другим редактором поддреживающим кодировку? |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "$schema": | ||
| "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", | ||
| "settings": { | ||
| "documentationRules": { | ||
| "documentExposedElements": false, | ||
| "documentInterfaces": false, | ||
| "companyName": "Test Company", | ||
| "copyrightText": | ||
| "This source code is Copyright © {companyName} and MAY NOT be copied, reproduced,\npublished, distributed or transmitted to or stored in any manner without prior\nwritten consent from {companyName} (www.yourcompany.com).", | ||
| "xmlHeader": false | ||
| } | ||
| }, | ||
| "additionalArguments": ["./stylecop.ruleset", "./stylecop.json"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <RuleSet Name="StyleCopeRules" Description="StyleCopeRules custom ruleset" ToolsVersion="14.0"> | ||
| <IncludeAll Action="None" /> | ||
| <Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers"> | ||
| <Rule Id="SA1101" Action="None" /> | ||
| <Rule Id="SA0001" Action="None" /> | ||
| <Rule Id="SA1210" Action="None" /> | ||
| <Rule Id="SA1633" Action="None" /> | ||
| <Rule Id="SA1600" Action="None" /> | ||
| <Rule Id="AD0001" Action="None" /> | ||
| <Rule Id="CA2234" Action="None" /> | ||
| <Rule Id="SA1200" Action="None" /> | ||
| <Rule Id="SA1000" Action="None" /> | ||
| <Rule Id="SA1012" Action="None" /> | ||
| <Rule Id="SA1012" Action="None" /> | ||
| <Rule Id="SA1009" Action="None" /> | ||
| <Rule Id="SA1012" Action="None" /> | ||
| <Rule Id="SA1652" Action="None" /> | ||
| <Rule Id="CA1305" Action="None" /> | ||
| <Rule Id="CA1056" Action="None" /> | ||
| </Rules> | ||
| </RuleSet> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
это вроде бы как за пределы пространства имен, но если ругаться е будет, то ок