-
Notifications
You must be signed in to change notification settings - Fork 23
Oleg lifanov #54
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
JKL37
wants to merge
19
commits into
ISUCT:Oleg_Lifanov
Choose a base branch
from
JKL37:Oleg_Lifanov
base: Oleg_Lifanov
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
Oleg lifanov #54
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
9969670
Added stylecop for project
jskonst c4a7f5d
Added stylecop for project
jskonst f713a6e
Fix
JKL37 2c90b1b
Added StyleCop
JKL37 62d376d
Added class ship
JKL37 f46561d
Just a lil update
JKL37 bbab079
Modified Ship.cs and added UnitTest2
JKL37 975c145
little update
JKL37 3616629
Completed Classes
JKL37 9ef3860
Added Test3 for Kater and Test4 for Massive
JKL37 6cf9249
Fixed classes and tests
JKL37 1c3e5f2
Renamed Tests
JKL37 672e0df
Renamed Tests v1.1
JKL37 e8242b1
Added Interfaces
JKL37 2023dad
Modified Interfaces
JKL37 f5100da
UPD 1
JKL37 0042e93
Added Tests for interfaces
JKL37 ac7a1df
Added Date task and tests
JKL37 4ec8a16
Added SQL
JKL37 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 |
|---|---|---|
| @@ -1,18 +1,30 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>netcoreapp2.1</TargetFramework> | ||
|
|
||
| <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> | ||
| </Project> | ||
|
|
||
| <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,30 @@ | ||
| using System; | ||
| using Xunit; | ||
| using CourseApp; | ||
|
|
||
| namespace CourseApp.Tests | ||
| { | ||
| public class TestofDate | ||
| { | ||
| [Fact] | ||
| public void EqualDates() | ||
| { | ||
| string schetvozrasta = Date.SchetVozrasta(new DateTime(1999, 9, 30), new DateTime(1999, 9, 30)); | ||
| Assert.Equal("��� �������: 0 ���, 0 �������, 0 ����", schetvozrasta); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void BirthdayBeforeToday() | ||
| { | ||
| string schetvozrasta = Date.SchetVozrasta(new DateTime(1999, 9, 30), new DateTime(2019, 4, 14)); | ||
| Assert.Equal("��� �������: 19 ���, 6 �������, 14 ����", schetvozrasta); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void BirthdayAfterToday() | ||
| { | ||
| string schetvozrasta = Date.SchetVozrasta(new DateTime(2029, 9, 30), new DateTime(2019, 4, 14)); | ||
| Assert.Equal("��� �� �������!", schetvozrasta); | ||
| } | ||
| } | ||
| } |
15 changes: 9 additions & 6 deletions
15
CourseApp.Tests/UnitTest1.cs → CourseApp.Tests/TestofFunction.cs
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,25 @@ | ||
| using System; | ||
| using Xunit; | ||
| using CourseApp; | ||
|
|
||
| namespace CourseApp.Tests | ||
| { | ||
| public class TestofIComparable | ||
| { | ||
| [Fact] | ||
| public void Testcomparable() | ||
| { | ||
| string icomparable = @"Admiral - 200 - 100 | ||
| Duty - 75 - 300 | ||
| Lucky - 90 - 100"; | ||
| Ship admiral = new Ship(); | ||
| Ship lucky = new Ship(90); | ||
| Ship duty = new Ship("Duty", 75, 300); | ||
| Ship[] araryOfShip = new Ship[] { admiral, lucky, duty }; | ||
| Assert.Equal( | ||
| @"Admiral - 200 - 100 | ||
| Duty - 75 - 300 | ||
| Lucky - 90 - 100", icomparable); | ||
| } | ||
| } | ||
| } |
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,51 @@ | ||
| using System; | ||
| using Xunit; | ||
| using CourseApp; | ||
|
|
||
| namespace CourseApp.Tests | ||
| { | ||
| public class TestofKater | ||
| { | ||
| [Fact] | ||
| public void TestofPicture() | ||
| { | ||
| Kater carter = new Kater(); | ||
| Assert.Equal( | ||
| @" | ||
|
|
||
| ░░░░░░░░░░░░░█▀▀▀█████████▄▄▄░░░░░░░░░░░ | ||
| ░░░░░░░░░░░▄█▀░░░░░█▀░░░░░█▀░░░░░░░░░░░░ | ||
| ███████▄▄▄██▄▄▄▄░░░█░░░░░░█░░▀████▄▄▄▄▄▄ | ||
| ░▄░░░▀▀▀▀▀▀▀▀███████████████▄▄▄█▄▄▄█░░██ | ||
| ░▀█████████▄▄▄▄▄▄▄▄▄░░▀▀▀▀▀▀▀▀▀████████░ | ||
| ░░░▀█████████████████████████▄▄▄▄▄▄▄▄▄░░ | ||
| ░░░░░▀▀███████████████████████████████░░ | ||
| ░░░░░░░░░░░▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀░░░ | ||
| ", carter.Picture()); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void Testofznacheniya() | ||
| { | ||
| Kater carter = new Kater(); | ||
| Assert.Equal("Carter", carter.Name); | ||
| Assert.Equal(10, carter.Dlina); | ||
| Assert.Equal(50, carter.Maxspeed); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void Testofpredlojeniya() | ||
| { | ||
| Kater carter = new Kater(); | ||
| Assert.Equal($"Катер {carter.Name} поплыл вдоль реки", carter.Predlojenie()); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void CarterISwim() | ||
| { | ||
| Kater carter = new Kater(); | ||
| string iswim = carter.Swim(carter); | ||
| Assert.Equal($"{carter.Name} плывет по течению", iswim); | ||
| } | ||
| } | ||
| } |
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,88 @@ | ||
| using System; | ||
| using Xunit; | ||
| using CourseApp; | ||
|
|
||
| namespace CourseApp.Tests | ||
| { | ||
| public class TestofShip | ||
| { | ||
| [Fact] | ||
| public void TestofRis() | ||
| { | ||
| Ship admiral = new Ship(); | ||
| Assert.Equal( | ||
| @"_��� | ||
| _____________________� | ||
| _____________________������������� | ||
| _____________________���___�__�_���� | ||
| _____________________���___����___�� | ||
| _____________________���__�����___�� | ||
| _____________________���__�����___� | ||
| _____________________������__��___� | ||
| _____________________�_________���� | ||
| _____________������������� | ||
| _____________��___________�� | ||
| ______________�____________� | ||
| ______________�_____________� | ||
| _______________�____________� | ||
| _______________�____________�_�� | ||
| _______________�__��������������� | ||
| _____��������������______________� | ||
| _____�____________��_____________��____� | ||
| _____��____________�_____���������������� | ||
| ______�______��������������______________� | ||
| ______��_____��___________�______________�� | ||
| _______�______�____________�______________� | ||
| _______�______��___________�_____________�� | ||
| _______�_______�___________�_____________�� | ||
| ______��_______�___________��____________� | ||
| ______�����������__________��___________�� | ||
| ___________�_�_��________���_____��������_____��� | ||
| ___________�_�_�����������_�������_______�����__�� | ||
| ������_____�_�______��_�_______�_���������___����� | ||
| ��___���������______��_�____�������________�� | ||
| __��________������������������____��______� | ||
| ____�____________________________��_�____� | ||
| _____�_____���_____��_____���_____���___�� | ||
| ______�___��_��___��_�____�_��__________� | ||
| ______��____��_____���_____��__________�� | ||
| _______��_____________________________�� | ||
| ________��___________________________�� | ||
| _________��________________________��� | ||
| ___________������������������������� | ||
| ", admiral.Ris()); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void Testofznacheniya() | ||
| { | ||
| Ship admiral = new Ship(); | ||
| Assert.Equal("Admiral", admiral.Name); | ||
| Assert.Equal(55, admiral.Dlina); | ||
| Assert.Equal(100, admiral.Vodoizmeschenie); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void Testofpredlojenia() | ||
| { | ||
| Ship admiral = new Ship(); | ||
| Assert.Equal($"������� {admiral.Name} ����� � �������� ����", admiral.Predlojenie()); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void AdmiralISwim() | ||
| { | ||
| Ship admiral = new Ship(); | ||
| string iswim = admiral.Swim(admiral); | ||
| Assert.Equal($"������� Admiral ����������� � �������", iswim); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void LuckyISwim() | ||
| { | ||
| Ship lucky = new Ship(90); | ||
| string iswim = lucky.Swim(lucky); | ||
| Assert.Equal($"������� Lucky ����������� � �������", iswim); | ||
| } | ||
| } | ||
| } |
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,26 @@ | ||
| using System; | ||
|
|
||
| namespace CourseApp | ||
| { | ||
| public class Date | ||
| { | ||
| public static string SchetVozrasta(DateTime bornday, DateTime today) | ||
| { | ||
| DateTime todaydate = today; | ||
| if (today.Day == bornday.Day) | ||
| { | ||
| return "Ваш возраст: 0 лет, 0 месяцев, 0 дней"; | ||
| } | ||
|
|
||
| if (today < bornday) | ||
| { | ||
| return $"Еще не родился!"; | ||
| } | ||
|
|
||
| todaydate = todaydate.AddYears(-bornday.Year); | ||
| todaydate = todaydate.AddMonths(-bornday.Month); | ||
| todaydate = todaydate.AddDays(-bornday.Day); | ||
| return $"Ваш возраст: {todaydate.Year} лет, {todaydate.Month} месяцев, {todaydate.Day} дней"; | ||
| } | ||
| } | ||
| } |
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,9 @@ | ||
| using System; | ||
|
|
||
| namespace CourseApp | ||
| { | ||
| public interface ISwim | ||
| { | ||
| string Swim(object o); | ||
| } | ||
| } |
Oops, something went wrong.
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.
Переименуйте файлы тестов - чтобы было ясно кого ои тестируют