Beispiel #1
0
 public async Task CloseWithoutStartTestAsync()
 {
     using (var client = new BobNodeClient("Address = 127.0.0.1"))
     {
         await client.CloseAsync();
     }
 }
Beispiel #2
0
        public void PutGetExistOperationGuidTest()
        {
            byte[] defaultData = new byte[] { 1, 2, 3 };
            var    data        = new ConcurrentDictionary <BobKey, byte[]>();

            Guid guid1 = Guid.NewGuid();
            Guid guid2 = Guid.NewGuid();

            Guid[] guidArray = Enumerable.Range(0, 1000).Select(o => Guid.NewGuid()).ToArray();

            using (var client = new BobNodeClient <Guid>(BobNodeClientMockHelper.CreateMockedClientWithData(data), null, null))
            {
                client.Put(guid1, defaultData);

                Assert.Equal(defaultData, client.Get(guid1));
                Assert.Throws <BobKeyNotFoundException>(() => client.Get(guid2));

                Assert.Equal(new bool[] { true, false }, client.Exists(new Guid[] { guid1, guid2 }));

                for (int i = 0; i < guidArray.Length; i++)
                {
                    client.Put(guidArray[i], defaultData);
                }
                for (int i = 0; i < guidArray.Length; i++)
                {
                    Assert.Equal(defaultData, client.Get(guidArray[i]));
                }
                Assert.All(client.Exists(guidArray), res => Assert.True(res));
                Assert.All(client.Exists(Enumerable.Range(0, 100).Select(o => Guid.NewGuid()).ToArray()), res => Assert.False(res));
            }
        }
Beispiel #3
0
        public void NoInfiniteRetriesTest()
        {
            byte[] defaultData = new byte[] { 1, 2, 3 };
            var    data        = new ConcurrentDictionary <BobKey, byte[]>();

            var behaviour1 = new BobNodeClientMockHelper.MockClientBehaviour();
            var stat1      = new BobNodeClientMockHelper.MockClientStat();
            var behaviour2 = new BobNodeClientMockHelper.MockClientBehaviour();
            var stat2      = new BobNodeClientMockHelper.MockClientStat();

            BobNodeClient[] clients = new BobNodeClient[]
            {
                BobNodeClientMockHelper.CreateMockedClientWithData(data, behaviour: behaviour1, stat: stat1),
                BobNodeClientMockHelper.CreateMockedClientWithData(data, behaviour: behaviour2, stat: stat2)
            };

            behaviour1.ErrorStatus = new Grpc.Core.Status(Grpc.Core.StatusCode.Internal, "Internal error");
            behaviour2.ErrorStatus = new Grpc.Core.Status(Grpc.Core.StatusCode.Internal, "Internal error");

            using (var client = new BobClusterClient(clients, SequentialNodeSelectionPolicy.Factory, operationRetryCount: 10))
            {
                Assert.Throws <BobOperationException>(() => client.Put(BobKey.FromUInt64(1), defaultData));
                Assert.Throws <BobOperationException>(() => client.Get(BobKey.FromUInt64(1)));
            }
        }
Beispiel #4
0
 public void CloseWithoutStartTest()
 {
     using (var client = new BobNodeClient("Address = 127.0.0.1"))
     {
         client.Close();
     }
 }
Beispiel #5
0
        public static BobNodeClient CreateMockedClient(string connectionString, Mock <BobStorage.BobApi.BobApiClient> rpcClientMock)
        {
            var result         = new BobNodeClient(connectionString);
            var rpcClientField = result.GetType().GetField("_rpcClient", BindingFlags.NonPublic | BindingFlags.Instance);

            rpcClientField.SetValue(result, rpcClientMock.Object);
            return(result);
        }
