Skip to content

Commit

Permalink
Make tests running for .NET 6/7/8
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaliumhexacyanoferrat committed Nov 23, 2023
1 parent 4372261 commit 1b1293d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
25 changes: 11 additions & 14 deletions Testing/Modules/ProtobufTests.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
using GenHTTP.Api.Protocol;
using System;
using System.IO;
using System.Net.Http;
using System.Threading.Tasks;

using GenHTTP.Api.Protocol;
using GenHTTP.Modules.Conversion;
using GenHTTP.Modules.Layouting;
using GenHTTP.Modules.Protobuf;
using GenHTTP.Modules.Reflection;
using GenHTTP.Modules.Webservices;

using Microsoft.VisualStudio.TestTools.UnitTesting;

using ProtoBuf;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using static System.Runtime.InteropServices.JavaScript.JSType;

namespace GenHTTP.Testing.Acceptance.Modules
{
[TestClass]
public sealed class ProtobufTests
{

#region Supporting structures

[ProtoContract]
Expand Down Expand Up @@ -59,15 +59,12 @@ public TestEntity PostEntity(TestEntity entity)

}


#endregion


#region Tests
[TestMethod]

[TestMethod]
public async Task TestGetEntityAsProtobuf()

{
TestEntity? result = null;
await WithResponse(string.Empty, HttpMethod.Get, null, "application/protobuf", "application/protobuf", async r =>
Expand All @@ -82,7 +79,6 @@ await WithResponse(string.Empty, HttpMethod.Get, null, "application/protobuf", "

[TestMethod]
public async Task TestPostEntityAsProtobuf()

{
TestEntity entity = new TestEntity()
{
Expand Down Expand Up @@ -160,4 +156,5 @@ private static TestRunner GetService()
#endregion

}

}
5 changes: 3 additions & 2 deletions Testing/Modules/WebsiteTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Net;

Expand Down Expand Up @@ -65,7 +66,7 @@ public async Task TestErrorHandler()
using var file = await runner.GetResponse("/blubb");

Assert.AreEqual(HttpStatusCode.NotFound, file.StatusCode);
Assert.AreEqual("text/html; charset=UTF-8", file.GetContentHeader("Content-Type"));
Assert.AreEqual("text/html; charset=UTF-8", file.GetContentHeader("Content-Type"), StringComparer.InvariantCultureIgnoreCase);

var content = await file.GetContent();

Expand Down

0 comments on commit 1b1293d

Please sign in to comment.