public async Task ShouldCreateClientWithGuidIdentity(AnonymousConnectionInitializer sut)
        {
            var client = await sut.ConnectAsync(Create <IConnection>(), Cts.Token);

            Assert.False(string.IsNullOrWhiteSpace(client.ClientId));
            Assert.NotEqual(Guid.Empty, Guid.Parse(client.ClientId));
        }
        public async Task ShouldSetUpdateDetector(
            [Frozen] IUpdateDetector updateDetector,
            AnonymousConnectionInitializer sut)
        {
            var client = await sut.ConnectAsync(Create <IConnection>(), Cts.Token);

            Assert.Equal(updateDetector, GetPrivateField(client, "_updateDetector"));
        }
        public async Task ShouldSetConnection(
            IConnection connection,
            AnonymousConnectionInitializer sut)
        {
            var client = await sut.ConnectAsync(connection, Cts.Token);

            Assert.Equal(connection, client.Connection);
        }
        public async Task ShouldCreateUniqueIdentities(AnonymousConnectionInitializer sut)
        {
            var client1 = await sut.ConnectAsync(Create <IConnection>(), Cts.Token);

            var client2 = await sut.ConnectAsync(Create <IConnection>(), Cts.Token);

            Assert.NotEqual(client1.ClientId, client2.ClientId);
        }
 public async Task ShouldNotUseCancellationToken(AnonymousConnectionInitializer sut)
 {
     Assert.NotNull(await sut.ConnectAsync(Create <IConnection>(), new CancellationToken(true)));
 }
        public async Task ShouldSetGroupToLobby(AnonymousConnectionInitializer sut)
        {
            var client = await sut.ConnectAsync(Create <IConnection>(), Cts.Token);

            Assert.Equal("Lobby", client.Group);
        }