Skip to content
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

Html #91

Open
wants to merge 50 commits into
base: master
Choose a base branch
from
Open

Html #91

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
62fccd2
commit 3
Sep 12, 2019
12db491
Merge pull request #1 from Flamingo-37/Ilja_Raskatov
jskonst Sep 12, 2019
d9ea99d
Merge branch 'master' into Ilja_Raskatov
Oct 3, 2019
4ad39b2
Merge pull request #19 from Flamingo-37:Ilja_Raskatov
jskonst Oct 10, 2019
096478a
Solve task A and B
Flamingo-37 Oct 22, 2019
34ee0b9
Solve
Flamingo-37 Oct 22, 2019
8ed5f9c
lab 2.1
Flamingo-37 Nov 8, 2019
008ceb3
Lab 2.1
Flamingo-37 Nov 8, 2019
5017c9e
Lab 2.1
Flamingo-37 Nov 8, 2019
aca57bf
lab 2.2 Add Test
Flamingo-37 Nov 11, 2019
2bc3402
Update Program.cs
Flamingo-37 Nov 11, 2019
70c009d
Update Program.cs
Flamingo-37 Nov 11, 2019
1b6c674
Update Program.cs
Flamingo-37 Nov 11, 2019
7db2d03
Update Program.cs
Flamingo-37 Nov 11, 2019
2bed232
Update DemoTest.cs
Flamingo-37 Nov 11, 2019
0d9f210
Update DemoTest.cs
Flamingo-37 Nov 11, 2019
6892396
Update DemoTest.cs
Flamingo-37 Nov 11, 2019
0c9ccbb
Try add gitclone
Flamingo-37 Nov 11, 2019
61537fa
Merge branch 'Ilja_Raskatov' of https://github.com/Flamingo-37/Tprogr…
Flamingo-37 Nov 11, 2019
d703fa2
Update DemoTest.cs
Flamingo-37 Nov 12, 2019
ec5c050
Update CourseApp.Tests.csproj
Flamingo-37 Nov 12, 2019
202ec1f
Add Class Pig
Flamingo-37 Nov 12, 2019
561e745
Add Class Pig
Flamingo-37 Nov 12, 2019
3341088
Fix csproj
Flamingo-37 Nov 12, 2019
61f074a
Дополнения 1 и 2
Flamingo-37 Dec 5, 2019
64623e8
Ilja raskatov (#27)
Flamingo-37 Dec 12, 2019
ba56d21
Age
Flamingo-37 Dec 14, 2019
c687da5
Merge branch 'master' into Ilja_Raskatov
Flamingo-37 Dec 14, 2019
9fe6a87
Add SuperClass Without Tests
Flamingo-37 Dec 16, 2019
bd331ed
Add SuperClass without Tests
Flamingo-37 Dec 16, 2019
cf8512a
SuperClass
Flamingo-37 Dec 16, 2019
ebec247
Merge branch 'Ilja_Raskatov' of https://github.com/Flamingo-37/Tprogr…
Flamingo-37 Dec 16, 2019
7ef2eb8
SuperClass
Flamingo-37 Dec 16, 2019
6d0e7fe
SuperClass without Tests
Flamingo-37 Dec 16, 2019
881448f
I dont know what is happened with git (
Flamingo-37 Dec 16, 2019
c5a4041
Solve Problem
Flamingo-37 Dec 16, 2019
3d7ea9b
Add RPG
Flamingo-37 Jan 6, 2020
7811991
Merge branch 'Ilja_Raskatov' into Flamingo-37
Flamingo-37 Jan 6, 2020
8c3ce0d
Fix
Flamingo-37 Jan 9, 2020
c36ee06
Fix
Flamingo-37 Jan 9, 2020
d7a7033
fix2
Flamingo-37 Jan 9, 2020
9e7164d
fix3
Flamingo-37 Jan 9, 2020
fcc8e86
fix4.......
Flamingo-37 Jan 9, 2020
79b2e06
Fix5
Flamingo-37 Jan 9, 2020
8105d44
Fix RPG
Flamingo-37 Jan 9, 2020
46e97da
Fix RPG
Flamingo-37 Jan 9, 2020
6d71ef5
Fix RPG Test
Flamingo-37 Jan 9, 2020
155bfde
Create HTML Link
Flamingo-37 Feb 20, 2020
92a41a1
Fix
Flamingo-37 Feb 20, 2020
88d114a
Fix
Flamingo-37 Feb 20, 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
10 changes: 9 additions & 1 deletion .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@ jobs:
dotnet-version: 2.1.802
- name: Build with dotnet
run: |
cd CourseApp
cd CourseApp
dotnet build --configuration Release
- name: Run tests
run: |
cd CourseApp.Tests
dotnet test
- name: Build with dotnet
run: |
cd RPG
dotnet build --configuration Release
- name: Run tests
run: |
cd RPG.Tests
dotnet test
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ $RECYCLE.BIN/
**/node_modules/*

# Added by Jskonst
<<<<<<< HEAD
=======
.vscode/
>>>>>>> 1a30883c302a9f8e4ef3c380d6a061f88385a877
Properties/

#####
Expand Down
20 changes: 20 additions & 0 deletions CourseApp.Tests/AgeTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using Xunit;

namespace CourseApp.Tests
{
public class AgeTest
{
[Fact]
public void TodayBirthdayTest()
{
try
{
Assert.Equal(0, DateTime.Compare(DateTime.Now, AgeClass.CompareTheDate(DateTime.Now, DateTime.Now)));
}
catch (Exception)
{
}
}
}
}
5 changes: 3 additions & 2 deletions CourseApp.Tests/CourseApp.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
Expand All @@ -19,12 +20,12 @@
</ItemGroup>

<PropertyGroup>
<CodeAnalysisRuleSet>../_stylecop/stylecop.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet>../_stylecop/stylecop.ruleset</CodeAnalysisRuleSet>
<GenerateFullPaths>true</GenerateFullPaths>
</PropertyGroup>

<ItemGroup>
<AdditionalFiles Include="../_stylecop/stylecop.json" />
</ItemGroup>

</Project>
</Project>
34 changes: 22 additions & 12 deletions CourseApp.Tests/DemoTest.cs
Original file line number Diff line number Diff line change
@@ -1,35 +1,45 @@
using System;
using System.Collections.Generic;
using Xunit;

namespace CourseApp.Tests
{
public class DemoTest
{
[Theory]
[InlineData(0, 0, 0, double.NaN)]
[InlineData(1, 1, 2, 2.5)]
[InlineData(-1, 1, 1, 0)]
public void TestCalc(double a, double b, double x, double exp)
[InlineData(0.7, 5, 0.2196741002474553)]
[InlineData(2.2, 1.7, 0.4091366343551351)]
[InlineData(0.1, 4, 0.4617896586816621)]
public void TestFunction(double b, double x, double exp)
{
var res = Program.MyFunction(a, b, x);
Assert.Equal(exp, res, 3);
Assert.Equal(Program.Func(b, x), exp, 3);
}

[Fact]
public void TestNormalA()
public void ZeroFunction()
{
var res = Program.Func(0.0, 0.0);
Assert.Equal(double.PositiveInfinity, res);
}

[Fact]
public void TestNormalB()
public void NullMassTest()
{
List<double> mass = new List<double>();
var res = Program.TaskB(2, mass);
Assert.Equal(mass, res);
}

[Fact]
public void TestZeroLengthB()
public void TestTaskB()
{
var res = Program.TaskB(1, 1, new double[0]);
Assert.Empty(res);
List<double> x = new List<double> { 1.1, 2.4, 3.6, 1.7, 3.9 };
var resultB = Program.TaskB(2.5, x);
var exp = new List<double> { 0.739333760444302, 0.599437811110944, 0.321394270206876, 0.725284786782826, 0.282846892996087 };
for (int i = 0; i < resultB.Count; i++)
{
Assert.Equal(exp[i], resultB[i], 3);
}
}
}
}
}
71 changes: 71 additions & 0 deletions CourseApp.Tests/DogTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
using System;
using Xunit;

namespace CourseApp.Tests
{
public class DogTest
{
[Fact]
public void TestEmptyConstructor()
{
var item = new Dog();
Assert.Equal(0, item.Age);
Assert.Equal("Test", item.Name);
Assert.Equal("male", item.Gender);
}

[Fact]
public void TestSetAge()
{
var item = new Dog();
item.Age = 5;
Assert.Equal(5, item.Age);
}

[Fact]
public void TestIncorrectSetAge()
{
var item = new Dog();
try
{
item.Age = -5;
}
catch (System.Exception)
{
Console.WriteLine("rewrite age.");
Assert.True(true);
}
}

[Fact]
public void TestIncorrectSetGender()
{
var item = new Dog();
try
{
item.Gender = "lemonade";
}
catch (System.Exception)
{
Console.WriteLine("rewrite gender");
Assert.True(true);
}
}

[Fact]
public void TestName()
{
var item = new Dog("Eevee");
Assert.Equal("Eevee", item.Name);
}

[Fact]
public void TestFullConstructor()
{
var item = new Dog("Mew", 5, "male");
Assert.Equal(5, item.Age);
Assert.Equal("Mew", item.Name);
Assert.Equal("male", item.Gender);
}
}
}
55 changes: 55 additions & 0 deletions CourseApp.Tests/PigTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System;
using Xunit;

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

[Theory]
[InlineData("PigMan", 5, 7, "male")]
[InlineData("PigGirl", 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 = -1000;
}
catch (System.Exception)
{
Console.WriteLine("Возраст должен быть больше 1 года");
Assert.True(true);
}
}
}
}
55 changes: 0 additions & 55 deletions CourseApp.Tests/PlatypusTest.cs

This file was deleted.

23 changes: 23 additions & 0 deletions CourseApp/.vs/CourseApp/xs/UserPrefs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Properties StartupConfiguration="{BA016142-5C9F-4B4B-892B-3A806A3994E1}|Default">
<MonoDevelop.Ide.ItemProperties.CourseApp PreferredExecutionTarget="MonoDevelop.Default" />
<MonoDevelop.Ide.Workbench>
<Pads>
<Pad Id="ProjectPad">
<State name="__root__">
<Node name="CourseApp" expanded="True">
<Node name="CourseApp" expanded="True">
<Node name="Dependencies" expanded="True" />
<Node name="Program.cs" selected="True" />
</Node>
</Node>
</State>
</Pad>
</Pads>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
<MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore />
</MonoDevelop.Ide.DebuggingService.Breakpoints>
<MultiItemStartupConfigurations />
</Properties>

Large diffs are not rendered by default.

Empty file.
Binary file added CourseApp/.vs/CourseApp/xs/sqlite3/storage.ide
Binary file not shown.
42 changes: 42 additions & 0 deletions CourseApp/AgeClass.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;

namespace CourseApp
{
public class AgeClass
{
public static DateTime CompareTheDate(DateTime d1, DateTime d2)
{
if (d1.Ticks < d2.Ticks)
{
DateTime result = new DateTime(d2.Ticks - d1.Ticks);
return result;
}

throw new Exception();
}

public static string AgeConsole()
{
Console.WriteLine("Введите год своего рождения:");
int years = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Введите месяц своего рождения:");
int months = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Введите день своего рождения:");
int days = Convert.ToInt32(Console.ReadLine());
DateTime result = CompareTheDate(new DateTime(years, months, days), DateTime.Now);
return $"Вам {result.Year - 1} лет, {result.Month - 1} месяцев и {result.Day - 1} дней";
}

public static string Age(int years, int months, int days)
{
DateTime result = CompareTheDate(new DateTime(years, months, days), DateTime.Now);
return $"Вам {result.Year - 1} лет, {result.Month - 1} месяцев и {result.Day - 1} дней";
}

public static string Age(DateTime date)
{
return $"Вам {CompareTheDate(date, DateTime.Now).Year - 1} лет, {CompareTheDate(date, DateTime.Now).Month - 1} месяцев и {CompareTheDate(date, DateTime.Now).Day - 1} дней";
}
}
}
Loading