Beispiel #6
0
        public void PutGetExistOperationWithRetriesTest()
        {
            byte[] defaultData = new byte[] { 1, 2, 3 };
            var    data        = new ConcurrentDictionary <BobKey, byte[]>();

            var behaviour1 = new BobNodeClientMockHelper.MockClientBehaviour();
            var behaviour2 = new BobNodeClientMockHelper.MockClientBehaviour();

            BobNodeClient[] clients = new BobNodeClient[]
            {
                BobNodeClientMockHelper.CreateMockedClientWithData(data, behaviour: behaviour1, stat: null),
                BobNodeClientMockHelper.CreateMockedClientWithData(data, behaviour: behaviour2, stat: null)
            };

            behaviour1.ErrorStatus = new Grpc.Core.Status(Grpc.Core.StatusCode.Internal, "Internal error");

            using (var client = new BobClusterClient <ulong>(clients, SequentialNodeSelectionPolicy.Factory, operationRetryCount: 1, keySerializer: null, keySerializationPoolSize: null))
            {
                client.Put(1, defaultData);
                client.Put(ulong.MaxValue, defaultData);

                Assert.Equal(defaultData, client.Get(1));
                Assert.Equal(defaultData, client.Get(ulong.MaxValue));
                Assert.Throws <BobKeyNotFoundException>(() => client.Get(2));

                Assert.Equal(new bool[] { true, false }, client.Exists(new ulong[] { 1, 2 }));

                for (ulong i = 100; i < 1000; i++)
                {
                    client.Put(i, defaultData);
                }
                for (ulong i = 100; i < 1000; i++)
                {
                    Assert.Equal(defaultData, client.Get(i));
                }
                for (ulong i = 100; i < 1000; i++)
                {
                    Assert.Equal(defaultData, client.Get(i, fullGet: true, new CancellationToken()));
                }

                Assert.All(client.Exists(Enumerable.Range(100, 1000 - 100).Select(o => (ulong)o).ToArray()), res => Assert.True(res));
                Assert.All(client.Exists(Enumerable.Range(20000, 1000).Select(o => (ulong)o).ToArray(), fullGet: true, new CancellationToken()), res => Assert.False(res));

                Assert.All(client.Exists(Enumerable.Range(100, 1000 - 100).Select(o => (ulong)o).ToList()), res => Assert.True(res));
                Assert.All(client.Exists(Enumerable.Range(20000, 1000).Select(o => (ulong)o).ToList(), fullGet: true, new CancellationToken()), res => Assert.False(res));


                for (ulong i = uint.MaxValue; i < (ulong)uint.MaxValue + 1000; i++)
                {
                    client.Put(i, defaultData);
                }
                for (ulong i = uint.MaxValue; i < (ulong)uint.MaxValue + 1000; i++)
                {
                    Assert.Equal(defaultData, client.Get(i));
                }
            }
        }
Beispiel #7
0
        public void PutGetExistOperationUInt64ConcurrentTest(int threadCount)
        {
            byte[] defaultData = new byte[] { 1, 2, 3 };
            var    data        = new ConcurrentDictionary <BobKey, byte[]>();

            data[BobKey.FromUInt64(1)] = defaultData;
            data[BobKey.FromUInt64(ulong.MaxValue)] = defaultData;

            using (var client = new BobNodeClient <ulong>(BobNodeClientMockHelper.CreateMockedClientWithData(data), null, null))
            {
                Barrier bar = new Barrier(threadCount + 1);

                void MainAction()
                {
                    bar.SignalAndWait(10000);

                    Assert.Equal(defaultData, client.Get(1));
                    Assert.Equal(defaultData, client.Get(ulong.MaxValue));
                    Assert.Throws <BobKeyNotFoundException>(() => client.Get(2));

                    Assert.Equal(new bool[] { true, false }, client.Exists(new ulong[] { 1, 2 }));

                    for (ulong i = 100; i < 10000; i++)
                    {
                        client.Put(i, defaultData);
                    }
                    for (ulong i = 100; i < 10000; i++)
                    {
                        Assert.Equal(defaultData, client.Get(i));
                    }
                    Assert.All(client.Exists(Enumerable.Range(100, 10000 - 100).Select(o => (ulong)o).ToArray()), res => Assert.True(res));
                    Assert.All(client.Exists(Enumerable.Range(20000, 1000).Select(o => (ulong)o).ToArray()), res => Assert.False(res));


                    for (ulong i = uint.MaxValue; i < (ulong)uint.MaxValue + 1000; i++)
                    {
                        client.Put(i, defaultData);
                    }
                    for (ulong i = uint.MaxValue; i < (ulong)uint.MaxValue + 1000; i++)
                    {
                        Assert.Equal(defaultData, client.Get(i));
                    }
                }

                Task[] tasks = new Task[threadCount];
                for (int i = 0; i < tasks.Length; i++)
                {
                    tasks[i] = Task.Factory.StartNew(MainAction, TaskCreationOptions.LongRunning);
                }

                bar.SignalAndWait(10000);

                Task.WaitAll(tasks);
            }
        }
