Repository: aggink/Study
Pull request #192: [Feature] Добавлено задание 1 ЛР 1
Author: login: yamisakimei
Created: 2025-05-24T17:30:09Z | Merged: 2025-05-24T21:44:06Z



Diff:
diff --git a/Study.Lab1.Logic.Interfaces/yamisakimei/Task1/IRationalNumber.cs b/Study.Lab1.Logic.Interfaces/yamisakimei/Task1/IRationalNumber.cs
new file mode 100644
index 00000000..98c41caf
--- /dev/null
+++ b/Study.Lab1.Logic.Interfaces/yamisakimei/Task1/IRationalNumber.cs
@@ -0,0 +1,6 @@
+﻿namespace Study.Lab1.Logic.Interfaces.yamisakimei.Task1;
+public interface IRationalNumber
+{
+    int Numerator { get; }
+    int Denominator { get; }
+}
\ No newline at end of file
diff --git a/Study.Lab1.Logic.UnitTests/p0se1d0nov/Task1/RationalTest.cs b/Study.Lab1.Logic.UnitTests/p0se1d0nov/Task1/RationalTest.cs
index dee88745..0235b145 100644
--- a/Study.Lab1.Logic.UnitTests/p0se1d0nov/Task1/RationalTest.cs
+++ b/Study.Lab1.Logic.UnitTests/p0se1d0nov/Task1/RationalTest.cs
@@ -16,7 +16,7 @@ public void Constructor_WithValidParameters_SimplifiesFraction()
     }
 
     [Test]
-    public void Constructor_WithNegativeDenominator_MovesSignToNumerator
+    public void Constructor_WithNegativeDenominator_MovesSignToNumerator()
     {
         var rational = new Rational(1, -2);
         Assert.That(rational.Numerator, Is.EqualTo(-1));
diff --git a/Study.Lab1.Logic.UnitTests/yamisakimei/Task1/IRationalNumberTests.cs b/Study.Lab1.Logic.UnitTests/yamisakimei/Task1/IRationalNumberTests.cs
new file mode 100644
index 00000000..0b03054d
--- /dev/null
+++ b/Study.Lab1.Logic.UnitTests/yamisakimei/Task1/IRationalNumberTests.cs
@@ -0,0 +1,121 @@
+﻿using Study.Lab1.Logic.yamisakimei.Task1;
+
+namespace Study.Lab1.Logic.UnitTests.yamisakimei.Task1;
+
+[TestFixture]
+public class RationalNumberTests
+{
+    [Test]
+    public void СorrectlyInput()
+    {
+        var value = new RationalNumber(5, 10);
+        Assert.AreEqual(1, value.Numerator);
+        Assert.AreEqual(2, value.Denominator);
+    }
+
+    [Test]
+    public void СorrectlySumm()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(2, 7);
+        var result = firstValue + secondValue;
+        Assert.AreEqual(new RationalNumber(29, 28), result);
+    }
+
+    [Test]
+    public void СorrectlyMultiply()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(2, 7);
+        var result = firstValue * secondValue;
+        Assert.AreEqual(new RationalNumber(6, 28), result);
+    }
+
+    [Test]
+    public void СorrectlyDivide()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(2, 7);
+        var result = firstValue / secondValue;
+        Assert.AreEqual(new RationalNumber(21, 8), result);
+    }
+
+    [Test]
+    public void СorrectlySubtraction()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(2, 7);
+        var result = firstValue - secondValue;
+        Assert.AreEqual(new RationalNumber(13, 28), result);
+    }
+
+    [Test]
+    public void СorrectlyEquality()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(6, 8);
+        Assert.IsTrue(firstValue == secondValue);
+    }
+
+    [Test]
+    public void СorrectlyInequality()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(2, 7);
+        Assert.IsTrue(firstValue != secondValue);
+    }
+
+    [Test]
+    public void СorrectlyToString()
+    {
+        var value = new RationalNumber(3, 4);
+        Assert.AreEqual("3/4", value.ToString());
+    }
+
+    [Test]
+    public void СorrectlyReturnEquals()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(6, 8);
+        Assert.IsTrue(firstValue.Equals(secondValue));
+    }
+
+    [Test]
+    public void СorrectlyHashCode()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(6, 8);
+        Assert.AreEqual(firstValue.GetHashCode(), secondValue.GetHashCode());
+    }
+
+    [Test]
+    public void СorrectlyOtricanie()
+    {
+        var value = new RationalNumber(3, 4);
+        Assert.AreEqual(new RationalNumber(-3, 4), -value);
+    }
+
+    [Test]
+    public void СorrectlySravnenie()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(2, 7);
+        Assert.That(secondValue < firstValue, Is.True);
+        Assert.That(secondValue <= firstValue, Is.True);
+        Assert.That(secondValue > firstValue, Is.False);
+        Assert.That(secondValue >= firstValue, Is.False);
+    }
+
+    [Test]
+    public void СorrectlyZerooo()
+    {
+        Assert.Throws<DivideByZeroException>(() => new RationalNumber(1, 0));
+    }
+
+    [Test]
+    public void СorrectlySokrashenieToString()
+    {
+        var value = new RationalNumber(33, 11);
+        Assert.AreEqual("3", value.ToString());
+    }
+}
\ No newline at end of file
diff --git a/Study.Lab1.Logic/yamisakimei/Task1/RationalNumber.cs b/Study.Lab1.Logic/yamisakimei/Task1/RationalNumber.cs
new file mode 100644
index 00000000..598fa4c5
--- /dev/null
+++ b/Study.Lab1.Logic/yamisakimei/Task1/RationalNumber.cs
@@ -0,0 +1,128 @@
+﻿using Study.Lab1.Logic.Interfaces.yamisakimei.Task1;
+
+namespace Study.Lab1.Logic.yamisakimei.Task1;
+
+public class RationalNumber : IRationalNumber
+{
+    public int Numerator { get; }
+    public int Denominator { get; }
+
+    public RationalNumber(int numerator, int denominator)
+    {
+        if (denominator == 0)
+            throw new DivideByZeroException("Знаменатель не может быть равен нулю.");
+
+        if (denominator < 0)
+        {
+            numerator = -numerator;
+            denominator = -denominator;
+        }
+
+        int nod = Math.Abs(NOD(numerator, denominator));
+        Numerator = numerator / nod;
+        Denominator = denominator / nod;
+    }
+
+    public override string ToString()
+    {
+        if (Denominator == 1)
+            return $"{Numerator}";
+        return $"{Numerator}/{Denominator}";
+    }
+
+    public override bool Equals(object obj)
+    {
+        if (obj is RationalNumber other)
+        {
+            return this == other;
+        }
+        return false;
+    }
+
+    public override int GetHashCode()
+    {
+        return HashCode.Combine(Numerator, Denominator);
+    }
+
+    #region Операторы
+    public static RationalNumber operator +(RationalNumber a, RationalNumber b)
+    {
+        int numerator = a.Numerator * b.Denominator + b.Numerator * a.Denominator;
+        int denominator = a.Denominator * b.Denominator;
+        return new RationalNumber(numerator, denominator);
+    }
+
+    public static RationalNumber operator -(RationalNumber a, RationalNumber b)
+    {
+        int numerator = a.Numerator * b.Denominator - b.Numerator * a.Denominator;
+        int denominator = a.Denominator * b.Denominator;
+        return new RationalNumber(numerator, denominator);
+    }
+
+    public static RationalNumber operator *(RationalNumber a, RationalNumber b)
+    {
+        int numerator = a.Numerator * b.Numerator;
+        int denominator = a.Denominator * b.Denominator;
+        return new RationalNumber(numerator, denominator);
+    }
+
+    public static RationalNumber operator /(RationalNumber a, RationalNumber b)
+    {
+        int numerator = a.Numerator * b.Denominator;
+        int denominator = a.Denominator * b.Numerator;
+        return new RationalNumber(numerator, denominator);
+    }
+
+    public static RationalNumber operator -(RationalNumber a)
+    {
+        return new RationalNumber(-a.Numerator, a.Denominator);
+    }
+
+    public static bool operator ==(RationalNumber a, RationalNumber b)
+    {
+        if (ReferenceEquals(a, b)) return true;
+        if (a is null || b is null) return false;
+        return a.Numerator == b.Numerator && a.Denominator == b.Denominator;
+    }
+
+    public static bool operator !=(RationalNumber a, RationalNumber b)
+    {
+        return !(a == b);
+    }
+
+    public static bool operator <(RationalNumber a, RationalNumber b)
+    {
+        return (a.Numerator * b.Denominator) < (b.Numerator * a.Denominator);
+    }
+
+    public static bool operator >(RationalNumber a, RationalNumber b)
+    {
+        return (a.Numerator * b.Denominator) > (b.Numerator * a.Denominator);
+    }
+
+    public static bool operator <=(RationalNumber a, RationalNumber b)
+    {
+        return (a.Numerator * b.Denominator) <= (b.Numerator * a.Denominator);
+    }
+
+    public static bool operator >=(RationalNumber a, RationalNumber b)
+    {
+        return (a.Numerator * b.Denominator) >= (b.Numerator * a.Denominator);
+    }
+    #endregion
+
+    #region Методы
+    private static int NOD(int num, int den)
+    {
+        num = Math.Abs(num);
+        den = Math.Abs(den);
+        while (den != 0)
+        {
+            int t = den;
+            den = num % den;
+            num = t;
+        }
+        return num;
+    }
+    #endregion
+}
\ No newline at end of file
diff --git a/Study.Lab1.Logic/yamisakimei/yamisakimeiService.cs b/Study.Lab1.Logic/yamisakimei/yamisakimeiService.cs
new file mode 100644
index 00000000..93d70627
--- /dev/null
+++ b/Study.Lab1.Logic/yamisakimei/yamisakimeiService.cs
@@ -0,0 +1,42 @@
+﻿using Study.Lab1.Logic.yamisakimei.Task1;
+using Study.Lab1.Logic.Interfaces;
+
+namespace Study.Lab1.Logic.yamisakimei;
+
+public class yamisakimeiService : IRunService
+{
+    public void RunTask1()
+    {
+        var a = new RationalNumber(1, 6);
+        var b = new RationalNumber(6, 10);
+        var c = new RationalNumber(-8, 13);
+        var d = new RationalNumber(10, -17);
+        var e = new RationalNumber(-1, -19);
+        var f = new RationalNumber(22, 11);
+
+        Console.Write($"a = {a}, b = {b}, c = {c}, d = {d}, e = {e}, f = {f}\n" +
+            $"a + b = {a + b}\n" +
+            $"a - b = {a - b}\n" +
+            $"a / b = {a / b}\n" +
+            $"a * b = {a * b}\n" +
+            $"a == b ? {a == b}\n" +
+            $" -a = {-a}\n" +
+            $" -d = {-d}\n" +
+            $" -e = {-e}\n" +
+            $"a > b: {a > b}\n" +
+            $"b < a: {b < a}\n" +
+            $"b <= c: {b <= c}\n" +
+            $"d <= b: {d <= b}\n" +
+            $"d >= a: {d >= a}\n"
+            );
+    }
+    public void RunTask2()
+    {
+        throw new NotImplementedException();
+    }
+
+    public void RunTask3()
+    {
+        throw new NotImplementedException();
+    }
+}
diff --git a/Study.Lab1/Program.cs b/Study.Lab1/Program.cs
index 4e037058..ed6a7599 100644
--- a/Study.Lab1/Program.cs
+++ b/Study.Lab1/Program.cs
@@ -22,12 +22,11 @@
 using Study.Lab1.Logic.Selestz;
 using Study.Lab1.Logic.SlavicSquat;
 using Study.Lab1.Logic.xynthh;
