Skip to content

Conversation

@IHtDzenda
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings June 3, 2025 12:08
Copy link
Collaborator

@JerrySB03 JerrySB03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not an idiot

@IHtDzenda
Copy link
Owner Author

Meow

@JerrySB03 JerrySB03 merged commit 0c64c8a into main Jun 3, 2025
1 check passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes legacy encryption tests, adds client messaging tests, and updates visibility on the Client class.

  • Deleted outdated CryptTests to focus on client functionality
  • Added ClientTests for establishing connections and sending messages
  • Made Client class public and removed encryption/decryption methods from Program.cs

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
tests/CryptTests.cs Removed encryption-related tests
tests/ClientTests.cs Added tests for client messaging functionality
sutor-aes/Program.cs Removed encryption/decryption methods from Program
sutor-aes/Client.cs Made Client class public
Comments suppressed due to low confidence (2)

sutor-aes/Program.cs:15

  • The encryption and decryption methods were removed, which breaks the library’s core crypto functionality. If this removal is unintentional, restore these methods or relocate them to a dedicated crypto service class.
public static string DecryptString(byte[] cipherText, byte[] key, byte[] iv)

tests/ClientTests.cs:8

  • The test class is named ProgramTests but lives in ClientTests.cs and tests the Client behavior. Rename it to ClientTests for consistency.
public class ProgramTests

Comment on lines +10 to +21
private byte[] _key;
private byte[] _iv;

[SetUp]
public void Setup()
{
_key = new byte[32];
Random random = new Random();
random.NextBytes(_key);

_iv = new byte[16];
random.NextBytes(_iv);
Copy link

Copilot AI Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_key and _iv are initialized in Setup but never used in this test. Consider removing them to simplify the test fixture.

Suggested change
private byte[] _key;
private byte[] _iv;
[SetUp]
public void Setup()
{
_key = new byte[32];
Random random = new Random();
random.NextBytes(_key);
_iv = new byte[16];
random.NextBytes(_iv);
// Removed unused variables _key and _iv
[SetUp]
public void Setup()
{
// Removed initialization of unused variables _key and _iv

Copilot uses AI. Check for mistakes.
Comment on lines +34 to +37
bool recieved = false;
alice.OnMessage((string msg) => recieved = msg == originalText);
bob.SendMessage(alice, originalText);
Assert.That(recieved);
Copy link

Copilot AI Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable recieved is misspelled; correct it to received.

Suggested change
bool recieved = false;
alice.OnMessage((string msg) => recieved = msg == originalText);
bob.SendMessage(alice, originalText);
Assert.That(recieved);
bool received = false;
alice.OnMessage((string msg) => received = msg == originalText);
bob.SendMessage(alice, originalText);
Assert.That(received);

Copilot uses AI. Check for mistakes.
bool recieved = false;
alice.OnMessage((string msg) => recieved = msg == originalText);
bob.SendMessage(alice, originalText);
Assert.That(recieved);
Copy link

Copilot AI Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assertion lacks a constraint and will not compile under NUnit. Use Assert.That(received, Is.True) or Assert.IsTrue(received) to explicitly check the boolean.

Suggested change
Assert.That(recieved);
Assert.IsTrue(recieved);

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot is an idiot, this works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants