Skip to content

Commit b478be5

Browse files
committed
Re-formatted code using format-code.sh bash script
1 parent 753100b commit b478be5

File tree

16 files changed

+113
-111
lines changed

16 files changed

+113
-111
lines changed

examples/AndroidSample/AblyService.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ public void Init()
1818
_ably = new AblyRealtime(new ClientOptions("lNj80Q.iGyVcQ:2QKX7FFASfX-7H9H")
1919
{
2020
LogHandler = this,
21-
LogLevel = LogLevel.Debug,
21+
LogLevel = LogLevel.Debug,
2222
AutoConnect = false,
2323
UseBinaryProtocol = false
2424
});
2525
_ably.Connection.On(change =>
2626
{
27-
if(change.Current == ConnectionState.Connected)
28-
foreach(var channel in _ably.Channels)
27+
if (change.Current == ConnectionState.Connected)
28+
foreach (var channel in _ably.Channels)
2929
channel.Attach();
3030

3131
_connectionSubject.OnNext(change.Current.ToString());
@@ -48,7 +48,7 @@ public IObservable<Message> SubsrcibeToChannel(string channelName)
4848
_ably.Channels.Get(channelName).Subscribe(subject.OnNext);
4949
return subject;
5050
}
51-
51+
5252
public void LogEvent(LogLevel level, string message)
5353
{
5454
Android.Util.Log.Debug("ably", $"[{level}] {message}");
@@ -66,6 +66,6 @@ public IDisposable Subscribe(IObserver<string> observer)
6666
}
6767
}
6868

69-
69+
7070

7171
}

examples/AndroidSample/App.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public App(AblyService ably)
3434

3535
protected override void OnStart()
3636
{
37-
37+
3838
// Handle when your app starts
3939
}
4040

src/IO.Ably.Shared/Realtime/ChannelMessageProcessor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ private bool ValidateIfDeltaItHasCorrectPreviousMessageId(ProtocolMessage protoc
177177
var deltaFrom = firstMessage.Extras?.Delta?.From;
178178
if (deltaFrom != null && deltaFrom.EqualsTo(channelSuccessfulMessageIds.LastMessageId) == false)
179179
{
180-
Logger.Warning($"Delta message decode failure. Previous message id does not equal expected message id. PreviousMessageId: {channelSuccessfulMessageIds.LastMessageId}. ExpectedMessageId: {deltaFrom}");
181-
return false;
180+
Logger.Warning($"Delta message decode failure. Previous message id does not equal expected message id. PreviousMessageId: {channelSuccessfulMessageIds.LastMessageId}. ExpectedMessageId: {deltaFrom}");
181+
return false;
182182
}
183183

184184
return true;

src/IO.Ably.Shared/Realtime/Connection.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -305,15 +305,15 @@ internal void NotifyUpdate(ConnectionStateChange stateChange)
305305
RealtimeClient.NotifyExternalClients(
306306
() =>
307307
{
308-
Emit(stateChange.Event, stateChange);
309-
try
310-
{
311-
externalHandlers?.Invoke(this, stateChange);
312-
}
313-
catch (Exception ex)
314-
{
315-
Logger.Error("Error notifying Connection state changed handlers", ex);
316-
}
308+
Emit(stateChange.Event, stateChange);
309+
try
310+
{
311+
externalHandlers?.Invoke(this, stateChange);
312+
}
313+
catch (Exception ex)
314+
{
315+
Logger.Error("Error notifying Connection state changed handlers", ex);
316+
}
317317
});
318318
}
319319

src/IO.Ably.Shared/Result.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,12 @@ public static Result Ok()
160160
return new Result(true, null);
161161
}
162162