-using Study.Lab1.Logic.freaxd;
 using Study.Lab1.Logic.p0se1d0nov;
 using Study.Lab1.Logic.Taipano;
 using Study.Lab1.Logic.TucKaW;
-using Study.Lab1.Logic.xynthh;
 using Study.Lab1.Logic.danaky1;
+using Study.Lab1.Logic.yamisakimei;
 
 
 public static class Program
@@ -131,6 +130,8 @@ private static IRunService GetRunLabService(string group, int number)
                 return new poigkoService();
             case ("idb-23-03", 1):
                 return new danaky1Service();
+            case ("idb-23-03", 8):
+                return new yamisakimeiService();
             default:
                 throw new NotSupportedException();
         }


Reviews:
user: login: aggink
state: COMMENTED
author_association: OWNER
submitted_at: 2025-05-24T17:38:14Z
user: login: aggink
state: COMMENTED
author_association: OWNER
submitted_at: 2025-05-24T19:21:09Z
user: login: aggink
state: APPROVED
author_association: OWNER
submitted_at: 2025-05-24T21:43:57Z

Review comments:
diff_hunk: @@ -0,0 +1,125 @@
+﻿using Study.Lab1.Logic.yamisakimei.Task1;
+
+namespace Study.Lab1.Logic.UnitTests.yamisakimei.Task1;
path: Study.Lab1.Logic.UnitTests/yamisakimei/IRationalNumberTests.cs
user: login: aggink
body: Необходимо соблюдать структуру проекта. Данный класс с тестами необходимо загнать в папку Task1 - проследи, чтоб namespace тестового класса тоже скорректировался правильно
created_at: 2025-05-24T17:34:08Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,125 @@
+﻿using Study.Lab1.Logic.yamisakimei.Task1;
+
+namespace Study.Lab1.Logic.UnitTests.yamisakimei.Task1;
+
+[TestFixture]
+public class RationalNumberTests
+{
+    [Test]
+    public void correctlyInput()
path: Study.Lab1.Logic.UnitTests/yamisakimei/IRationalNumberTests.cs
user: login: aggink
body: Название классов, методов, свойств всегда с заглавной буквы - тут и далее поправить
created_at: 2025-05-24T17:34:41Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,125 @@
+﻿using Study.Lab1.Logic.yamisakimei.Task1;
+
+namespace Study.Lab1.Logic.UnitTests.yamisakimei.Task1;
+
+[TestFixture]
+public class RationalNumberTests
+{
+    [Test]
+    public void correctlyInput()
+    {
+        var value = new RationalNumber(5, 10);
+        Assert.AreEqual(1, value.Numerator);
+        Assert.AreEqual(2, value.Denominator);
+    }
+
+    [Test]
+    public void correctlySumm()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(2, 7);
+        var result = firstValue + secondValue;
+        Assert.AreEqual(new RationalNumber(29, 28), result);
+    }
+
+    [Test]
+    public void correctlyMultiply()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(2, 7);
+        var result = firstValue * secondValue;
+        Assert.AreEqual(new RationalNumber(6, 28), result);
+    }
+
+    [Test]
+    public void correctlyDivide()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(2, 7);
+        var result = firstValue / secondValue;
+        Assert.AreEqual(new RationalNumber(21, 8), result);
+    }
+
+    [Test]
+    public void correctlySubtraction()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(2, 7);
+        var result = firstValue - secondValue;
+        Assert.AreEqual(new RationalNumber(13, 28), result);
+    }
+
+    [Test]
+    public void correctlyEquality()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(6, 8);
+        Assert.IsTrue(firstValue == secondValue);
+    }
+
+    [Test]
+    public void correctlyInequality()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(2, 7);
+        Assert.IsTrue(firstValue != secondValue);
+    }
+
+    [Test]
+    public void correctlyToString()
+    {
+        var value = new RationalNumber(3, 4);
+        Assert.AreEqual("3/4", value.ToString());
+    }
+
+    [Test]
+    public void correctlyReturnEquals()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(6, 8);
+        Assert.IsTrue(firstValue.Equals(secondValue));
+    }
+
+    [Test]
+    public void correctlyHashCode()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(6, 8);
+        Assert.AreEqual(firstValue.GetHashCode(), secondValue.GetHashCode());
+    }
+
+    [Test]
+    public void correctlyOtricanie()
+    {
+        var value = new RationalNumber(3, 4);
+        Assert.AreEqual(new RationalNumber(-3, 4), -value);
+    }
+
+    [Test]
+    public void correctlySravnenie()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(2, 7);
+
+        Assert.That(secondValue < firstValue, Is.True);
+        Assert.That(secondValue <= firstValue, Is.True);
+        Assert.That(secondValue > firstValue, Is.False);
+        Assert.That(secondValue >= firstValue, Is.False);
+
path: Study.Lab1.Logic.UnitTests/yamisakimei/IRationalNumberTests.cs
user: login: aggink
body: Убери пустую строку
created_at: 2025-05-24T17:35:00Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,125 @@
+﻿using Study.Lab1.Logic.yamisakimei.Task1;
+
+namespace Study.Lab1.Logic.UnitTests.yamisakimei.Task1;
+
+[TestFixture]
+public class RationalNumberTests
+{
+    [Test]
+    public void correctlyInput()
+    {
+        var value = new RationalNumber(5, 10);
+        Assert.AreEqual(1, value.Numerator);
+        Assert.AreEqual(2, value.Denominator);
+    }
+
+    [Test]
+    public void correctlySumm()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(2, 7);
+        var result = firstValue + secondValue;
+        Assert.AreEqual(new RationalNumber(29, 28), result);
+    }
+
+    [Test]
+    public void correctlyMultiply()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(2, 7);
+        var result = firstValue * secondValue;
+        Assert.AreEqual(new RationalNumber(6, 28), result);
+    }
+
+    [Test]
+    public void correctlyDivide()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(2, 7);
+        var result = firstValue / secondValue;
+        Assert.AreEqual(new RationalNumber(21, 8), result);
+    }
+
+    [Test]
+    public void correctlySubtraction()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(2, 7);
+        var result = firstValue - secondValue;
+        Assert.AreEqual(new RationalNumber(13, 28), result);
+    }
+
+    [Test]
+    public void correctlyEquality()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(6, 8);
+        Assert.IsTrue(firstValue == secondValue);
+    }
+
+    [Test]
+    public void correctlyInequality()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(2, 7);
+        Assert.IsTrue(firstValue != secondValue);
+    }
+
+    [Test]
+    public void correctlyToString()
+    {
+        var value = new RationalNumber(3, 4);
+        Assert.AreEqual("3/4", value.ToString());
+    }
+
+    [Test]
+    public void correctlyReturnEquals()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(6, 8);
+        Assert.IsTrue(firstValue.Equals(secondValue));
+    }
+
+    [Test]
+    public void correctlyHashCode()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(6, 8);
+        Assert.AreEqual(firstValue.GetHashCode(), secondValue.GetHashCode());
+    }
+
+    [Test]
+    public void correctlyOtricanie()
+    {
+        var value = new RationalNumber(3, 4);
+        Assert.AreEqual(new RationalNumber(-3, 4), -value);
+    }
+
+    [Test]
+    public void correctlySravnenie()
+    {
+        var firstValue = new RationalNumber(3, 4);
+        var secondValue = new RationalNumber(2, 7);
+
+        Assert.That(secondValue < firstValue, Is.True);
+        Assert.That(secondValue <= firstValue, Is.True);
+        Assert.That(secondValue > firstValue, Is.False);
+        Assert.That(secondValue >= firstValue, Is.False);
+
+    }
+
+    [Test]
+    public void correctlyZerooo()
+    {
+        Assert.Throws<DivideByZeroException>(() => new RationalNumber(1, 0));
+    }
+
+    [Test]
+    public void correctlySokrashenieToString()
+    {
+        var value = new RationalNumber(33, 11);
+        Assert.AreEqual("3", value.ToString());
+    }
+
path: Study.Lab1.Logic.UnitTests/yamisakimei/IRationalNumberTests.cs
user: login: aggink
body: Убери пустую строку
created_at: 2025-05-24T17:35:04Z
author_association: OWNER
diff_hunk: @@ -29,4 +29,8 @@
     <ProjectReference Include="..\Study.Lab1.Logic\Study.Lab1.Logic.csproj" />
   </ItemGroup>
 
