Example #1
0
        public void TestInvokeInvokeCreateServiceReplicaListeners()
        {
            var serviceInstance = new NestedStatefulService(MockStatefulServiceContextFactory.Default);
            var result          = serviceInstance.InvokeCreateServiceReplicaListeners();

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

            Assert.IsTrue(serviceInstance.RunAsyncCalled);
        }
Example #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);
        }