Skip to content

Commit

Permalink
feat(repeater): fix formatting get rid unwanted usings
Browse files Browse the repository at this point in the history
closes #170
  • Loading branch information
ostridm committed Jun 1, 2024
1 parent e4a32d0 commit 3fe3e1d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
2 changes: 0 additions & 2 deletions src/SecTester.Repeater/Bus/SocketIoMessage.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using SecTester.Repeater.Internal;
using SocketIOClient;

namespace SecTester.Repeater.Bus;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using MessagePack;
using MessagePack.Resolvers;
using SecTester.Repeater.Internal;

namespace SecTester.Repeater.Internal;

Expand Down
10 changes: 5 additions & 5 deletions test/SecTester.Repeater.Tests/Bus/IncomingRequestTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void IncomingRequest_FromDictionary_ShouldCreateInstance(IncomingRequest

var serialized = serializer.Serialize(EngineIO.V4, "request", 1, "/some", new object[] { input }).First();

var deserializedPackMessage = MessagePackSerializer.Deserialize<PackMessage>(serialized.Binary ,Options);
var deserializedPackMessage = MessagePackSerializer.Deserialize<PackMessage>(serialized.Binary, Options);

var deserializedDictionary = serializer.Deserialize<Dictionary<object, object>>(deserializedPackMessage, 1);

Expand All @@ -64,7 +64,7 @@ public void IncomingRequest_FromDictionary_ShouldThrowWhenRequiredPropertyWasNot

var serializer = new SocketIOMessagePackSerializer(Options);

var deserializedPackMessage = MessagePackSerializer.Deserialize<PackMessage>(MessagePackSerializer.ConvertFromJson(packJson) ,Options);
var deserializedPackMessage = MessagePackSerializer.Deserialize<PackMessage>(MessagePackSerializer.ConvertFromJson(packJson), Options);

var deserializedDictionary = serializer.Deserialize<Dictionary<object, object>>(deserializedPackMessage, 1);

Expand Down Expand Up @@ -104,15 +104,15 @@ public void IncomingRequest_FromDictionary_ShouldParseProtocolValue()

var serializer = new SocketIOMessagePackSerializer(Options);

var deserializedPackMessage = MessagePackSerializer.Deserialize<PackMessage>(MessagePackSerializer.ConvertFromJson(packJson) ,Options);
var deserializedPackMessage = MessagePackSerializer.Deserialize<PackMessage>(MessagePackSerializer.ConvertFromJson(packJson), Options);

var deserializedDictionary = serializer.Deserialize<Dictionary<object, object>>(deserializedPackMessage, 1);

// act
var result = IncomingRequest.FromDictionary(deserializedDictionary);

// assert
result.Should().BeEquivalentTo(new IncomingRequest(new Uri("https://foo.bar/1")){ Protocol = Protocol.Http});
result.Should().BeEquivalentTo(new IncomingRequest(new Uri("https://foo.bar/1")) { Protocol = Protocol.Http });
}

[Fact]
Expand All @@ -124,7 +124,7 @@ public void IncomingRequest_FromDictionary_ShouldThrowWhenProtocolIsNotParsable(

var serializer = new SocketIOMessagePackSerializer(Options);

var deserializedPackMessage = MessagePackSerializer.Deserialize<PackMessage>(MessagePackSerializer.ConvertFromJson(packJson) ,Options);
var deserializedPackMessage = MessagePackSerializer.Deserialize<PackMessage>(MessagePackSerializer.ConvertFromJson(packJson), Options);

var deserializedDictionary = serializer.Deserialize<Dictionary<object, object>>(deserializedPackMessage, 1);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
using MessagePack;
using MessagePack.Formatters;
using MessagePack.Resolvers;
using SecTester.Repeater.Internal;

namespace SecTester.Repeater.Tests.Internal;

public sealed class MessagePackHttpMethodFormatterTests
{
private static readonly MessagePackSerializerOptions Options = new(
CompositeResolver.Create(
CompositeResolver.Create(new MessagePackHttpMethodFormatter()),
BuiltinResolver.Instance
)
);
private static readonly MessagePackSerializerOptions Options = new(
CompositeResolver.Create(
CompositeResolver.Create(new MessagePackHttpMethodFormatter()),
BuiltinResolver.Instance
)
);

public static readonly IEnumerable<object[]> Fixture = new List<object[]>
{
Expand Down

0 comments on commit 3fe3e1d

Please sign in to comment.