public void ExecuteBatchesWithoutResultWithNullEntities() { // Arrange Mock <ICloudTable> cloudTableMock = MocksFactory.GetCloudTableMock(); Mock <ITableEntityConverter <Country> > entityConverterMock = MocksFactory.GetTableEntityConverterMock <Country>(); Mock <ITableBatchPartitioner> batchPartitionerMock = MocksFactory.GetTableBatchPartitionerMock(); var executor = new TableRequestSequentialExecutor <Country>(cloudTableMock.Object, entityConverterMock.Object, batchPartitionerMock.Object); // Act && Assert Assert.Throws <ArgumentNullException>(() => executor.ExecuteBatchesWithoutResult(null, null)); }
public void ExecuteBatchesWithoutResult() { // Arrange Mock <ICloudTable> cloudTableMock = MocksFactory.GetCloudTableMock(); Mock <ITableEntityConverter <Country> > entityConverterMock = MocksFactory.GetTableEntityConverterMock <Country>(); Mock <ITableBatchPartitioner> batchPartitionerMock = MocksFactory.GetTableBatchPartitionerMock(); var executor = new TableRequestSequentialExecutor <Country>(cloudTableMock.Object, entityConverterMock.Object, batchPartitionerMock.Object); var entities = ObjectsFactory.GetCountries(); // Act executor.ExecuteBatchesWithoutResult(entities, TableOperation.Insert); // Assert entityConverterMock.Verify(p => p.GetEntity(It.IsAny <Country>()), Times.Exactly(2)); batchPartitionerMock.Verify(p => p.GetBatches(It.IsAny <IEnumerable <ITableEntity> >(), It.IsAny <Func <ITableEntity, TableOperation> >()), Times.Once()); }
public void ExecuteBatchesWithoutResult() { // Arrange Mock<ICloudTable> cloudTableMock = MocksFactory.GetCloudTableMock(); Mock<ITableEntityConverter<Country>> entityConverterMock = MocksFactory.GetTableEntityConverterMock<Country>(); Mock<ITableBatchPartitioner> batchPartitionerMock = MocksFactory.GetTableBatchPartitionerMock(); var executor = new TableRequestSequentialExecutor<Country>(cloudTableMock.Object, entityConverterMock.Object, batchPartitionerMock.Object); var entities = ObjectsFactory.GetCountries(); // Act executor.ExecuteBatchesWithoutResult(entities, TableOperation.Insert); // Assert entityConverterMock.Verify(p => p.GetEntity(It.IsAny<Country>()), Times.Exactly(2)); batchPartitionerMock.Verify(p => p.GetBatches(It.IsAny<IEnumerable<ITableEntity>>(), It.IsAny<Func<ITableEntity, TableOperation>>()), Times.Once()); }
public void ExecuteBatchesWithoutResultWithNullOperation() { // Arrange Mock<ICloudTable> cloudTableMock = MocksFactory.GetCloudTableMock(); Mock<ITableEntityConverter<Country>> entityConverterMock = MocksFactory.GetTableEntityConverterMock<Country>(); Mock<ITableBatchPartitioner> batchPartitionerMock = MocksFactory.GetTableBatchPartitionerMock(); var executor = new TableRequestSequentialExecutor<Country>(cloudTableMock.Object, entityConverterMock.Object, batchPartitionerMock.Object); var entities = ObjectsFactory.GetCountries(); // Act && Assert Assert.Throws<ArgumentNullException>(() => executor.ExecuteBatchesWithoutResult(entities, null)); }