[GH-ISSUE #325] Network Condition: Unit Test #5 #326

Open
opened 2026-03-03 19:49:54 +03:00 by kerem · 0 comments
Owner

Originally created by @NghiaTranUIT on GitHub (Oct 30, 2023).
Original GitHub issue: https://github.com/ProxymanApp/proxyman-windows-linux/issues/325

Originally assigned to: @kics223w1 on GitHub.

Description

Unit Tests 1

  • Test there is only one rule is enabled at a time.
  1. Setup 5 rules
  2. Enable the second rule

Expect: Get the active rule -> It's the second rule

Unit Tests 2

  • Test System-wide rule with 100% loss
  1. Setup a rule
  2. Start the core
  3. Visit httpbin.proxyman.app

Expect: The request is a timeout after 30 seconds . If the connection is closed -> It's failed.

Unit Tests 3

  • Test a rule with 3G Profile
  1. Setup a rule with host = httpbin.proxyman.app, profile = 3G
  2. Start the core
  3. Make a request to httpbin.proxyman.app -> Verify we can get the request after 5 seconds. If we get a response less than 1 second -> It means the Network Condition doesn't work.
  4. Make a request to www.google.com -> Verify we can get a response after 1 second.

Unit Test 4

  • Write some similar Unit Tests to cover some cases.
Originally created by @NghiaTranUIT on GitHub (Oct 30, 2023). Original GitHub issue: https://github.com/ProxymanApp/proxyman-windows-linux/issues/325 Originally assigned to: @kics223w1 on GitHub. ## Description ### Unit Tests 1 - [x] Test there is only one rule is enabled at a time. 1. Setup 5 rules 2. Enable the second rule Expect: Get the active rule -> It's the second rule ### Unit Tests 2 - [x] Test System-wide rule with 100% loss 1. Setup a rule 2. Start the core 3. Visit `httpbin.proxyman.app` Expect: The request is a timeout after 30 seconds ✅ . If the connection is closed -> It's failed. ### Unit Tests 3 - [x] Test a rule with 3G Profile 1. Setup a rule with host = `httpbin.proxyman.app`, profile = 3G 2. Start the core 3. Make a request to `httpbin.proxyman.app` -> Verify we can get the request after 5 seconds. If we get a response less than 1 second -> It means the Network Condition doesn't work. 4. Make a request to `www.google.com` -> Verify we can get a response after 1 second. ### Unit Test 4 - Write some similar Unit Tests to cover some cases.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxyman-windows-linux#326
No description provided.