Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #151 from North-Two-Five/issue#Nro140-change-confu…
Browse files Browse the repository at this point in the history
…sing-config-variable-name

Issue#140 change confusing config variable name
  • Loading branch information
lubird authored Dec 8, 2020
2 parents fc8ed1b + 663573d commit af38ec1
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Analytics/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ internal Client(string writeKey, Config config, IRequestHandler requestHandler)
if (requestHandler == null)
{
if (config.Send)
requestHandler = new FakeRequestHandler(this);
else
requestHandler = new BlockingRequestHandler(this, config.Timeout);
else
requestHandler = new FakeRequestHandler(this);
}

IBatchFactory batchFactory = new SimpleBatchFactory(this._writeKey);
Expand Down
4 changes: 2 additions & 2 deletions Analytics/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class Config
/// <param name="threads">Count of concurrent internal threads to post data from queue</param>
/// <param name="flushInterval">The frequency, in seconds, to send data to Segment</param>
/// <param name="gzip">Compress data w/ gzip before dispatch</param>
/// <param name="send">Don’t send data to Segment</param>
/// <param name="send">Send data to Segment</param>
/// <param name="userAgent">Sets User Agent Header</param>
public Config(
string host = "https://api.segment.io",
Expand All @@ -60,7 +60,7 @@ public Config(
int threads = 1,
double flushInterval = 10,
bool gzip = false,
bool send = false,
bool send = true,
string userAgent = null
)
{
Expand Down
8 changes: 4 additions & 4 deletions Test.Net35/ClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ public void IdentifyThrowsInvalidOperationExceptionWhenUserIdIsEmpty()
}

[Test]
public void ClientUsesFakeRequestHandlerWhenSendIsTrue()
public void ClientUsesFakeRequestHandlerWhenSendIsFalse()
{
var client = new Client("writeKey", new Config(send: true));
var client = new Client("writeKey", new Config(send: false));

var flushHandler = GetPrivateFieldValue<AsyncIntervalFlushHandler>(client, "_flushHandler");

Expand All @@ -196,9 +196,9 @@ public void ClientUsesFakeRequestHandlerWhenSendIsTrue()
}

[Test]
public void ClientUsesBlockingRequestHandlerWhenSendIsFalse()
public void ClientUsesBlockingRequestHandlerWhenSendIsTrue()
{
var client = new Client("writeKey", new Config(send: false));
var client = new Client("writeKey", new Config(send: true));

var flushHandler = GetPrivateFieldValue<AsyncIntervalFlushHandler>(client, "_flushHandler");

Expand Down
8 changes: 4 additions & 4 deletions Test.Net45/ClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ public void IdentifyThrowsInvalidOperationExceptionWhenUserIdIsEmpty()
}

[Test]
public void ClientUsesFakeRequestHandlerWhenSendIsTrue()
public void ClientUsesFakeRequestHandlerWhenSendIsFalse()
{
var client = new Client("writeKey", new Config(send: true));
var client = new Client("writeKey", new Config(send: false));

var flushHandler = GetPrivateFieldValue<AsyncIntervalFlushHandler>(client, "_flushHandler");

Expand All @@ -196,9 +196,9 @@ public void ClientUsesFakeRequestHandlerWhenSendIsTrue()
}

[Test]
public void ClientUsesBlockingRequestHandlerWhenSendIsFalse()
public void ClientUsesBlockingRequestHandlerWhenSendIsTrue()
{
var client = new Client("writeKey", new Config(send: false));
var client = new Client("writeKey", new Config(send: true));

var flushHandler = GetPrivateFieldValue<AsyncIntervalFlushHandler>(client, "_flushHandler");

Expand Down
8 changes: 4 additions & 4 deletions Test.NetStandard20/ClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ public void IdentifyThrowsInvalidOperationExceptionWhenUserIdIsEmpty()
}

[Test]
public void ClientUsesFakeRequestHandlerWhenSendIsTrue()
public void ClientUsesFakeRequestHandlerWhenSendIsFalse()
{
var client = new Client("writeKey", new Config(send: true));
var client = new Client("writeKey", new Config(send: false));

var flushHandler = GetPrivateFieldValue<AsyncIntervalFlushHandler>(client, "_flushHandler");

Expand All @@ -196,9 +196,9 @@ public void ClientUsesFakeRequestHandlerWhenSendIsTrue()
}

[Test]
public void ClientUsesBlockingRequestHandlerWhenSendIsFalse()
public void ClientUsesBlockingRequestHandlerWhenSendIsTrue()
{
var client = new Client("writeKey", new Config(send: false));
var client = new Client("writeKey", new Config(send: true));

var flushHandler = GetPrivateFieldValue<AsyncIntervalFlushHandler>(client, "_flushHandler");

Expand Down

0 comments on commit af38ec1

Please sign in to comment.