-
Notifications
You must be signed in to change notification settings - Fork 23
Viktor morohovtsev #36
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
Merged
jskonst
merged 17 commits into
ISUCT:Viktor_Morohovtsev
from
DressCodeBoy:Viktor_Morohovtsev
Dec 16, 2019
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
9acf321
Initial app
56d629a
Merge branch 'master' into Viktor_Morohovtsev
aeb27bc
Sample of 1st lab
0247220
Tests samples
d514055
Added actions file
jskonst b29aa60
Fixed run steps (#28)
jskonst dbae387
Test actions on PR (#30)
jskonst 953427e
Added tests and sample A|B tasks
jskonst 62b5d9e
Added class task example, added vscode conf
aa0b4b1
Merge branch 'master' of https://github.com/ISUCT/Tprogramming_147_2019
9faae24
merged changes
DressCodeBoy 997c01c
task a,b and tests
DressCodeBoy 36010a7
using collections
DressCodeBoy dd46d49
netcore 2.1
DressCodeBoy 570aa3d
netcore version
DressCodeBoy fae2fb3
added class
DressCodeBoy 1598ab5
added tests
DressCodeBoy 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,23 @@ | ||
name: .NET Core | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 3.0.100 | ||
- name: Build with dotnet | ||
run: | | ||
cd CourseApp | ||
dotnet build --configuration Release | ||
- name: Run tests | ||
run: | | ||
cd CourseApp.Tests | ||
dotnet test |
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,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) | ||
##### |
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>netcoreapp3.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,56 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Xunit; | ||
|
||
namespace CourseApp.Tests | ||
{ | ||
public class DemoTest | ||
{ | ||
[Fact] | ||
public void Test1() | ||
{ | ||
Assert.True(true); | ||
} | ||
|
||
[Fact] | ||
public void TestMyFunctionZeros() | ||
{ | ||
var res = Program.Formula(0.0, 0.0); | ||
Assert.Equal(double.NaN, res); | ||
} | ||
|
||
[Fact] | ||
public void TestTaskB() | ||
{ | ||
List<double> x = new List<double> { 1.84, 4.05, 3.67, 2.18, 1.17 }; | ||
List<double> res = Program.TaskB(1.6, x); | ||
List<double> expy = new List<double> { 3.691061372588238, 1392.8345934281351, 350.7785466064311, 6.25933353327923, 2.622414465082322 }; | ||
for (int i = 0; i < 5; i++) | ||
{ | ||
Assert.Equal(expy[i], res[i], 3); | ||
} | ||
} | ||
|
||
[Fact] | ||
public void TestTaskA() | ||
{ | ||
double a = 1.6; | ||
double xn = 1.2; | ||
double xk = 3.7; | ||
double dx = 0.5; | ||
List<double> res = Program.TaskA(a, xn, xk, dx); | ||
List<double> expy = new List<double> { 2.58628588710697, 3.15454831838707, 6.49450906742811, 19.428489457705, 76.9595290357977 }; | ||
for (int i = 0; i < 5; i++) | ||
{ | ||
Assert.Equal(expy[i], res[i], 3); | ||
} | ||
} | ||
|
||
[Fact] | ||
public void XnMoreThanXkAndUncorrectDx() | ||
{ | ||
List<double> res = Program.TaskA(1.6, 3.7, 1.2, 0.7); | ||
Assert.Equal(res, new List<double>()); | ||
} | ||
} | ||
} |
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,78 @@ | ||
using System; | ||
using Xunit; | ||
|
||
namespace CourseApp.Tests | ||
{ | ||
public class PersonTest | ||
{ | ||
[Fact] | ||
public void TestConstructor() | ||
{ | ||
var item = new Person(); | ||
Assert.Equal(18, item.Age); | ||
Assert.Equal("Name", item.Name); | ||
Assert.Equal("LastName", item.LastName); | ||
} | ||
|
||
[Fact] | ||
public void TestSetAge() | ||
{ | ||
var item = new Person(); | ||
item.Age = 30; | ||
Assert.Equal(30, item.Age); | ||
} | ||
|
||
[Fact] | ||
public void TestIncorrectSetAge() | ||
{ | ||
try | ||
{ | ||
var item = new Person(); | ||
item.Age = -1000; | ||
} | ||
catch (System.Exception) | ||
{ | ||
Console.WriteLine("Age should be more 0 and less than 100"); | ||
Assert.True(true); | ||
} | ||
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. Проверьте, что не сменился возраст после выбрасывания exception'a |
||
} | ||
|
||
[Fact] | ||
public void TestCorrectIncorrectSetAge() | ||
{ | ||
var item = new Person(); | ||
item.Age = 27; | ||
try | ||
{ | ||
item.Age = -1; | ||
} | ||
catch | ||
{ | ||
Assert.Equal(27, item.Age); | ||
return; | ||
} | ||
|
||
Assert.Equal(27, item.Age); | ||
} | ||
|
||
[Fact] | ||
public void TestIncorrectSetString() | ||
{ | ||
var item = new Person(); | ||
item.Name = string.Empty; | ||
item.LastName = string.Empty; | ||
Assert.Equal(string.Empty, item.Name); | ||
Assert.Equal(string.Empty, item.LastName); | ||
} | ||
|
||
[Fact] | ||
public void TestCorrectSetString() | ||
{ | ||
var item = new Person(); | ||
item.Name = "VikiVik"; | ||
item.LastName = "Moro"; | ||
Assert.Equal("VikiVik", item.Name); | ||
Assert.Equal("Moro", item.LastName); | ||
} | ||
} | ||
} |
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.
Случай когда xn > xk и случай dx > xk-xn