public void MonitoredContainer_LeaseStore_IsRequired()
        {
            ChangeFeedProcessorBuilder builder = new ChangeFeedProcessorBuilder("workflowName",
                                                                                ChangeFeedProcessorBuilderTests.GetMockedContainer(),
                                                                                ChangeFeedProcessorBuilderTests.GetMockedProcessor(),
                                                                                ChangeFeedProcessorBuilderTests.GetEmptyInitialization());

            builder.Build();
        }
        public void WorkFlowName_IsRequired()
        {
            ChangeFeedProcessorBuilder builder = new ChangeFeedProcessorBuilder(null,
                                                                                ChangeFeedProcessorBuilderTests.GetMockedContainer(),
                                                                                ChangeFeedProcessorBuilderTests.GetMockedProcessor(),
                                                                                ChangeFeedProcessorBuilderTests.GetEmptyInitialization());

            builder.Build();
        }
        public void CanBuildWithInMemoryContainer()
        {
            ChangeFeedProcessorBuilder builder = new ChangeFeedProcessorBuilder("workflowName",
                                                                                ChangeFeedProcessorBuilderTests.GetMockedContainer(),
                                                                                ChangeFeedProcessorBuilderTests.GetMockedProcessor(),
                                                                                ChangeFeedProcessorBuilderTests.GetEmptyInitialization());

            builder.WithLeaseContainer(ChangeFeedProcessorBuilderTests.GetMockedContainer());

            Assert.IsInstanceOfType(builder.Build(), typeof(ChangeFeedProcessor));
        }
        public void CannotBuildTwice()
        {
            ChangeFeedProcessorBuilder builder = new ChangeFeedProcessorBuilder("workflowName",
                                                                                ChangeFeedProcessorBuilderTests.GetMockedContainer(),
                                                                                ChangeFeedProcessorBuilderTests.GetMockedProcessor(),
                                                                                ChangeFeedProcessorBuilderTests.GetEmptyInitialization());

            builder.WithLeaseContainer(ChangeFeedProcessorBuilderTests.GetMockedContainer());

            // This build should not throw
            builder.Build();

            // This one should
            Assert.ThrowsException <InvalidOperationException>(() => builder.Build());
        }