163-
/// <summary>
164-
/// Factory method to create a successful Result of T with value.
165-
/// </summary>
166-
/// <typeparam name="T">Type of value.</typeparam>
167-
/// <param name="value">successful value held in the result.</param>
168-
/// <returns>Result.</returns>
163+
/// <summary>
164+
/// Factory method to create a successful Result of T with value.
165+
/// </summary>
166+
/// <typeparam name="T">Type of value.</typeparam>
167+
/// <param name="value">successful value held in the result.</param>
168+
/// <returns>Result.</returns>
169169
public static Result<T> Ok<T>(T value)
170170
{
171171
return new Result<T>(value, true, null);

src/IO.Ably.Shared/Transport/States/Connection/ConnectionDisconnectedState.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public ConnectionDisconnectedState(IConnectionContext context, ErrorInfo error,
3232

3333
public override RealtimeCommand Connect()
3434
{
35-
return SetConnectingStateCommand.Create().TriggeredBy("DisconnectedState.Connect()");
35+
return SetConnectingStateCommand.Create().TriggeredBy("DisconnectedState.Connect()");
3636
}
3737

3838
public override void Close()

src/IO.Ably.Tests.Shared/AuthTests/AuthSandboxSpecs.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -794,12 +794,12 @@ public async Task TokenAuthUrlWithJsonTokenReturned_ShouldBeAbleToConnect(Protoc
794794
var authUrl = "http://echo.ably.io/?type=json&body=" + Uri.EscapeDataString(tokenJson);
795795

796796
var client = new AblyRealtime(new ClientOptions
797-
{
798-
AuthUrl = new Uri(authUrl),
799-
Environment = settings.Environment,
800-
UseBinaryProtocol = protocol == Defaults.Protocol,
801-
HttpRequestTimeout = new TimeSpan(0, 0, 20)
802-
});
797+
{
798+
AuthUrl = new Uri(authUrl),
799+
Environment = settings.Environment,
800+
UseBinaryProtocol = protocol == Defaults.Protocol,
801+
HttpRequestTimeout = new TimeSpan(0, 0, 20)
802+
});
803803

804804
await client.WaitForState();
805805
client.Connection.State.Should().Be(ConnectionState.Connected);
@@ -816,12 +816,12 @@ public async Task TokenAuthUrlWithIncorrectJsonTokenReturned_ShouldNotBeAbleToCo
816816
var authUrl = "http://echo.ably.io/?type=json&body=" + Uri.EscapeDataString(incorrectJson);
817817

818818
var client = new AblyRealtime(new ClientOptions
819-
{
820-
AuthUrl = new Uri(authUrl),
821-
Environment = settings.Environment,
822-
UseBinaryProtocol = protocol == Defaults.Protocol,
823-
HttpRequestTimeout = new TimeSpan(0, 0, 20)
824-
});
819+
{
820+
AuthUrl = new Uri(authUrl),
821+
Environment = settings.Environment,
822+
UseBinaryProtocol = protocol == Defaults.Protocol,
823+
HttpRequestTimeout = new TimeSpan(0, 0, 20)
824+
});
825825

826826
var tsc = new TaskCompletionAwaiter();
827827
ErrorInfo err = null;

src/IO.Ably.Tests.Shared/AuthTests/AuthorizationTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ public class AuthorizationTests : MockHttpRestSpecs
1717
{
1818
internal readonly AblyResponse DummyTokenResponse = new AblyResponse
1919
{
20-
Type = ResponseType.Json, TextResponse = "{ \"access_token\": {}}"
20+
Type = ResponseType.Json,
21+
TextResponse = "{ \"access_token\": {}}"
2122
};
2223

2324
internal override AblyResponse DefaultResponse => DummyTokenResponse;

src/IO.Ably.Tests.Shared/AuthTests/RequestTokenSpecs.cs

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,21 @@ public async Task WithDefaultTokenParamsAndTokenParamsSpecified_ShouldUseOnlyPar
5050
var client = GetRestClient(
5151
null,
5252
options => options.DefaultTokenParams = new TokenParams
53-
{
54-
ClientId = "123", Ttl = TimeSpan.FromHours(2)
55-
});
53+
{
54+
ClientId = "123",
55+
Ttl = TimeSpan.FromHours(2)
56+
});
5657

5758
var capability = new Capability();
5859
capability.AddResource("a").AllowAll();
5960
var methodParams = new TokenParams
60-
{
61-
Capability = capability,
62-
ClientId = "999",
63-
Ttl = TimeSpan.FromMinutes(1),
64-
Nonce = "123",
65-
Timestamp = Now.AddHours(1)
66-
};
61+
{
62+
Capability = capability,
63+
ClientId = "999",
64+
Ttl = TimeSpan.FromMinutes(1),
65+
Nonce = "123",
66+
Timestamp = Now.AddHours(1)
67+
};
6768

6869
await client.Auth.RequestTokenAsync(methodParams);
6970

@@ -162,11 +163,11 @@ public async Task RequestToken_WithQueryTime_SendsTimeRequestAndUsesReturnedTime
162163
return DummyTokenResponse.ToTask();
163164
};
164165
var tokenParams = new TokenParams
165-
{
166-
Capability = new Capability(),
167-
ClientId = "ClientId",
168-
Ttl = TimeSpan.FromMinutes(10)
169-
};
166+
{
167+
Capability = new Capability(),
168+
ClientId = "ClientId",
169+
Ttl = TimeSpan.FromMinutes(10)
170+
};
170171

