@@ -18,17 +18,15 @@ namespace Microsoft.Azure.Documents.ChangeFeedProcessor.IntegrationTests
1818 [ Collection ( "Integration tests" ) ]
1919 public class EstimatorTests : IntegrationTest
2020 {
21- public EstimatorTests ( IntegrationTestFixture fixture ) : base ( fixture , typeof ( EstimatorTests ) , false )
21+ public EstimatorTests ( ) : base ( false )
2222 {
2323 }
2424
2525 [ Fact ]
2626 public async Task CountPendingDocuments ( )
2727 {
28- // Cleanup the test collection to avoid other tests' documents causing issues with StartFromBeginning
29- await this . ResetTestCollection ( ) ;
3028 int documentCount = 1 ;
31- int partitionCount = await IntegrationTestsHelper . GetPartitionCount ( this . ClassData . monitoredCollectionInfo ) ;
29+ int partitionCount = await IntegrationTestsHelper . GetPartitionCount ( this . MonitoredCollectionInfo ) ;
3230 int openedCount = 0 , processedCount = 0 ;
3331 var allObserversStarted = new ManualResetEvent ( false ) ;
3432 var allDocsProcessed = new ManualResetEvent ( false ) ;
@@ -52,7 +50,7 @@ public async Task CountPendingDocuments()
5250
5351 var host = new ChangeFeedEventHost (
5452 hostName ,
55- this . ClassData . monitoredCollectionInfo ,
53+ this . MonitoredCollectionInfo ,
5654 this . LeaseCollectionInfo ,
5755 new ChangeFeedOptions { StartFromBeginning = false } ,
5856 new ChangeFeedHostOptions ( ) ) ;
@@ -64,11 +62,11 @@ public async Task CountPendingDocuments()
6462 long estimation = await host . GetEstimatedRemainingWork ( ) ;
6563 Assert . Equal ( 0 , estimation ) ;
6664
67- using ( var client = new DocumentClient ( this . ClassData . monitoredCollectionInfo . Uri , this . ClassData . monitoredCollectionInfo . MasterKey , this . ClassData . monitoredCollectionInfo . ConnectionPolicy ) )
65+ using ( var client = new DocumentClient ( this . MonitoredCollectionInfo . Uri , this . MonitoredCollectionInfo . MasterKey , this . MonitoredCollectionInfo . ConnectionPolicy ) )
6866 {
6967 await IntegrationTestsHelper . CreateDocumentsAsync (
7068 client ,
71- UriFactory . CreateDocumentCollectionUri ( this . ClassData . monitoredCollectionInfo . DatabaseName , this . ClassData . monitoredCollectionInfo . CollectionName ) ,
69+ UriFactory . CreateDocumentCollectionUri ( this . MonitoredCollectionInfo . DatabaseName , this . MonitoredCollectionInfo . CollectionName ) ,
7270 1 ) ;
7371
7472 var isStartOk = allObserversStarted . WaitOne ( IntegrationTest . changeWaitTimeout + IntegrationTest . changeWaitTimeout ) ;
@@ -84,15 +82,15 @@ await IntegrationTestsHelper.CreateDocumentsAsync(
8482
8583 await IntegrationTestsHelper . CreateDocumentsAsync (
8684 client ,
87- UriFactory . CreateDocumentCollectionUri ( this . ClassData . monitoredCollectionInfo . DatabaseName , this . ClassData . monitoredCollectionInfo . CollectionName ) ,
85+ UriFactory . CreateDocumentCollectionUri ( this . MonitoredCollectionInfo . DatabaseName , this . MonitoredCollectionInfo . CollectionName ) ,
8886 1 ) ;
8987
9088 estimation = await host . GetEstimatedRemainingWork ( ) ;
9189 Assert . Equal ( 1 , estimation ) ;
9290
9391 await IntegrationTestsHelper . CreateDocumentsAsync (
9492 client ,
95- UriFactory . CreateDocumentCollectionUri ( this . ClassData . monitoredCollectionInfo . DatabaseName , this . ClassData . monitoredCollectionInfo . CollectionName ) ,
93+ UriFactory . CreateDocumentCollectionUri ( this . MonitoredCollectionInfo . DatabaseName , this . MonitoredCollectionInfo . CollectionName ) ,
9694 10 ) ;
9795
9896 estimation = await host . GetEstimatedRemainingWork ( ) ;
@@ -101,7 +99,7 @@ await IntegrationTestsHelper.CreateDocumentsAsync(
10199 // Create a new host to process pending changes
102100 var newHost = new ChangeFeedEventHost (
103101 hostName ,
104- this . ClassData . monitoredCollectionInfo ,
102+ this . MonitoredCollectionInfo ,
105103 this . LeaseCollectionInfo ,
106104 new ChangeFeedOptions { StartFromBeginning = false } ,
107105 new ChangeFeedHostOptions ( ) ) ;
@@ -132,13 +130,11 @@ await IntegrationTestsHelper.CreateDocumentsAsync(
132130 [ Fact ]
133131 public async Task WhenNoLeasesExistReturn1 ( )
134132 {
135- // Cleanup the test collection to avoid other tests' documents causing issues with StartFromBeginning
136- await this . ResetTestCollection ( ) ;
137133 var hostName = Guid . NewGuid ( ) . ToString ( ) ;
138134
139135 var host = new ChangeFeedEventHost (
140136 hostName ,
141- this . ClassData . monitoredCollectionInfo ,
137+ this . MonitoredCollectionInfo ,
142138 this . LeaseCollectionInfo ,
143139 new ChangeFeedOptions { StartFromBeginning = false } ,
144140 new ChangeFeedHostOptions ( ) ) ;
@@ -155,10 +151,8 @@ public async Task WhenNoLeasesExistReturn1()
155151 [ Fact ]
156152 public async Task WhenLeasesHaveContinuationTokenNullReturn0 ( )
157153 {
158- // Cleanup the test collection to avoid other tests' documents causing issues with StartFromBeginning
159- await this . ResetTestCollection ( ) ;
160154 int documentCount = 1 ;
161- int partitionCount = await IntegrationTestsHelper . GetPartitionCount ( this . ClassData . monitoredCollectionInfo ) ;
155+ int partitionCount = await IntegrationTestsHelper . GetPartitionCount ( this . MonitoredCollectionInfo ) ;
162156 int openedCount = 0 , processedCount = 0 ;
163157 var allObserversStarted = new ManualResetEvent ( false ) ;
164158 var allDocsProcessed = new ManualResetEvent ( false ) ;
@@ -183,7 +177,7 @@ public async Task WhenLeasesHaveContinuationTokenNullReturn0()
183177 // We create a host to initialize the leases with ContinuationToken null
184178 var host = new ChangeFeedEventHost (
185179 hostName ,
186- this . ClassData . monitoredCollectionInfo ,
180+ this . MonitoredCollectionInfo ,
187181 this . LeaseCollectionInfo ,
188182 new ChangeFeedOptions { StartFromBeginning = false } ,
189183 new ChangeFeedHostOptions ( ) ) ;
@@ -205,10 +199,8 @@ public async Task WhenLeasesHaveContinuationTokenNullReturn0()
205199 [ Fact ]
206200 public async Task WhenLeasesHaveContinuationTokenNullStartFromBeginning ( )
207201 {
208- // Cleanup the test collection to avoid other tests' documents causing issues with StartFromBeginning
209- await this . ResetTestCollection ( ) ;
210202 int documentCount = 1 ;
211- int partitionCount = await IntegrationTestsHelper . GetPartitionCount ( this . ClassData . monitoredCollectionInfo ) ;
203+ int partitionCount = await IntegrationTestsHelper . GetPartitionCount ( this . MonitoredCollectionInfo ) ;
212204 int openedCount = 0 , processedCount = 0 ;
213205 var allObserversStarted = new ManualResetEvent ( false ) ;
214206 var allDocsProcessed = new ManualResetEvent ( false ) ;
@@ -233,7 +225,7 @@ public async Task WhenLeasesHaveContinuationTokenNullStartFromBeginning()
233225 // We create a host to initialize the leases with ContinuationToken null
234226 var host = new ChangeFeedEventHost (
235227 hostName ,
236- this . ClassData . monitoredCollectionInfo ,
228+ this . MonitoredCollectionInfo ,
237229 this . LeaseCollectionInfo ,
238230 new ChangeFeedOptions { StartFromBeginning = false } ,
239231 new ChangeFeedHostOptions ( ) ) ;
@@ -244,14 +236,14 @@ public async Task WhenLeasesHaveContinuationTokenNullStartFromBeginning()
244236 await host . UnregisterObserversAsync ( ) ;
245237
246238 using ( var client = new DocumentClient (
247- this . ClassData . monitoredCollectionInfo . Uri ,
248- this . ClassData . monitoredCollectionInfo . MasterKey ,
249- this . ClassData . monitoredCollectionInfo . ConnectionPolicy ) )
239+ this . MonitoredCollectionInfo . Uri ,
240+ this . MonitoredCollectionInfo . MasterKey ,
241+ this . MonitoredCollectionInfo . ConnectionPolicy ) )
250242 {
251243 // Insert documents
252244 await IntegrationTestsHelper . CreateDocumentsAsync (
253245 client ,
254- UriFactory . CreateDocumentCollectionUri ( this . ClassData . monitoredCollectionInfo . DatabaseName , this . ClassData . monitoredCollectionInfo . CollectionName ) ,
246+ UriFactory . CreateDocumentCollectionUri ( this . MonitoredCollectionInfo . DatabaseName , this . MonitoredCollectionInfo . CollectionName ) ,
255247 10 ) ;
256248
257249 // Since the leases have ContinuationToken null state, the estimator will use StartFromBeginning and pick-up the changes that happened from the start
0 commit comments