Beispiel #8
0
 public void ConnectionStringParametersPassedTest()
 {
     using (var client = new BobNodeClient("Address = 127.0.0.1; User = user; Password = pass; ConnectionTimeout = 00:00:33; OperationTimeout = 00:00:22"))
     {
         Assert.Equal("127.0.0.1", client.ConnectionParameters.Host);
         Assert.Equal("user", client.ConnectionParameters.User);
         Assert.Equal("pass", client.ConnectionParameters.Password);
         Assert.Equal(TimeSpan.Parse("00:00:33"), client.ConnectionParameters.ConnectionTimeout);
         Assert.Equal(TimeSpan.Parse("00:00:22"), client.ConnectionParameters.OperationTimeout);
     }
 }
Beispiel #9
0
        public void NegativeOperationsRetryCountConvertsToNumberOfNodes()
        {
            var data = new ConcurrentDictionary <BobKey, byte[]>();

            BobNodeClient[] clients = new BobNodeClient[]
            {
                BobNodeClientMockHelper.CreateMockedClientWithData(data, behaviour: null, stat: null),
                BobNodeClientMockHelper.CreateMockedClientWithData(data, behaviour: null, stat: null)
            };

            using (var client = new BobClusterClient(clients, SequentialNodeSelectionPolicy.Factory, operationRetryCount: -1))
            {
                Assert.Equal(clients.Length - 1, client.OperationRetryCount);
            }
        }
Beispiel #10
0
        public void ConnectionParametersPassedTest()
        {
            BobConnectionParametersBuilder brld = new BobConnectionParametersBuilder()
            {
                Host              = "127.0.0.1",
                User              = "******",
                Password          = "******",
                ConnectionTimeout = TimeSpan.Parse("00:00:33"),
                OperationTimeout  = TimeSpan.Parse("00:00:22")
            };

            using (var client = new BobNodeClient(brld.Build()))
            {
                Assert.Equal("127.0.0.1", client.ConnectionParameters.Host);
                Assert.Equal("user", client.ConnectionParameters.User);
                Assert.Equal("pass", client.ConnectionParameters.Password);
                Assert.Equal(TimeSpan.Parse("00:00:33"), client.ConnectionParameters.ConnectionTimeout);
                Assert.Equal(TimeSpan.Parse("00:00:22"), client.ConnectionParameters.OperationTimeout);
            }
        }
Beispiel #11
0
        public async Task RetriesWorksTestAsync()
        {
            byte[] defaultData = new byte[] { 1, 2, 3 };
            var    data        = new ConcurrentDictionary <BobKey, byte[]>();

            var behaviour1 = new BobNodeClientMockHelper.MockClientBehaviour();
            var stat1      = new BobNodeClientMockHelper.MockClientStat();
            var behaviour2 = new BobNodeClientMockHelper.MockClientBehaviour();
            var stat2      = new BobNodeClientMockHelper.MockClientStat();

            BobNodeClient[] clients = new BobNodeClient[]
            {
                BobNodeClientMockHelper.CreateMockedClientWithData(data, behaviour: behaviour1, stat: stat1),
                BobNodeClientMockHelper.CreateMockedClientWithData(data, behaviour: behaviour2, stat: stat2)
            };

            behaviour1.ErrorStatus = new Grpc.Core.Status(Grpc.Core.StatusCode.Internal, "Internal error");

            using (var client = new BobClusterClient(clients, SequentialNodeSelectionPolicy.Factory, operationRetryCount: 1))
            {
                await client.PutAsync(BobKey.FromUInt64(1), defaultData);

                Assert.Equal(defaultData, await client.GetAsync(BobKey.FromUInt64(1)));
                Assert.True((await client.ExistsAsync(new BobKey[] { BobKey.FromUInt64(1) }))[0]);

                for (int i = 10; i < 100; i++)
                {
                    await client.PutAsync(BobKey.FromUInt64((ulong)i), defaultData);
                }

                for (int i = 10; i < 100; i++)
                {
                    Assert.Equal(defaultData, await client.GetAsync(BobKey.FromUInt64((ulong)i)));
                }

                for (int i = 10; i < 100; i++)
                {
                    Assert.True((await client.ExistsAsync(new BobKey[] { BobKey.FromUInt64((ulong)i) }))[0]);
                }
            }
        }
