-
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
Open
ping666
wants to merge
18
commits into
ISUCT:Anastasija_Zajtseva
Choose a base branch
from
ping666:Anastasija_Zajtseva
base: Anastasija_Zajtseva
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
2a2c270
что-то
5e51ad0
First lab
57c8d90
Add Lab_3
04a2809
add test
ee71a4c
1 laba and all tests
9969670
Added stylecop for project
jskonst c4a7f5d
Added stylecop for project
jskonst fab3925
Ispravila
35c11ae
Corrected
bc60700
Corrected city
292a21d
Corrected city kill
31b0eab
Corrected city kill
a06bf51
Corrected city kill aaaaaaaa
d794ab5
Fixed problems with tests
jskonst 7ac8860
Merge pull request #1 from jskonst/Anastasija_Zajtseva_1
ping666 9974217
Corrected test
cd1209f
Metropolis
bb0b2a2
Metropolis
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| using System; | ||
| using CourseApp; | ||
| using Xunit; | ||
|
|
||
| namespace Test | ||
| { | ||
| public class UnitTest1 | ||
| { | ||
| [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); | ||
| 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); | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| using System; | ||
|
|
||
| namespace CourseApp | ||
| { | ||
| public abstract class Metropolis | ||
| { | ||
| private int population; | ||
|
|
||
| public Metropolis() | ||
| { | ||
| Name = "Иваново"; | ||
| population = 316; | ||
| } | ||
|
|
||
| public string Name { get; set; } | ||
| { | ||
| public class City | ||
|
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. Воу воу - сразу нет - 1 файл 1 класс |
||
| { | ||
| 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} вымерло из-за аварии на АЭС."; | ||
| } | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,58 @@ | ||
| using System; | ||
| using static CourseApp.Metropolis; | ||
|
|
||
| namespace CourseApp | ||
| { | ||
| class Program | ||
| public class Program | ||
| { | ||
| static void Main(string[] args) | ||
| public static double Formula(double x, double a, double b) => (a + ((Math.Sin(b * x) * Math.Sin(b * x)) / (Math.Cos(b * x) * Math.Cos(b * x)))) / (b + (Math.Cos(a * x) * Math.Cos(a * x) / (Math.Sin(a * x) * Math.Sin(a * x)))); | ||
|
|
||
| private static void Main(string[] args) | ||
| { | ||
| Console.WriteLine("Hello World!"); | ||
| Console.WriteLine("Анастасия Зайцева"); | ||
| Console.WriteLine("вар 17"); | ||
| Console.WriteLine(); | ||
| Console.WriteLine("под А"); | ||
| double a = 0.1; | ||
| double b = 0.5; | ||
| double xn = 0.15; | ||
| double xk = 1.37; | ||
| double dx = 0.25; | ||
| for (double x = xn; x <= xk; x = x + dx) | ||
| { | ||
| Console.WriteLine($" x={x} y={Math.Round(Formula(x, a, b), 3)}"); | ||
| } | ||
|
|
||
| Console.WriteLine(); | ||
| Console.WriteLine("под B"); | ||
| double[] z = new double[] { 0.2, 0.3, 0.44, 0.6, 0.56 }; | ||
| foreach (double element in z) | ||
| { | ||
| Console.WriteLine($" X={element} y={Math.Round(Formula(element, a, b), 3)} "); | ||
| } | ||
|
|
||
| City ivanovo = new City(); // вызов 1-ого | ||
| City moscow = new City("Москва", "Россия"); // вызов 2-ого | ||
| City peter = new City("Питер", "Россия", 9000); // вызов 3-ого | ||
| ivanovo.GetInfo(); | ||
|
|
||
| ivanovo.Population = 5; | ||
| Console.WriteLine(ivanovo.Name); | ||
| ivanovo.GetInfo(); | ||
| ivanovo.Population = -1; | ||
|
|
||
| ivanovo.GetInfo(); | ||
|
|
||
| moscow.GetInfo(); | ||
| peter.GetInfo(); | ||
| ivanovo.AddPopulation(100); | ||
| ivanovo.GetInfo(); | ||
|
|
||
| Console.WriteLine(ivanovo.Dead()); | ||
| Console.WriteLine(moscow.Dead()); | ||
| Console.WriteLine(peter.Dead()); | ||
|
|
||
| Console.Read(); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. Можо каким-то другим редактором поддреживающим кодировку? |
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Эти тесты должны быть в отдельном файле
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.
Это упорно игнорируете :(