Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor with CodeMaid #136

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
Binary file added .vs/SuperSocket/v15/Server/sqlite3/storage.ide
Binary file not shown.
106 changes: 52 additions & 54 deletions SuperSocket.sln
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26124.0
VisualStudioVersion = 15.0.27130.2024
MinimumVisualStudioVersion = 15.0.26124.0
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SuperSocket.Primitives", "src\SuperSocket.Primitives\SuperSocket.Primitives.csproj", "{721253A6-64F0-45EC-BD59-ED65F388B072}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SuperSocket.Primitives", "src\SuperSocket.Primitives\SuperSocket.Primitives.csproj", "{721253A6-64F0-45EC-BD59-ED65F388B072}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SuperSocket.ProtoBase", "src\SuperSocket.ProtoBase\SuperSocket.ProtoBase.csproj", "{2BB17EF2-F9C7-4E2E-90D9-4C7A2F56AEC4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SuperSocket.ProtoBase", "src\SuperSocket.ProtoBase\SuperSocket.ProtoBase.csproj", "{2BB17EF2-F9C7-4E2E-90D9-4C7A2F56AEC4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SuperSocket.NetSocket", "src\SuperSocket.NetSocket\SuperSocket.NetSocket.csproj", "{EA4FE9C4-CC51-4D80-A8F5-71F0BF6D3242}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SuperSocket.NetSocket", "src\SuperSocket.NetSocket\SuperSocket.NetSocket.csproj", "{EA4FE9C4-CC51-4D80-A8F5-71F0BF6D3242}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SuperSocket.Libuv", "src\SuperSocket.Libuv\SuperSocket.Libuv.csproj", "{AE1CED21-75D5-4BFF-9572-65E8760C9BB3}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SuperSocket.Libuv", "src\SuperSocket.Libuv\SuperSocket.Libuv.csproj", "{AE1CED21-75D5-4BFF-9572-65E8760C9BB3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{A66E7769-9786-4021-B9D8-9EF7775D9D1B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "test\Test\Test.csproj", "{966058DB-5774-4196-9C08-3887C55B07EF}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test", "test\Test\Test.csproj", "{966058DB-5774-4196-9C08-3887C55B07EF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -24,76 +23,75 @@ Global
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{721253A6-64F0-45EC-BD59-ED65F388B072}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{721253A6-64F0-45EC-BD59-ED65F388B072}.Debug|Any CPU.Build.0 = Debug|Any CPU
{721253A6-64F0-45EC-BD59-ED65F388B072}.Debug|x64.ActiveCfg = Debug|x64
{721253A6-64F0-45EC-BD59-ED65F388B072}.Debug|x64.Build.0 = Debug|x64
{721253A6-64F0-45EC-BD59-ED65F388B072}.Debug|x86.ActiveCfg = Debug|x86
{721253A6-64F0-45EC-BD59-ED65F388B072}.Debug|x86.Build.0 = Debug|x86
{721253A6-64F0-45EC-BD59-ED65F388B072}.Debug|x64.ActiveCfg = Debug|Any CPU
{721253A6-64F0-45EC-BD59-ED65F388B072}.Debug|x64.Build.0 = Debug|Any CPU
{721253A6-64F0-45EC-BD59-ED65F388B072}.Debug|x86.ActiveCfg = Debug|Any CPU
{721253A6-64F0-45EC-BD59-ED65F388B072}.Debug|x86.Build.0 = Debug|Any CPU
{721253A6-64F0-45EC-BD59-ED65F388B072}.Release|Any CPU.ActiveCfg = Release|Any CPU
{721253A6-64F0-45EC-BD59-ED65F388B072}.Release|Any CPU.Build.0 = Release|Any CPU
{721253A6-64F0-45EC-BD59-ED65F388B072}.Release|x64.ActiveCfg = Release|x64
{721253A6-64F0-45EC-BD59-ED65F388B072}.Release|x64.Build.0 = Release|x64
{721253A6-64F0-45EC-BD59-ED65F388B072}.Release|x86.ActiveCfg = Release|x86
{721253A6-64F0-45EC-BD59-ED65F388B072}.Release|x86.Build.0 = Release|x86
{721253A6-64F0-45EC-BD59-ED65F388B072}.Release|x64.ActiveCfg = Release|Any CPU
{721253A6-64F0-45EC-BD59-ED65F388B072}.Release|x64.Build.0 = Release|Any CPU
{721253A6-64F0-45EC-BD59-ED65F388B072}.Release|x86.ActiveCfg = Release|Any CPU
{721253A6-64F0-45EC-BD59-ED65F388B072}.Release|x86.Build.0 = Release|Any CPU
{2BB17EF2-F9C7-4E2E-90D9-4C7A2F56AEC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2BB17EF2-F9C7-4E2E-90D9-4C7A2F56AEC4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2BB17EF2-F9C7-4E2E-90D9-4C7A2F56AEC4}.Debug|x64.ActiveCfg = Debug|x64
{2BB17EF2-F9C7-4E2E-90D9-4C7A2F56AEC4}.Debug|x64.Build.0 = Debug|x64
{2BB17EF2-F9C7-4E2E-90D9-4C7A2F56AEC4}.Debug|x86.ActiveCfg = Debug|x86
{2BB17EF2-F9C7-4E2E-90D9-4C7A2F56AEC4}.Debug|x86.Build.0 = Debug|x86
{2BB17EF2-F9C7-4E2E-90D9-4C7A2F56AEC4}.Debug|x64.ActiveCfg = Debug|Any CPU
{2BB17EF2-F9C7-4E2E-90D9-4C7A2F56AEC4}.Debug|x64.Build.0 = Debug|Any CPU
{2BB17EF2-F9C7-4E2E-90D9-4C7A2F56AEC4}.Debug|x86.ActiveCfg = Debug|Any CPU
{2BB17EF2-F9C7-4E2E-90D9-4C7A2F56AEC4}.Debug|x86.Build.0 = Debug|Any CPU
{2BB17EF2-F9C7-4E2E-90D9-4C7A2F56AEC4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2BB17EF2-F9C7-4E2E-90D9-4C7A2F56AEC4}.Release|Any CPU.Build.0 = Release|Any CPU
{2BB17EF2-F9C7-4E2E-90D9-4C7A2F56AEC4}.Release|x64.ActiveCfg = Release|x64
{2BB17EF2-F9C7-4E2E-90D9-4C7A2F56AEC4}.Release|x64.Build.0 = Release|x64
{2BB17EF2-F9C7-4E2E-90D9-4C7A2F56AEC4}.Release|x86.ActiveCfg = Release|x86
{2BB17EF2-F9C7-4E2E-90D9-4C7A2F56AEC4}.Release|x86.Build.0 = Release|x86
{2BB17EF2-F9C7-4E2E-90D9-4C7A2F56AEC4}.Release|x64.ActiveCfg = Release|Any CPU
{2BB17EF2-F9C7-4E2E-90D9-4C7A2F56AEC4}.Release|x64.Build.0 = Release|Any CPU
{2BB17EF2-F9C7-4E2E-90D9-4C7A2F56AEC4}.Release|x86.ActiveCfg = Release|Any CPU
{2BB17EF2-F9C7-4E2E-90D9-4C7A2F56AEC4}.Release|x86.Build.0 = Release|Any CPU
{EA4FE9C4-CC51-4D80-A8F5-71F0BF6D3242}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EA4FE9C4-CC51-4D80-A8F5-71F0BF6D3242}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EA4FE9C4-CC51-4D80-A8F5-71F0BF6D3242}.Debug|x64.ActiveCfg = Debug|x64
{EA4FE9C4-CC51-4D80-A8F5-71F0BF6D3242}.Debug|x64.Build.0 = Debug|x64
{EA4FE9C4-CC51-4D80-A8F5-71F0BF6D3242}.Debug|x86.ActiveCfg = Debug|x86
{EA4FE9C4-CC51-4D80-A8F5-71F0BF6D3242}.Debug|x86.Build.0 = Debug|x86
{EA4FE9C4-CC51-4D80-A8F5-71F0BF6D3242}.Debug|x64.ActiveCfg = Debug|Any CPU
{EA4FE9C4-CC51-4D80-A8F5-71F0BF6D3242}.Debug|x64.Build.0 = Debug|Any CPU
{EA4FE9C4-CC51-4D80-A8F5-71F0BF6D3242}.Debug|x86.ActiveCfg = Debug|Any CPU
{EA4FE9C4-CC51-4D80-A8F5-71F0BF6D3242}.Debug|x86.Build.0 = Debug|Any CPU
{EA4FE9C4-CC51-4D80-A8F5-71F0BF6D3242}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EA4FE9C4-CC51-4D80-A8F5-71F0BF6D3242}.Release|Any CPU.Build.0 = Release|Any CPU
{EA4FE9C4-CC51-4D80-A8F5-71F0BF6D3242}.Release|x64.ActiveCfg = Release|x64
{EA4FE9C4-CC51-4D80-A8F5-71F0BF6D3242}.Release|x64.Build.0 = Release|x64
{EA4FE9C4-CC51-4D80-A8F5-71F0BF6D3242}.Release|x86.ActiveCfg = Release|x86
{EA4FE9C4-CC51-4D80-A8F5-71F0BF6D3242}.Release|x86.Build.0 = Release|x86
{EA4FE9C4-CC51-4D80-A8F5-71F0BF6D3242}.Release|x64.ActiveCfg = Release|Any CPU
{EA4FE9C4-CC51-4D80-A8F5-71F0BF6D3242}.Release|x64.Build.0 = Release|Any CPU
{EA4FE9C4-CC51-4D80-A8F5-71F0BF6D3242}.Release|x86.ActiveCfg = Release|Any CPU
{EA4FE9C4-CC51-4D80-A8F5-71F0BF6D3242}.Release|x86.Build.0 = Release|Any CPU
{AE1CED21-75D5-4BFF-9572-65E8760C9BB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AE1CED21-75D5-4BFF-9572-65E8760C9BB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AE1CED21-75D5-4BFF-9572-65E8760C9BB3}.Debug|x64.ActiveCfg = Debug|x64
{AE1CED21-75D5-4BFF-9572-65E8760C9BB3}.Debug|x64.Build.0 = Debug|x64
{AE1CED21-75D5-4BFF-9572-65E8760C9BB3}.Debug|x86.ActiveCfg = Debug|x86
{AE1CED21-75D5-4BFF-9572-65E8760C9BB3}.Debug|x86.Build.0 = Debug|x86
{AE1CED21-75D5-4BFF-9572-65E8760C9BB3}.Debug|x64.ActiveCfg = Debug|Any CPU
{AE1CED21-75D5-4BFF-9572-65E8760C9BB3}.Debug|x64.Build.0 = Debug|Any CPU
{AE1CED21-75D5-4BFF-9572-65E8760C9BB3}.Debug|x86.ActiveCfg = Debug|Any CPU
{AE1CED21-75D5-4BFF-9572-65E8760C9BB3}.Debug|x86.Build.0 = Debug|Any CPU
{AE1CED21-75D5-4BFF-9572-65E8760C9BB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AE1CED21-75D5-4BFF-9572-65E8760C9BB3}.Release|Any CPU.Build.0 = Release|Any CPU
{AE1CED21-75D5-4BFF-9572-65E8760C9BB3}.Release|x64.ActiveCfg = Release|x64
{AE1CED21-75D5-4BFF-9572-65E8760C9BB3}.Release|x64.Build.0 = Release|x64
{AE1CED21-75D5-4BFF-9572-65E8760C9BB3}.Release|x86.ActiveCfg = Release|x86
{AE1CED21-75D5-4BFF-9572-65E8760C9BB3}.Release|x86.Build.0 = Release|x86
{AE1CED21-75D5-4BFF-9572-65E8760C9BB3}.Release|x64.ActiveCfg = Release|Any CPU
{AE1CED21-75D5-4BFF-9572-65E8760C9BB3}.Release|x64.Build.0 = Release|Any CPU
{AE1CED21-75D5-4BFF-9572-65E8760C9BB3}.Release|x86.ActiveCfg = Release|Any CPU
{AE1CED21-75D5-4BFF-9572-65E8760C9BB3}.Release|x86.Build.0 = Release|Any CPU
{966058DB-5774-4196-9C08-3887C55B07EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{966058DB-5774-4196-9C08-3887C55B07EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{966058DB-5774-4196-9C08-3887C55B07EF}.Debug|x64.ActiveCfg = Debug|x64
{966058DB-5774-4196-9C08-3887C55B07EF}.Debug|x64.Build.0 = Debug|x64
{966058DB-5774-4196-9C08-3887C55B07EF}.Debug|x86.ActiveCfg = Debug|x86
{966058DB-5774-4196-9C08-3887C55B07EF}.Debug|x86.Build.0 = Debug|x86
{966058DB-5774-4196-9C08-3887C55B07EF}.Debug|x64.ActiveCfg = Debug|Any CPU
{966058DB-5774-4196-9C08-3887C55B07EF}.Debug|x64.Build.0 = Debug|Any CPU
{966058DB-5774-4196-9C08-3887C55B07EF}.Debug|x86.ActiveCfg = Debug|Any CPU
{966058DB-5774-4196-9C08-3887C55B07EF}.Debug|x86.Build.0 = Debug|Any CPU
{966058DB-5774-4196-9C08-3887C55B07EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{966058DB-5774-4196-9C08-3887C55B07EF}.Release|Any CPU.Build.0 = Release|Any CPU
{966058DB-5774-4196-9C08-3887C55B07EF}.Release|x64.ActiveCfg = Release|x64
{966058DB-5774-4196-9C08-3887C55B07EF}.Release|x64.Build.0 = Release|x64
{966058DB-5774-4196-9C08-3887C55B07EF}.Release|x86.ActiveCfg = Release|x86
{966058DB-5774-4196-9C08-3887C55B07EF}.Release|x86.Build.0 = Release|x86
{966058DB-5774-4196-9C08-3887C55B07EF}.Release|x64.ActiveCfg = Release|Any CPU
{966058DB-5774-4196-9C08-3887C55B07EF}.Release|x64.Build.0 = Release|Any CPU
{966058DB-5774-4196-9C08-3887C55B07EF}.Release|x86.ActiveCfg = Release|Any CPU
{966058DB-5774-4196-9C08-3887C55B07EF}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{721253A6-64F0-45EC-BD59-ED65F388B072} = {8CBB36FE-BF1B-4DA1-8352-FE57D0F5A9A3}
{2BB17EF2-F9C7-4E2E-90D9-4C7A2F56AEC4} = {8CBB36FE-BF1B-4DA1-8352-FE57D0F5A9A3}
{EA4FE9C4-CC51-4D80-A8F5-71F0BF6D3242} = {8CBB36FE-BF1B-4DA1-8352-FE57D0F5A9A3}
{AE1CED21-75D5-4BFF-9572-65E8760C9BB3} = {8CBB36FE-BF1B-4DA1-8352-FE57D0F5A9A3}
{966058DB-5774-4196-9C08-3887C55B07EF} = {A66E7769-9786-4021-B9D8-9EF7775D9D1B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F8C30DB2-4CD2-4C54-83F0-B12D4EBCF918}
EndGlobalSection
EndGlobal
5 changes: 0 additions & 5 deletions src/SuperSocket.Libuv/Extensions.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
using System;
using System.IO.Pipelines;
using System.Net;
using System.Threading.Tasks;
using System.IO.Pipelines.Networking.Libuv;
using Microsoft.Extensions.DependencyInjection;
using SuperSocket.Libuv;

Expand Down
3 changes: 1 addition & 2 deletions src/SuperSocket.Libuv/LibuvPipeConnectionListener.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.IO.Pipelines;
using System.IO.Pipelines.Networking.Libuv;
using System.Net;
using System.Threading.Tasks;
using System.IO.Pipelines.Networking.Libuv;

namespace SuperSocket.Libuv
{
Expand All @@ -13,7 +13,6 @@ public class LibuvPipeConnectionListener : IPipeConnectionListener

public LibuvPipeConnectionListener()
{

}

public void Start(IPEndPoint endpoint, Func<IPipeConnection, Task> callback)
Expand Down
4 changes: 0 additions & 4 deletions src/SuperSocket.NetSocket/Extensions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using System;
using System.IO.Pipelines;
using System.Net;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using SuperSocket.NetSocket;

Expand Down
3 changes: 2 additions & 1 deletion src/SuperSocket.NetSocket/NetSocketPipeConnectionListener.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
using System;
using System.IO.Pipelines;
using System.IO.Pipelines.Networking.Sockets;
using System.Net;
using System.Threading.Tasks;
using System.IO.Pipelines.Networking.Sockets;

namespace SuperSocket.NetSocket
{
public class NetSocketPipeConnectionListener : IPipeConnectionListener
{
private SocketListener _socketListener;

public void Start(IPEndPoint endpoint, Func<IPipeConnection, Task> callback)
{
_socketListener = new SocketListener();
Expand Down
2 changes: 1 addition & 1 deletion src/SuperSocket.Primitives/Config/ListenerConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public class ListenerConfig
{
public string Ip { get; set; }

public int Port { get; set; }
public int Port { get; set; }

public int BackLog { get; set; }
}
Expand Down
11 changes: 5 additions & 6 deletions src/SuperSocket.Primitives/Listener.cs
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
using System.Net;
using SuperSocket.Config;
using System.Net;

namespace SuperSocket
{
public class Listener
{
public Listener()
{

}

public Listener(ListenerConfig config)
{
var ipAddress = IPAddress.None;

switch(config.Ip.ToLower())
switch (config.Ip.ToLower())
{
case("any"):
case ("any"):
ipAddress = IPAddress.Any;
break;

case("ipv6any"):
case ("ipv6any"):
ipAddress = IPAddress.IPv6Any;
break;

default:
ipAddress = IPAddress.Parse(config.Ip);
break;
}

EndPoint = new IPEndPoint(ipAddress, config.Port);
BackLog = config.BackLog <= 0 ? DefaultBackLog : config.BackLog;
}
Expand Down
5 changes: 0 additions & 5 deletions src/SuperSocket.ProtoBase/FilterResult.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
using System;
using System.IO.Pipelines;
using System.Net.Sockets;
using System.Threading.Tasks;

namespace SuperSocket.ProtoBase
{
public abstract class FilterResult
Expand Down
4 changes: 0 additions & 4 deletions src/SuperSocket.ProtoBase/IPipelineFilter.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Buffers;
using System.IO.Pipelines;
using System.Net.Sockets;
using System.Threading.Tasks;

namespace SuperSocket.ProtoBase
{
Expand Down
4 changes: 0 additions & 4 deletions src/SuperSocket.ProtoBase/PipelineFilterBase.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Buffers;
using System.IO.Pipelines;
using System.Net.Sockets;
using System.Threading.Tasks;

namespace SuperSocket.ProtoBase
{
Expand Down
7 changes: 2 additions & 5 deletions src/SuperSocket.ProtoBase/ProcessState.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
using System;
using System.IO.Pipelines;
using System.Net.Sockets;
using System.Threading.Tasks;

namespace SuperSocket.ProtoBase
{
/// <summary>
Expand All @@ -14,10 +9,12 @@ public enum ProcessState : byte
/// The being processed data was processed completely
/// </summary>
Completed,

/// <summary>
/// The being processed data was cached
/// </summary>
Cached,

/// <summary>
/// The processor is in error state
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions src/SuperSocket.ProtoBase/TerminatorPipelineFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
using System.Buffers;
using System.Collections.Sequences;
using System.IO.Pipelines;
using System.Net.Sockets;
using System.Threading.Tasks;

namespace SuperSocket.ProtoBase
{
public abstract class TerminatorPipelineFilter<TPackageInfo> : PipelineFilterBase<TPackageInfo>
where TPackageInfo : class
{
private byte[] _terminator;

public TerminatorPipelineFilter(byte[] terminator)
{
_terminator = terminator;
}

public override TPackageInfo Filter(ref ReadOnlyBuffer<byte> buffer)
{
ReadOnlyBuffer<byte> slice;
Expand Down
28 changes: 7 additions & 21 deletions test/Test/ConfigTest.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
using System;
using System.Collections.Generic;
using System.IO.Pipelines;
using System.Net;
using System.Net.Sockets;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using SuperSocket;
using SuperSocket.ProtoBase;
using SuperSocket.Server;
using Xunit;

namespace Tests
namespace Tests
{
public class ConfigTest
{

[Fact]
public void TestConfigureArgumentExceptions()
public void TestConfigureArgumentExceptions()
{
var server = new SocketServer();

Expand All @@ -26,7 +12,7 @@ public void TestConfigureArgumentExceptions()
}

[Fact]
public void TestConfigure()
public void TestConfigure()
{
var server = new SocketServer();

Expand All @@ -42,7 +28,7 @@ public void TestConfigure()

var builder = new ConfigurationBuilder().AddInMemoryCollection(dic);
var config = builder.Build();

Assert.True(server.Configure<FakePackageInfo, FakePipelineFilter>(config));
Assert.Equal("TestServer", server.Name);

Expand All @@ -56,7 +42,7 @@ public void TestConfigure()
}

[Fact]
public async Task TestSessionCount()
public async Task TestSessionCount()
{
var server = new SocketServer();

Expand All @@ -69,7 +55,7 @@ public async Task TestSessionCount()

var builder = new ConfigurationBuilder().AddInMemoryCollection(dic);
var config = builder.Build();

Assert.True(server.Configure<FakePackageInfo, FakePipelineFilter>(config));
Assert.Equal("TestServer", server.Name);

Expand All @@ -86,4 +72,4 @@ public async Task TestSessionCount()
server.Stop();
}
}
}
}
Loading