Beispiel #12
0
        public void PutGetExistOperationUInt64Test()
        {
            byte[] defaultData = new byte[] { 1, 2, 3 };
            var    data        = new ConcurrentDictionary <BobKey, byte[]>();

            data[BobKey.FromUInt64(1)] = defaultData;
            data[BobKey.FromUInt64(ulong.MaxValue)] = defaultData;

            using (var client = new BobNodeClient <ulong>(BobNodeClientMockHelper.CreateMockedClientWithData(data), null, null))
            {
                Assert.Equal(defaultData, client.Get(1));
                Assert.Equal(defaultData, client.Get(ulong.MaxValue));
                Assert.Throws <BobKeyNotFoundException>(() => client.Get(2));

                Assert.Equal(new bool[] { true, false }, client.Exists(new ulong[] { 1, 2 }));

                for (ulong i = 100; i < 10000; i++)
                {
                    client.Put(i, defaultData);
                }
                for (ulong i = 100; i < 10000; i++)
                {
                    Assert.Equal(defaultData, client.Get(i));
                }
                Assert.All(client.Exists(Enumerable.Range(100, 10000 - 100).Select(o => (ulong)o).ToArray()), res => Assert.True(res));
                Assert.All(client.Exists(Enumerable.Range(20000, 1000).Select(o => (ulong)o).ToArray()), res => Assert.False(res));

                Assert.All(client.Exists(Enumerable.Range(100, 10000 - 100).Select(o => (ulong)o).ToList()), res => Assert.True(res));
                Assert.All(client.Exists(Enumerable.Range(20000, 1000).Select(o => (ulong)o).ToList()), res => Assert.False(res));

                for (ulong i = uint.MaxValue; i < (ulong)uint.MaxValue + 1000; i++)
                {
                    client.Put(i, defaultData);
                }
                for (ulong i = uint.MaxValue; i < (ulong)uint.MaxValue + 1000; i++)
                {
                    Assert.Equal(defaultData, client.Get(i));
                }
            }
        }
Beispiel #13
0
        public void NoRetryForKeyNotFoundTest()
        {
            byte[] defaultData = new byte[] { 1, 2, 3 };
            var    data        = new ConcurrentDictionary <BobKey, byte[]>();

            var behaviour1 = new BobNodeClientMockHelper.MockClientBehaviour();
            var stat1      = new BobNodeClientMockHelper.MockClientStat();
            var behaviour2 = new BobNodeClientMockHelper.MockClientBehaviour();
            var stat2      = new BobNodeClientMockHelper.MockClientStat();

            BobNodeClient[] clients = new BobNodeClient[]
            {
                BobNodeClientMockHelper.CreateMockedClientWithData(data, behaviour: behaviour1, stat: stat1),
                BobNodeClientMockHelper.CreateMockedClientWithData(data, behaviour: behaviour2, stat: stat2)
            };

            using (var client = new BobClusterClient(clients, SequentialNodeSelectionPolicy.Factory, operationRetryCount: 10))
            {
                Assert.Throws <BobKeyNotFoundException>(() => client.Get(BobKey.FromUInt64(1)));
                Assert.Equal(1, stat1.GetRequestCount + stat2.GetRequestCount);

                Assert.Throws <BobKeyNotFoundException>(() => client.Get(BobKey.FromUInt64(2)));
                Assert.Equal(2, stat1.GetRequestCount + stat2.GetRequestCount);

                Assert.Throws <BobKeyNotFoundException>(() => client.Get(BobKey.FromUInt64(3)));
                Assert.Equal(3, stat1.GetRequestCount + stat2.GetRequestCount);


                Assert.Throws <BobKeyNotFoundException>(() => client.GetAsync(BobKey.FromUInt64(1)).GetAwaiter().GetResult());
                Assert.Equal(4, stat1.GetRequestCount + stat2.GetRequestCount);

                Assert.Throws <BobKeyNotFoundException>(() => client.GetAsync(BobKey.FromUInt64(2)).GetAwaiter().GetResult());
                Assert.Equal(5, stat1.GetRequestCount + stat2.GetRequestCount);

                Assert.Throws <BobKeyNotFoundException>(() => client.GetAsync(BobKey.FromUInt64(3)).GetAwaiter().GetResult());
                Assert.Equal(6, stat1.GetRequestCount + stat2.GetRequestCount);
            }
        }
