Skip to content

Commit

Permalink
fix: UnitTest 导致 GitHub Actions 不通过
Browse files Browse the repository at this point in the history
  • Loading branch information
SALTWOOD committed Apr 27, 2024
1 parent 77ad68f commit fb922e9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: .NET

on:
push:
branches: [ "master", "dev"]
branches: ["dev"]
pull_request:
branches: [ "master", "dev"]
branches: ["dev"]
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -38,5 +38,4 @@ jobs:
with:
name: app-debug
path: |
CSharp-OpenBMCLAPI/bin/Debug
CSharp-OpenBMCLAPI/bin/Release
1 change: 0 additions & 1 deletion CSharp-OpenBMCLAPI/Modules/WebServer/Request.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public Request(Client client, byte[] data)
byte[][] requestHeader = WebUtils.SplitBytes(temp[0], WebUtils.Encode("\r\n")).ToArray();
temp = WebUtils.SplitBytes(requestHeader[0], WebUtils.Encode(" "), 3).ToArray();
(Method, Path, Protocol) = (WebUtils.Decode(temp[0]), WebUtils.Decode(temp[1]), WebUtils.Decode(temp[2]));
Array.Copy(requestHeader, 1, requestHeader, 0, requestHeader.Length - 1);
Header = Header.FromBytes(requestHeader[1..]);
BodyLength = int.Parse(Header.Get("content-length", 0) + "");
}
Expand Down
6 changes: 3 additions & 3 deletions FunctionTest/UnitTest1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ namespace FunctionTest
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
public void TestHeaderParser()
{
byte[] data = Encoding.UTF8.GetBytes("GET /1024 HTTP/1.1\r\nHost: localhost\r\n\r\n");
byte[] data = Encoding.UTF8.GetBytes("GET /1024 HTTP/1.1\r\nhost: localhost\r\n\r\n");
var resp = new Request(null!, data);
var str = resp.ToString();
Assert.AreEqual(str, """
GET /1024 HTTP/1.1

Headers:
Host: localhost
host: localhost

Data:

Expand Down

0 comments on commit fb922e9

Please sign in to comment.