public void TestInvokeInvokeCreateServiceReplicaListeners() { var serviceInstance = new NestedStatefulService(MockStatefulServiceContextFactory.Default); var result = serviceInstance.InvokeCreateServiceReplicaListeners(); Assert.IsInstanceOfType(result, typeof(ServiceReplicaListener[])); }
public async Task TestStatefulInvokeRunAsync() { var serviceInstance = new NestedStatefulService(MockStatefulServiceContextFactory.Default); await serviceInstance.InvokeRunAsync(); Assert.IsTrue(serviceInstance.RunAsyncCalled); }
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); }