Skip to content

Готово #85

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
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1014b0b
added Last and first name
Sep 12, 2019
2584bf1
Add files via upload
Veniamin1511 Jan 8, 2020
5ab8753
Сложновато
Veniamin1511 Jan 8, 2020
b6c35ad
Update README.md
Veniamin1511 Jan 8, 2020
622704e
YES
Veniamin1511 Jan 9, 2020
dea2319
OO
Veniamin1511 Jan 9, 2020
80f8bcd
OO
Veniamin1511 Jan 9, 2020
177d14a
Game
Veniamin1511 Jan 9, 2020
d3c9ab8
Add files via upload
Veniamin1511 Jan 10, 2020
da7ee35
Delete Program.cs
Veniamin1511 Jan 10, 2020
d80e2da
Update Pig.cs
Veniamin1511 Jan 10, 2020
29f89fd
Update PigTest.cs
Veniamin1511 Jan 10, 2020
2ee9a22
Update CourseApp.Tests.csproj
Veniamin1511 Jan 10, 2020
b1075d3
Update CourseApp.csproj
Veniamin1511 Jan 10, 2020
d15beb7
Delete Archer.cs
Veniamin1511 Jan 10, 2020
a2733cb
Delete Fight.cs
Veniamin1511 Jan 10, 2020
ab4694e
Delete Game.cs
Veniamin1511 Jan 10, 2020
0b6b00f
Delete Hero.cs
Veniamin1511 Jan 10, 2020
cdb32e7
Delete Knight.cs
Veniamin1511 Jan 10, 2020
8cc6ba3
Delete Logger.cs
Veniamin1511 Jan 10, 2020
0bde9c7
Delete Mage.cs
Veniamin1511 Jan 10, 2020
2c11087
Delete Program.cs
Veniamin1511 Jan 10, 2020
3ff0780
Delete RPG.csproj
Veniamin1511 Jan 10, 2020
89af019
Update Pig.cs
Veniamin1511 Jan 10, 2020
eac4c7b
Update PigTest.cs
Veniamin1511 Jan 10, 2020
b7c8a02
Update Pig.cs
Veniamin1511 Jan 10, 2020
c750997
Update PigTest.cs
Veniamin1511 Jan 10, 2020
86b8315
V1
Veniamin1511 Jan 11, 2020
01d38aa
v1.0.1
Veniamin1511 Jan 11, 2020
28bf47d
1.01
Veniamin1511 Jan 11, 2020
9a0fd0e
1.0.1
Veniamin1511 Jan 11, 2020
e935b07
Add files via upload
Veniamin1511 May 18, 2020
5ad75e0
Линукс, а также я ранее свою страничку html в гит загружал
Veniamin1511 May 26, 2020
bedb4a0
Add files via upload
Veniamin1511 May 26, 2020
e8ac66b
Interface
Veniamin1511 Jun 5, 2020
bca093f
ARbeit
Veniamin1511 Jun 18, 2020
488cc3c
Merge pull request #1 from Veniamin1511/Veniamin1511-patch-1
Veniamin1511 Jun 18, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
205 changes: 205 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
# Download this file using PowerShell v3 under Windows with the following comand:
# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore
# or wget:
# wget --no-check-certificate http://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results

