Exemplo n.º 1
0
        public void TestInvokeInvokeCreateServiceReplicaListeners()
        {
            var serviceInstance = new NestedStatefulService(MockStatefulServiceContextFactory.Default);
            var result          = serviceInstance.InvokeCreateServiceReplicaListeners();

            Assert.IsInstanceOfType(result, typeof(ServiceReplicaListener[]));
        }
Exemplo n.º 2
0
        public async Task TestStatefulInvokeRunAsync()
        {
            var serviceInstance = new NestedStatefulService(MockStatefulServiceContextFactory.Default);
            await serviceInstance.InvokeRunAsync();

            Assert.IsTrue(serviceInstance.RunAsyncCalled);
        }
Exemplo n.º 3
0
        public async Task TestStatefulInvokeOnChangeRoleAsync()
        {
            var serviceInstance = new NestedStatefulService(MockStatefulServiceContextFactory.Default);
            await serviceInstance.InvokeOnChangeRoleAsync(ReplicaRole.Primary);

            Assert.IsTrue(serviceInstance.OnChangeRoleCalled);
        }
        public void TestStatefulServiceWithMockPartition()
        {
            var partition     = new MockStatefulServicePartition();
            var partitionInfo = MockQueryPartitionFactory.CreateIntPartitonInfo();

            partition.PartitionInfo = partitionInfo;
            var statefulServiceContext = MockStatefulServiceContextFactory.Default;

            var sut = new NestedStatefulService(statefulServiceContext);

            sut.SetPartition(partition);

            Assert.AreEqual(partitionInfo, sut.GetPartition().PartitionInfo);
        }