Beispiel #14
0
        public async Task PutGetExistOperationInt32TestAsync()
        {
            byte[] defaultData = new byte[] { 1, 2, 3 };
            var    data        = new ConcurrentDictionary <BobKey, byte[]>();

            using (var client = new BobNodeClient <int>(BobNodeClientMockHelper.CreateMockedClientWithData(data), null, null))
            {
                client.Put(1, defaultData);
                client.Put(int.MaxValue, defaultData);

                Assert.Equal(defaultData, await client.GetAsync(1));
                Assert.Equal(defaultData, await client.GetAsync(int.MaxValue));
                Assert.Throws <BobKeyNotFoundException>(() => client.GetAsync(2).GetAwaiter().GetResult());

                Assert.Equal(new bool[] { true, false }, await client.ExistsAsync(new int[] { 1, 2 }));

                for (int i = 100; i < 10000; i++)
                {
                    await client.PutAsync(i, defaultData);
                }
                for (int i = 100; i < 10000; i++)
                {
                    Assert.Equal(defaultData, await client.GetAsync(i));
                }
                Assert.All(await client.ExistsAsync(Enumerable.Range(100, 10000 - 100).Select(o => o).ToArray()), res => Assert.True(res));
                Assert.All(await client.ExistsAsync(Enumerable.Range(20000, 1000).Select(o => o).ToArray()), res => Assert.False(res));


                for (int i = int.MaxValue - 1000; i < int.MaxValue - 1; i++)
                {
                    await client.PutAsync(i, defaultData);
                }
                for (int i = int.MaxValue - 1000; i < int.MaxValue - 1; i++)
                {
                    Assert.Equal(defaultData, await client.GetAsync(i));
                }
            }
        }
Beispiel #15
0
        public void PutGetExistOperationTest()
        {
            byte[] defaultData = new byte[] { 1, 2, 3 };
            var    data        = new ConcurrentDictionary <BobKey, byte[]>();

            var stat1 = new BobNodeClientMockHelper.MockClientStat();
            var stat2 = new BobNodeClientMockHelper.MockClientStat();

            BobNodeClient[] clients = new BobNodeClient[]
            {
                BobNodeClientMockHelper.CreateMockedClientWithData(data, behaviour: null, stat: stat1),
                BobNodeClientMockHelper.CreateMockedClientWithData(data, behaviour: null, stat: stat2)
            };

            using (var client = new BobClusterClient <ulong>(clients, SequentialNodeSelectionPolicy.Factory, operationRetryCount: 0, keySerializer: null, keySerializationPoolSize: null))
            {
                client.Put(1, defaultData);
                client.Put(ulong.MaxValue, defaultData);
                Assert.Equal(2, stat1.PutRequestCount + stat2.PutRequestCount);

                Assert.Equal(defaultData, client.Get(1));
                Assert.Equal(defaultData, client.Get(ulong.MaxValue));
                Assert.Throws <BobKeyNotFoundException>(() => client.Get(2));
                Assert.Equal(3, stat1.GetRequestCount + stat2.GetRequestCount);

                Assert.Equal(new bool[] { true, false }, client.Exists(new ulong[] { 1, 2 }));
                Assert.Equal(1, stat1.ExistsRequestCount + stat2.ExistsRequestCount);

                for (ulong i = 100; i < 10000; i++)
                {
                    client.Put(i, defaultData);
                }
                for (ulong i = 100; i < 10000; i++)
                {
                    Assert.Equal(defaultData, client.Get(i));
                }
                for (ulong i = 100; i < 10000; i++)
                {
                    Assert.Equal(defaultData, client.Get(i, fullGet: true, new CancellationToken()));
                }
                Assert.Equal(10000 - 100, stat1.RequestsWithFullGet + stat2.RequestsWithFullGet);

                Assert.All(client.Exists(Enumerable.Range(100, 10000 - 100).Select(o => (ulong)o).ToArray()), res => Assert.True(res));
                Assert.All(client.Exists(Enumerable.Range(20000, 1000).Select(o => (ulong)o).ToArray(), fullGet: true, new CancellationToken()), res => Assert.False(res));

                Assert.All(client.Exists(Enumerable.Range(100, 10000 - 100).Select(o => (ulong)o).ToList()), res => Assert.True(res));
                Assert.All(client.Exists(Enumerable.Range(20000, 1000).Select(o => (ulong)o).ToList(), fullGet: true, new CancellationToken()), res => Assert.False(res));

                Assert.Equal(10000 - 100 + 2, stat1.RequestsWithFullGet + stat2.RequestsWithFullGet);

                for (ulong i = uint.MaxValue; i < (ulong)uint.MaxValue + 1000; i++)
                {
                    client.Put(i, defaultData);
                }
                for (ulong i = uint.MaxValue; i < (ulong)uint.MaxValue + 1000; i++)
                {
                    Assert.Equal(defaultData, client.Get(i));
                }

                Assert.True(stat1.RequestsWithFullGet + stat2.RequestsWithFullGet > 0);
                Assert.True(stat1.TotalRequestCount > 0);
                Assert.True(stat2.TotalRequestCount > 0);
                Assert.True(Math.Abs(stat1.TotalRequestCount - stat2.TotalRequestCount) <= 1);
            }
        }