[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc

# OS generated files #
.DS_Store*
Icon?

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
*.ncrunch*
.*crunch*.local.xml

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.Publish.xml

# Windows Azure Build Output
csx
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
*.Cache
ClientBin/
# [Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings
modulesbin/
tempbin/

# EPiServer Site file (VPP)
AppData/

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# vim
*.txt~
*.swp
*.swo

# svn
.svn

# Remainings from resolvings conflicts in Source Control
*.orig

# SQL Server files
**/App_Data/*.mdf
**/App_Data/*.ldf
**/App_Data/*.sdf


#LightSwitch generated files
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml

# =========================
# Windows detritus
# =========================

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Mac desktop service store files
.DS_Store

# SASS Compiler cache
.sass-cache

# Visual Studio 2014 CTP
**/*.sln.ide

# Visual Studio temp something
.vs/

# VS 2015+
*.vc.vc.opendb
*.vc.db

# Rider
.idea/

**/node_modules/*

# Added by Jskonst
Properties/

#####
# End of core ignore list, below put you custom 'per project' settings (patterns or path)
#####
7 changes: 7 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": []
}
75 changes: 75 additions & 0 deletions CourseApp.Tests/DemoTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
using System;
using System.Collections.Generic;
using Xunit;

namespace CourseApp.Tests
{
public class DemoTest
{
[Fact]
public void Test1()
{
Assert.True(true);
}

[Fact]
public void TestEmptyListA()
{
double a = 0.1;
double b = 0.5;
double xn = 1.37;
double xk = 2.57;
double dx = 0.3;
Assert.Empty(Program.TaskA(a, b, xn, xk, dx));
}

[Fact]
public void TestTaskA()
{
double a = 0.8;
double b = 0.4;
double xn = 1.23;
double xk = 7.23;
double dx = 1.2;
List<double> res = Program.TaskA(a, b, xn, xk, dx);
List<double> expy = new List<double> { 2.237126168657003, 2.215581361121909, 2.5269082194827885, 2.785377126824208, 3.0079000350329963 };
for (int i = 0; i < 5; i++)
{
Assert.Equal(expy[i], res[i], 3);
}
}

[Fact]
public void TestXnMoreThenXk()
{
List<double> res = Program.TaskA(0.8, 0.4, 1.23, 7.23, 1.2);
Assert.Equal(res, new List<double>());
}

[Fact]
public void TestDx()
{
List<double> res = Program.TaskA(0.8, 0.4, 1.23, 7.23, 1.2);
Assert.Equal(res, new List<double>());
}

[Fact]
public void TestEmptyListB()
{
List<double> x = new List<double>();
Assert.Empty(Program.TaskB(0.8, 0.4, x));
}

[Fact]
public void TestTaskB()
{
List<double> x = new List<double> { 1.88, 2.26, 3.84, 4.55, -6.21 };
List<double> res = Program.TaskB(0.8, 0.4, x);
List<double> expy = new List<double> { 2.0558467733507353, 2.1665433513017915, 2.5754036757838303, 2.7287991234367484, double.NaN };
for (int i = 0; i < 5; i++)
{
Assert.Equal(expy[i], res[i], 3);
}
}
}
}
54 changes: 54 additions & 0 deletions CourseApp.Tests/PigTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using System;
using Xunit;

namespace CourseApp.Tests
{
public class PigTest
{
[Fact]
public void TestEmptyConstructor()
{
var item = new Pig();
Assert.Equal("Test", item.Name);
Assert.Equal(1, item.Age);
Assert.Equal(1, item.Salo);
Assert.Equal("Male", item.Gender);
}

[Theory]
[InlineData("PigMale", 5, 7, "Male")]
[InlineData("PigFemale", 2, 1, "Female")]
[InlineData("PigPigger", 10, 11, "Male")]
public void TestFullConstructor(string name, int age, int salo, string gender)
{
var item = new Pig(name, age, salo, gender);
Assert.Equal(age, item.Age);
Assert.Equal(name, item.Name);
Assert.Equal(salo, item.Salo);
Assert.Equal(gender, item.Gender);
}

[Fact]
public void TestRightSetAge()
{
var item = new Pig();
item.Age = 11;
Assert.Equal(11, item.Age);
}

[Fact]
public void TestWrongSetAge()
{
try
{
var item = new Pig();
item.Age = -100;
}
catch (System.Exception)
{
Console.WriteLine("Возраст должен быть больше 1 года");
Assert.True(true);
}
}
}
}
31 changes: 31 additions & 0 deletions CourseApp/CourseApp.sln
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.28307.852
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CourseApp", "CourseApp.csproj", "{17CB0273-34D3-4D23-965F-FC4AD0A83D0F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CourseApp.Tests", "..\CourseApp.Tests\CourseApp.Tests.csproj", "{E0133767-62A2-4B4A-87A2-BD09BC775E0A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{17CB0273-34D3-4D23-965F-FC4AD0A83D0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{17CB0273-34D3-4D23-965F-FC4AD0A83D0F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{17CB0273-34D3-4D23-965F-FC4AD0A83D0F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{17CB0273-34D3-4D23-965F-FC4AD0A83D0F}.Release|Any CPU.Build.0 = Release|Any CPU
{E0133767-62A2-4B4A-87A2-BD09BC775E0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E0133767-62A2-4B4A-87A2-BD09BC775E0A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E0133767-62A2-4B4A-87A2-BD09BC775E0A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E0133767-62A2-4B4A-87A2-BD09BC775E0A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1849B280-B447-4D18-9764-F412B7768C4F}
EndGlobalSection
EndGlobal
Loading