+  <ItemGroup>
path: Study.Lab1.Logic.UnitTests/Study.Lab1.Logic.UnitTests.csproj
user: login: aggink
body: После создания папки Task1 и перемещения в нее тестового класса проследи, чтоб данная запись исчезла
created_at: 2025-05-24T17:35:53Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,129 @@
+﻿using Study.Lab1.Logic.Interfaces.yamisakimei.Task1;
+namespace Study.Lab1.Logic.yamisakimei.Task1;
path: Study.Lab1.Logic/yamisakimei/RationalNumber.cs
user: login: aggink
body: Отделить пустой строкой

```
﻿using Study.Lab1.Logic.Interfaces.yamisakimei.Task1;

namespace Study.Lab1.Logic.yamisakimei.Task1;
```
created_at: 2025-05-24T17:36:25Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,129 @@
+﻿using Study.Lab1.Logic.Interfaces.yamisakimei.Task1;
+namespace Study.Lab1.Logic.yamisakimei.Task1;
+
+    public class RationalNumber : IRationalNumber
path: Study.Lab1.Logic/yamisakimei/RationalNumber.cs
user: login: aggink
body: Данный класс вложить в папку Task1 - проследи, чтоб namespace тоже скорректировался после перемещения класса
created_at: 2025-05-24T17:36:57Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,129 @@
+﻿using Study.Lab1.Logic.Interfaces.yamisakimei.Task1;
+namespace Study.Lab1.Logic.yamisakimei.Task1;
+
+    public class RationalNumber : IRationalNumber
+    {
+        public int Numerator { get; }
+        public int Denominator { get; }
+
+        public RationalNumber(int numerator, int denominator)
+        {
+            if (denominator == 0)
+                throw new DivideByZeroException("Знаменатель не может быть равен нулю.");
+
+            if (denominator < 0)
+            {
+                numerator = -numerator;
+                denominator = -denominator;
+            }
+
+            int nod = Math.Abs(NOD(numerator, denominator));
+            Numerator = numerator / nod;
+            Denominator = denominator / nod;
+        }
+
+        #region Методы
+        private static int NOD(int num, int den)
path: Study.Lab1.Logic/yamisakimei/RationalNumber.cs
user: login: aggink
body: Все приватные методы в классе идут в самом конце
created_at: 2025-05-24T17:37:17Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,44 @@
+﻿using Study.Lab1.Logic.yamisakimei.Task1;
+using Study.Lab1.Logic.Interfaces;
+
path: Study.Lab1.Logic/yamisakimei/yamisakimeiService.cs
user: login: aggink
body: Оставить одну пустую строку
created_at: 2025-05-24T17:37:38Z
author_association: OWNER
diff_hunk: @@ -36,12 +37,12 @@ public static class Program
     /// <summary>
     /// Название группы
     /// </summary>
-    private const string GROUP_NAME = "assistant";
+    private const string GROUP_NAME = "idb-23-03";
path: Study.Lab1/Program.cs
user: login: aggink
body: После проверки работы необходимо вернуть значение констант в исходное состояние
created_at: 2025-05-24T17:38:09Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,6 @@
+﻿namespace Study.Lab1.Logic.Interfaces.yamisakimei.Task1;
+    public interface IRationalNumber
path: Study.Lab1.Logic.Interfaces/yamisakimei/Task1/IRationalNumber.cs
user: login: aggink
body: между namespace и interface пустую строку добавить 
+ интерфейс куда-то уехал
![image](https://github.com/user-attachments/assets/792243ed-c653-4ee9-974a-a13105edae1a)

created_at: 2025-05-24T19:18:50Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,126 @@
+﻿using Study.Lab1.Logic.Interfaces.yamisakimei.Task1;
+
+namespace Study.Lab1.Logic.yamisakimei.Task1;
+
+public class RationalNumber : IRationalNumber
+{
+    public int Numerator { get; }
+    public int Denominator { get; }
+
+    public RationalNumber(int numerator, int denominator)
+    {
+        if (denominator == 0)
path: Study.Lab1.Logic/yamisakimei/Task1/RationalNumber.cs
user: login: aggink
body: Старайся учиться выделять логические блоки кода пустыми строками, так более нагляднее и понятнее становится

```
        if (denominator == 0)
            throw new DivideByZeroException("Знаменатель не может быть равен нулю.");

        if (denominator < 0)
        {
            numerator = -numerator;
            denominator = -denominator;
        }

        int nod = Math.Abs(NOD(numerator, denominator));
        Numerator = numerator / nod;
        Denominator = denominator / nod;
```

Обычно пустыми строками отделяют циклы, условия 
created_at: 2025-05-24T19:20:58Z
author_association: OWNER

PR comments:
user: login: aggink
created_at: 2025-05-24T17:39:29Z
body: принцип более правильного подхода работы с замечаниями:
1. с начало просматриваешь все комментарии
2. затем начинаешь править код, согласно оставленному комментарию, также просматриваешь свой код на аналогичные проблемы  тоже их правишь (оставлять тысячи одинаковых комментариев слишком затруднительно)
3. когда поправила все замечания, заливаешь правку в github.
4. открываешь в своем PR на github Раздел Files changes и просматриваешь весь код, вдруг что-то упустила или не заметила
author_association: OWNER
user: login: yamisakimei
created_at: 2025-05-24T18:56:22Z
body: Все исправила
author_association: COLLABORATOR
user: login: aggink
created_at: 2025-05-24T19:05:01Z
body: актуализируй с веткой master, чтоб разрешить конфликты
author_association: OWNER
user: login: aggink
created_at: 2025-05-24T19:08:43Z
body: Переключаешься на master, втягиваешь последние изменения

<img width="281" alt="image" src="https://github.com/user-attachments/assets/7734dc3c-3317-41b7-8856-b6b7b608676b" />

Переключаешься обратно на свою ветку, выбираешь управление ветвями

<img width="281" alt="image" src="https://github.com/user-attachments/assets/75056ed8-d052-41af-9e51-50b12e8870cd" />

Правой кнопкой щелкаешь по ветке msater и выбираешь объединить с ...

<img width="515" alt="image" src="https://github.com/user-attachments/assets/aff4d81a-477e-44a0-8b61-04324fbff23d" />

дальше откроется редактор и нужно будет разрешить конфликты 

author_association: OWNER