171172
// Act
172173
await rest.Auth.RequestTokenAsync(
@@ -185,11 +186,11 @@ public async Task RequestToken_WithoutQueryTime_SendsTimeRequestAndUsesReturnedT
185186
};
186187

187188
var tokenParams = new TokenParams
188-
{
189-
Capability = new Capability(),
190-
ClientId = "ClientId",
191-
Ttl = TimeSpan.FromMinutes(10)
192-
};
189+
{
190+
Capability = new Capability(),
191+
ClientId = "ClientId",
192+
Ttl = TimeSpan.FromMinutes(10)
193+
};
193194

194195
// Act
195196
await rest.Auth.RequestTokenAsync(
@@ -207,13 +208,13 @@ public async Task RequestToken_WithAuthCallback_RetrievesTokenFromCallback()
207208
var authCallbackCalled = false;
208209
var token = new TokenDetails();
209210
var options = new AuthOptions
210-
{
211-
AuthCallback = (x) =>
212-
{
213-
authCallbackCalled = true;
214-
return Task.FromResult<object>(token);
215-
}
216-
};
211+
{
212+
AuthCallback = (x) =>
213+
{
214+
authCallbackCalled = true;
215+
return Task.FromResult<object>(token);
216+
}
217+
};
217218
var result = await rest.Auth.RequestTokenAsync(tokenRequest, options);
218219

219220
authCallbackCalled.Should().BeTrue();
@@ -349,11 +350,11 @@ public async Task WithDefaultAuthParamsAndHeadersAndSpecifiedOnce_ShouldIgnoreTh
349350
});
350351

351352
var options = new AuthOptions
352-
{
353-
AuthUrl = new Uri("http://authUrl"),
354-
AuthHeaders = new Dictionary<string, string> { { "Test", "Test" } },
355-
AuthParams = new Dictionary<string, string> { { "Test", "Test" } },
356-
};
353+
{
354+
AuthUrl = new Uri("http://authUrl"),
355+
AuthHeaders = new Dictionary<string, string> { { "Test", "Test" } },
356+
AuthParams = new Dictionary<string, string> { { "Test", "Test" } },
357+
};
357358

358359
// Act
359360
await rest.Auth.RequestTokenAsync(null, options);
@@ -507,11 +508,11 @@ private async Task SendRequestTokenWithValidOptions()
507508
{
508509
var rest = GetRestClient();
509510
var tokenParams = new TokenParams
510-
{
511-
Capability = new Capability(),
512-
ClientId = "ClientId",
513-
Ttl = TimeSpan.FromMinutes(10)
514-
};
511+
{
512+
Capability = new Capability(),
513+
ClientId = "ClientId",
514+
Ttl = TimeSpan.FromMinutes(10)
515+
};
515516

516517
// Act
517518
await rest.Auth.RequestTokenAsync(tokenParams);

src/IO.Ably.Tests.Shared/MessageEncodes/CipherEncoderTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,15 @@ public void WithOtherTypeOfPayload_LeavesDataAndEncodingIntact()
209209
[Fact]
210210
public void WithCipherEncodingThatDoesNotMatchTheCurrentCipher_LeavesMessageUnencrypted()
211211
{
212-
const string initialEncoding = "utf-8/cipher+aes-128-cbc";
213-
const string encryptedValue = "test";
214-
IPayload payload = new Message { Data = encryptedValue, Encoding = initialEncoding };
212+
const string initialEncoding = "utf-8/cipher+aes-128-cbc";
213+
const string encryptedValue = "test";
214+
IPayload payload = new Message { Data = encryptedValue, Encoding = initialEncoding };
215215

216-
var result = _encoder.Decode(payload, _channelOptions.ToDecodingContext());
216+
var result = _encoder.Decode(payload, _channelOptions.ToDecodingContext());
217217

218-
result.IsFailure.Should().BeTrue();
219-
payload.Encoding.Should().Be(initialEncoding);
220-
payload.Data.Should().Be(encryptedValue);
218+
result.IsFailure.Should().BeTrue();
219+
payload.Encoding.Should().Be(initialEncoding);
220+
payload.Data.Should().Be(encryptedValue);
221221
}
222222
}
223223

0 commit comments

Comments
 (0)