Beispiel #16
0
        public async Task PutGetExistOperationTestAsync()
        {
            byte[] defaultData = new byte[] { 1, 2, 3 };
            var    data        = new ConcurrentDictionary <BobKey, byte[]>();

            var stat1 = new BobNodeClientMockHelper.MockClientStat();
            var stat2 = new BobNodeClientMockHelper.MockClientStat();

            BobNodeClient[] clients = new BobNodeClient[]
            {
                BobNodeClientMockHelper.CreateMockedClientWithData(data, behaviour: null, stat: stat1),
                BobNodeClientMockHelper.CreateMockedClientWithData(data, behaviour: null, stat: stat2)
            };

            using (var client = new BobClusterClient(clients, SequentialNodeSelectionPolicy.Factory, 0))
            {
                await client.PutAsync(BobKey.FromUInt64(1), defaultData);

                await client.PutAsync(BobKey.FromUInt64(ulong.MaxValue), defaultData);

                Assert.Equal(2, stat1.PutRequestCount + stat2.PutRequestCount);

                Assert.Equal(defaultData, await client.GetAsync(BobKey.FromUInt64(1)));
                Assert.Equal(defaultData, await client.GetAsync(BobKey.FromUInt64(ulong.MaxValue)));
                await Assert.ThrowsAsync <BobKeyNotFoundException>(() => client.GetAsync(BobKey.FromUInt64(2)));

                Assert.Equal(3, stat1.GetRequestCount + stat2.GetRequestCount);

                Assert.Equal(new bool[] { true, false }, await client.ExistsAsync(new BobKey[] { BobKey.FromUInt64(1), BobKey.FromUInt64(2) }));
                Assert.Equal(1, stat1.ExistsRequestCount + stat2.ExistsRequestCount);

                for (ulong i = 100; i < 10000; i++)
                {
                    await client.PutAsync(BobKey.FromUInt64(i), defaultData);
                }
                for (ulong i = 100; i < 10000; i++)
                {
                    Assert.Equal(defaultData, await client.GetAsync(BobKey.FromUInt64(i)));
                }
                for (ulong i = 100; i < 10000; i++)
                {
                    Assert.Equal(defaultData, await client.GetAsync(BobKey.FromUInt64(i), fullGet: true, new CancellationToken()));
                }
                Assert.Equal(10000 - 100, stat1.RequestsWithFullGet + stat2.RequestsWithFullGet);

                Assert.All(await client.ExistsAsync(Enumerable.Range(100, 10000 - 100).Select(o => BobKey.FromUInt64((ulong)o)).ToArray()), res => Assert.True(res));
                Assert.All(await client.ExistsAsync(Enumerable.Range(20000, 1000).Select(o => BobKey.FromUInt64((ulong)o)).ToArray(), fullGet: true, new CancellationToken()), res => Assert.False(res));
                Assert.Equal(10000 - 100 + 1, stat1.RequestsWithFullGet + stat2.RequestsWithFullGet);

                for (ulong i = uint.MaxValue; i < (ulong)uint.MaxValue + 1000; i++)
                {
                    await client.PutAsync(BobKey.FromUInt64(i), defaultData);
                }
                for (ulong i = uint.MaxValue; i < (ulong)uint.MaxValue + 1000; i++)
                {
                    Assert.Equal(defaultData, await client.GetAsync(BobKey.FromUInt64(i)));
                }

                Assert.True(stat1.RequestsWithFullGet + stat2.RequestsWithFullGet > 0);
                Assert.True(stat1.TotalRequestCount > 0);
                Assert.True(stat2.TotalRequestCount > 0);
                Assert.True(Math.Abs(stat1.TotalRequestCount - stat2.TotalRequestCount) <= 1);
            }
        }
Beispiel #17
0
 public void DisposeWithoutStartTest()
 {
     using (var client = new BobNodeClient("Address = 127.0.0.1"))
     {
     }
 }