private void AssertNoAffinity(GcpCallInvoker invoker) { var channelRefs = invoker.GetChannelRefsForTest(); Assert.AreEqual(0, channelRefs.Sum(cr => cr.AffinityCount)); Assert.AreEqual(0, invoker.GetChannelRefsByAffinityKeyForTest().Count); }
public void BoundAfterUnbind() { CreateSessionRequest request = new CreateSessionRequest { Database = DatabaseUrl }; Session session = client.CreateSession(request); Assert.AreEqual(1, invoker.GetChannelRefsByAffinityKeyForTest().Count); DeleteSessionRequest deleteSessionRequest = new DeleteSessionRequest { Name = session.Name }; client.DeleteSession(deleteSessionRequest); Assert.AreEqual(0, invoker.GetChannelRefsByAffinityKeyForTest().Count); GetSessionRequest getSessionRequest = new GetSessionRequest(); getSessionRequest.Name = session.Name; Assert.ThrowsException <Grpc.Core.RpcException>(() => client.GetSession(getSessionRequest)); }